]> gcc.gnu.org Git - gcc.git/commitdiff
PR modula2/108119 disable m2rte plugin by default
authorGaius Mulley <gaiusmod2@gmail.com>
Sat, 12 Aug 2023 12:43:14 +0000 (13:43 +0100)
committerGaius Mulley <gaiusmod2@gmail.com>
Sat, 12 Aug 2023 12:43:14 +0000 (13:43 +0100)
This patch disables the m2rte plugin by default.  The driver
will only append the -fplugin=m2rte command line option for cc1gm2
if -fm2-plugin is present.  It only enabled providing ENABLE_PLUGIN
is defined.  gcc/m2/Make-file.in will only build and install m2rte
if enable_plugin is yes.

gcc/m2/ChangeLog:

PR modula2/108119
* Make-lang.in (M2RTE_PLUGIN_SO): Assigned to
plugin/m2rte$(exeext).so if enable_plugin is yes.
(m2.all.cross): Replace plugin/m2rte$(soext) with
$(M2RTE_PLUGIN_SO).
(m2.all.encap): Replace plugin/m2rte$(soext) with
$(M2RTE_PLUGIN_SO).
(m2.install-plugin): Add dummy rule when enable_plugin
is not yes.
(plugin/m2rte$(exeext).so): Add dummy rule when enable_plugin
is not yes.
(m2/stage2/cc1gm2$(exeext)): Replace plugin/m2rte$(soext) with
$(M2RTE_PLUGIN_SO).
(m2/stage1/cc1gm2$(exeext)): Replace plugin/m2rte$(soext) with
$(M2RTE_PLUGIN_SO).
* gm2spec.cc (lang_specific_driver): Set need_plugin to false
by default.

gcc/testsuite/ChangeLog:

PR modula2/108119
* gm2/iso/check/fail/iso-check-fail.exp (gm2_init_iso): Add -fm2-plugin.
* gm2/switches/auto-init/fail/switches-auto-init-fail.exp
(gm2_init_iso): Add -fm2-plugin.
* gm2/switches/check-all/pim2/fail/switches-check-all-pim2-fail.exp
(gm2_init_pim2): Add -fm2-plugin.
* gm2/switches/check-all/plugin/iso/fail/switches-check-all-plugin-iso-fail.exp
(gm2_init_iso): Add -fm2-plugin.
* gm2/switches/check-all/plugin/pim2/fail/switches-check-all-plugin-pim2-fail.exp
(gm2_init_pim2): Add -fm2-plugin.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
gcc/m2/Make-lang.in
gcc/m2/gm2spec.cc
gcc/testsuite/gm2/iso/check/fail/iso-check-fail.exp
gcc/testsuite/gm2/switches/auto-init/fail/switches-auto-init-fail.exp
gcc/testsuite/gm2/switches/check-all/pim2/fail/switches-check-all-pim2-fail.exp
gcc/testsuite/gm2/switches/check-all/plugin/iso/fail/switches-check-all-plugin-iso-fail.exp
gcc/testsuite/gm2/switches/check-all/plugin/pim2/fail/switches-check-all-plugin-pim2-fail.exp

index 23632c29125bd8621c05ddb4c298b03616643faf..8c6bac229e7033b72abf0b3323bcb18c3e6224c8 100644 (file)
@@ -90,6 +90,10 @@ PGE=m2/pge$(exeext)
 
 SRC_PREFIX=G
 
+ifeq ($(enable_plugin),yes)
+M2RTE_PLUGIN_SO=plugin/m2rte$(exeext).so
+endif
+
 m2/gm2spec.o: $(srcdir)/m2/gm2spec.cc $(SYSTEM_H) $(GCC_H) $(CONFIG_H) \
                m2/gm2config.h $(TARGET_H) $(PLUGIN_HEADERS) \
                $(generated_files) $(C_TREE_H) insn-attr-common.h
@@ -122,9 +126,9 @@ po-generated:
 
 # Build hooks:
 
-m2.all.cross: gm2-cross$(exeext) plugin/m2rte$(soext)
+m2.all.cross: gm2-cross$(exeext) $(M2RTE_PLUGIN_SO)
 
-m2.start.encap: gm2$(exeext) plugin/m2rte$(soext)
+m2.start.encap: gm2$(exeext) $(M2RTE_PLUGIN_SO)
 m2.rest.encap:
 
 
@@ -400,9 +404,10 @@ m2.uninstall:
        -rm -rf $(bindir)/$(GM2_INSTALL_NAME)
        -rm -rf $(bindir)/$(GM2_CROSS_NAME)
 
+ifeq ($(enable_plugin),yes)
 m2.install-plugin: installdirs
        $(mkinstalldirs) $(DESTDIR)$(plugin_resourcesdir)
-       $(INSTALL_PROGRAM) plugin/m2rte$(soext) $(DESTDIR)$(plugin_resourcesdir)/m2rte$(soext)
+       $(INSTALL_PROGRAM) $(M2RTE_PLUGIN_SO) $(DESTDIR)$(plugin_resourcesdir)/m2rte$(soext)
        chmod a+x $(DESTDIR)$(plugin_resourcesdir)/m2rte$(soext)
 
 override PLUGINCFLAGS := $(filter-out -mdynamic-no-pic,$(PLUGINCFLAGS))
@@ -412,6 +417,12 @@ plugin/m2rte$(soext): $(srcdir)/m2/plugin/m2rte.cc $(GCC_HEADER_DEPENDENCIES_FOR
        -test -d $(@D) || $(mkinstalldirs) $(@D)
        $(PLUGINCC) $(PLUGINCFLAGS) -fno-rtti -I. -I$(srcdir) $(INCINTL) -I$(srcdir)/m2 -I$(srcdir)/m2/gm2-gcc -I$(srcdir)/../include -I$(srcdir)/../libcpp/include -Wall $(GMPINC) -Wno-literal-suffix -fPIC -c -o plugin/m2rte.o $(srcdir)/m2/plugin/m2rte.cc
        $(PLUGINCC) $(PLUGINCFLAGS) $(PLUGINLDFLAGS) $(PLUGINLIBS) $(LIBINTL) -fno-rtti plugin/m2rte.o -shared -o $@
+else
+m2.install-plugin:
+
+plugin/m2rte$(exeext).so:
+
+endif
 
 
 # Clean hooks:
@@ -524,7 +535,7 @@ cc1gm2$(exeext): m2/stage1/cc1gm2$(exeext) $(m2.prev)
 
 m2/stage2/cc1gm2$(exeext): m2/stage1/cc1gm2$(exeext) m2/gm2-compiler/m2flex.o \
                             $(GM2_C_OBJS) $(BACKEND) $(LIBDEPS) $(GM2_LIBS) \
-                            m2/gm2-gcc/rtegraph.o plugin/m2rte$(soext)
+                            m2/gm2-gcc/rtegraph.o $(M2RTE_PLUGIN_SO)
        -test -d $(@D) || $(mkinstalldirs) $(@D)
        @$(call LINK_PROGRESS,$(INDEX.m2),start)
        +$(LLINKER) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(GM2_C_OBJS) m2/gm2-compiler/m2flex.o \
@@ -537,7 +548,7 @@ m2/stage2/cc1gm2$(exeext): m2/stage1/cc1gm2$(exeext) m2/gm2-compiler/m2flex.o \
 m2/stage1/cc1gm2$(exeext): gm2$(exeext) m2/gm2-compiler-boot/m2flex.o \
                             $(GM2_C_OBJS) $(BACKEND) $(LIBDEPS) \
                             $(GM2_LIBS_BOOT) $(MC_LIBS) \
-                            m2/gm2-gcc/rtegraph.o plugin/m2rte$(soext) \
+                            m2/gm2-gcc/rtegraph.o $(M2RTE_PLUGIN_SO) \
                             $(m2.prev)
        -test -d $(@D) || $(mkinstalldirs) $(@D)
        @$(call LINK_PROGRESS,$(INDEX.m2),start)
index cd7ae808d98750a025e0882f4065815ae9ab02d2..75a6ed36c82a59190d764e4a2560bd81465ca097 100644 (file)
@@ -469,12 +469,8 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options,
   /* The number of libraries added in.  */
   int added_libraries;
 
-#ifdef ENABLE_PLUGIN
   /* True if we should add -fplugin=m2rte to the command-line.  */
-  bool need_plugin = true;
-#else
   bool need_plugin = false;
-#endif
 
   /* True if we should set up include paths and library paths.  */
   bool allow_libraries = true;
index 836760d6c6667b76a9c706751af631599c79749b..8710e7b4fbf704ac27cdc5768ff582fc3c4a6203 100644 (file)
@@ -44,7 +44,7 @@ set TORTURE_OPTIONS [list \
                         { -O3 -fsoft-check-all } \
                         { -O3 -g -fsoft-check-all } ]
 
-gm2_init_iso "${srcdir}/gm2/iso/check/fail" -fm2-pathname=- -I${srcdir}/gm2/iso/check/fail
+gm2_init_iso "${srcdir}/gm2/iso/check/fail" -fm2-plugin -fm2-pathname=- -I${srcdir}/gm2/iso/check/fail
 
 foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] {
     # If we're only testing specific files and this isn't one of them, skip it.
index 44b44b42fe5ff87330d84e06ee1f54e931e0ff3a..aba9b4077efae6e8b6bbec4f3020d0ffcb502d36 100644 (file)
@@ -36,7 +36,7 @@ if $tracelevel then {
 # load support procs
 load_lib gm2-torture.exp
 
-gm2_init_pim2 "${srcdir}/gm2/switches/auto-init/fail" -fsoft-check-all -O2 -fauto-init -fm2-pathname=- -I${srcdir}/gm2/switches/auto-init/fail
+gm2_init_pim2 "${srcdir}/gm2/switches/auto-init/fail" -fm2-plugin -fsoft-check-all -O2 -fauto-init -fm2-pathname=- -I${srcdir}/gm2/switches/auto-init/fail
 
 foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] {
     # If we're only testing specific files and this isn't one of them, skip it.
index bd2d72373ea16b4b7027aa19a7665679ed1d4335..e9595cf37af28e440014a9727865fd798ff6654d 100644 (file)
@@ -36,7 +36,7 @@ if $tracelevel then {
 # load support procs
 load_lib gm2-torture.exp
 
-gm2_init_pim2 "${srcdir}/gm2/switches/check-all/pim2/fail" -fsoft-check-all -O2 -g -fm2-pathname=- -I${srcdir}/gm2/switches/check-all/pim2/fail
+gm2_init_pim2 "${srcdir}/gm2/switches/check-all/pim2/fail" -fsoft-check-all -fm2-plugin -O2 -g -fm2-pathname=- -I${srcdir}/gm2/switches/check-all/pim2/fail
 
 foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] {
     # If we're only testing specific files and this isn't one of them, skip it.
index b6a90ba3abb48285aba342a4d696bcffcc7ad0ce..a3d40ae620877881262cc1c589529cd4abc038dd 100644 (file)
@@ -45,7 +45,7 @@ set TORTURE_OPTIONS [list \
                         { -O3 -fsoft-check-all } \
                         { -O3 -g -fsoft-check-all } ]
 
-gm2_init_iso "${srcdir}/gm2/switches/check-all/plugin/iso/fail/"
+gm2_init_iso "${srcdir}/gm2/switches/check-all/plugin/iso/fail/" -fm2-plugin
 
 foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] {
     # If we're only testing specific files and this isn't one of them, skip it.
index a934961ddce20d35a74e9811455bff501300c4f8..d6b1a77b17b7fa2973f4189466e815576137cef9 100644 (file)
@@ -45,7 +45,7 @@ set TORTURE_OPTIONS [list \
                         { -O3 -fsoft-check-all } \
                         { -O3 -g -fsoft-check-all } ]
 
-gm2_init_pim2 "${srcdir}/gm2/switches/check-all/plugin/pim2/fail/"
+gm2_init_pim2 "${srcdir}/gm2/switches/check-all/plugin/pim2/fail/" -fm2-plugin
 
 foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] {
     # If we're only testing specific files and this isn't one of them, skip it.
This page took 0.081011 seconds and 5 git commands to generate.