From patchwork Wed Dec 21 12:34:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gaius Mulley X-Patchwork-Id: 35352 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp3498019wrn; Wed, 21 Dec 2022 04:35:44 -0800 (PST) X-Google-Smtp-Source: AMrXdXvQsHvbqC2oh5g9+kXrd5FJKT852e2ZuTWdQyw5rp+yHvTcO5BQiMu5l6uioRzeOQLHGrgh X-Received: by 2002:a05:6402:1298:b0:46c:a43d:5e23 with SMTP id w24-20020a056402129800b0046ca43d5e23mr1405924edv.28.1671626144194; Wed, 21 Dec 2022 04:35:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671626144; cv=none; d=google.com; s=arc-20160816; b=oJmYR8a1zQdd5+uflzq6jvjzafToCXu3fD/tOiWyBRrtriYrSBc+F6z3B12VM1Vr4k HcGUaXgr4dGdmnEG6Y9JXfF9V2WU2wkv8AEY/BA671bpMv3NXK/AHx82GYc/FnsanjI+ BksgYe/bnkZgYgX9Uk+GR4H3bNMcx2SFCcGmdNMKB52QwYMTT9o/5h6ZkPx4/7m4gKx5 O/6Gc3yxIOvo9I9PptcCW5b4qzGTakh/WmNxgUu4zqthYBXnrdXy0G+6FdSLEAi1H4uD 2yBBuv+2tjKDkjg9dtuB8cbaAmJXv8e7E5gySgKEyufOuvaozsYI5nfiNBSMGFg8+vro ZmLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:mime-version :user-agent:message-id:date:subject:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=PzwaId2CWU3wU27SOMijpWeA6oA8k2j4hlcEoZMPPaY=; b=ihUkTaMBzd0lZpdDu+DUBSScM8RHqjjQZki0CsIBizNAnQ63YQU9FC1XHQ3TCEiyXI EMO03mfjTBgjkyA0HAOT8nLKpJdqw/+FAEpIKB3l9SNzbqVragXRSX/zX1F7KxTLGDdY prR8E8zs6xvve/jtTzh++RtuEV6tIoMXs4UGDUyhiak0m0PjS2roeIkWHBnI/DdJNKkF h4Wh4roMlMaj7d/vWowgdIQfJjK3/sS5M++s7RtRQTzOsFe9gcgdMZcG4NIQi2fjF40n aIL7jxzb1KQVeD2IxFdk9NZom7fcuDvBAGyfmhJqToFPm1UDIZuGWMYTgxKFYeA8JFri NqBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=JrPtLAM8; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id h7-20020aa7c607000000b004615937b174si12573544edq.480.2022.12.21.04.35.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Dec 2022 04:35:44 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=JrPtLAM8; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2A62D385703F for ; Wed, 21 Dec 2022 12:35:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2A62D385703F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1671626143; bh=PzwaId2CWU3wU27SOMijpWeA6oA8k2j4hlcEoZMPPaY=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=JrPtLAM8rfUnqRHLIxnPydZ/N3eaNhbLoCHt7HDxQ6vg9E0gjkjryaoOm9vp4qDCY 33ZOdrh5FtK/SbcnMrDa4p7mZrsNSOcBkMycxyw20FGL5p2GXSDZmVil64soXMenHp 6/oPQnXNwrZqHyjGHO1lnWLTExuGSyn3ZcrLw+VI= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by sourceware.org (Postfix) with ESMTPS id 990823858D1E for ; Wed, 21 Dec 2022 12:34:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 990823858D1E Received: by mail-wr1-x433.google.com with SMTP id i7so14754650wrv.8 for ; Wed, 21 Dec 2022 04:34:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:date:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=PzwaId2CWU3wU27SOMijpWeA6oA8k2j4hlcEoZMPPaY=; b=UQ5eLL8/1umlIw0nnlpo5XuIuWWuzntL5Z1HfqCaDZvlGS8vvuSohgTaWrjdd9qCQB EnT3gwwtqvtsMIreN2+L+yq5M+PeDpq2LVROk+y/2+DZuPZF7AZlCiuTQYLtShgfFgUG kLLOTKR2CUiyX0FuwUDzzFqHLa1vOsWhxcdFjzw3Cv8Q/pXf6bZq0xtdT9uDz9v7xWNV sRuA7voo/IH0/xXaCdsj1YRvKCDa8MG7XwA8zsoqAXnm6YKaCPTHDRQXGX9AA9m9KCRU ynjn7D+9qExSTZOas/o0jpcM32ZTeBWW/t5SIxcZdx4wS8gSJsHNWVh8Gm6jivBR/EO7 3HIQ== X-Gm-Message-State: AFqh2kqMpz87uDnAKrHSEuCwqYXYKsRcnDR87NGBhG3geEbZiS8XDwY2 PuGYvP9ng+hntt2pvsHkIRIP1xQ2r8E= X-Received: by 2002:adf:f052:0:b0:246:e6df:86ea with SMTP id t18-20020adff052000000b00246e6df86eamr996724wro.25.1671626095075; Wed, 21 Dec 2022 04:34:55 -0800 (PST) Received: from lancelot ([195.147.220.46]) by smtp.gmail.com with ESMTPSA id w12-20020a05600018cc00b002423edd7e50sm14928724wrq.32.2022.12.21.04.34.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Dec 2022 04:34:54 -0800 (PST) Received: from gaius by lancelot with local (Exim 4.94.2) (envelope-from ) id 1p7yJA-00Dmqe-0Q; Wed, 21 Dec 2022 12:34:52 +0000 To: gcc-patches@gcc.gnu.org Subject: [PATCH] modula2: PR-108119 Disable m2 plugin m2rte Date: Wed, 21 Dec 2022 12:34:51 +0000 Message-ID: <877cyl0wb8.fsf@debian> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Gaius Mulley via Gcc-patches From: Gaius Mulley Reply-To: Gaius Mulley Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752827055509488653?= X-GMAIL-MSGID: =?utf-8?q?1752827055509488653?= Hello, PR-108119 Disable m2 plugin m2rte (provide --enable-m2plugin configure option). The m2 plugin m2rte attempts to find reachable calls to the m2 exception handler, but it identifies the m2 exception calls by procedure name. As this won't work with other languages it should be disabled by default. This patch disables the plugin from being built. It provides a new configure switch --enable-m2plugin to override the default and it will check the HAVE_PLUGIN of the host and warn if there is a conflict. Tested on x86_64 GNU/Linux bootstrapped for all languages no extra failures (m2 tests missing as the plugin is disabled and TCL expect now disables m2 plugin tests) ok for trunk? regards, Gaius ChangeLog: * Makefile.def (extra_configure_flags): Add @enable_m2plugin@. * Makefile.in : Rebuilt. * configure : Rebuilt. * configure.ac (host_tools): Remove unused gm2tools. (m2plugin) New AC_ARG_ENABLE. (enable_m2plugin) New AC_SUBST added. gcc/ChangeLog: * Makefile.in (enable_m2plugin): Added. (site.exp): New variable ENABLE_M2PLUGIN. * config.in: Rebuilt. * configure : Rebuilt. * gcc/configure.ac (m2plugin): New AC_ARG_ENABLE. (enable_m2plugin) New AC_SUBST added. * doc/install.texi (--enable-m2plugin): Documented. gcc/m2/ChangeLog: * gm2spec.cc (ENABLE_PLUGIN): Replaced by ENABLE_M2PLUGIN. Ensure that OPT_fplugin option is only created if ENABLE_M2PLUGIN is defined. (lang_specific_driver) Change warning to mention --enable-m2plugin. * Make-lang.in (enable_m2plugin): Set to no if enable_plugin is no. (M2RTE_PLUGIN_SO) New definition. (m2.all.cross) Use M2RTE_PLUGIN_SO. (m2.start.encap) Use M2RTE_PLUGIN_SO. (m2.install-plugin) Use M2RTE_PLUGIN_SO. (m2.install-plugin) Add dummy rule when enable_m2plugin is no. (plugin/m2rte$(exeext).so) Add dummy rule when enable_m2plugin is no. (stage1/m2/cc1gm2$(exeext) Use M2RTE_PLUGIN_SO. (stage2/m2/cc1gm2$(exeext) Use M2RTE_PLUGIN_SO. gcc/testsuite/ChangeLog: * gm2/coroutines/pim/run/pass/coroutines-pim-run-pass.exp (ENABLE_M2PLUGIN): Checked to see whether the test should be ignored. * gm2/iso/check/fail/iso-check-fail.exp (ENABLE_M2PLUGIN): Ditto. * gm2/switches/auto-init/fail/switches-auto-init-fail.exp (ENABLE_M2PLUGIN): Ditto. * gm2/switches/check-all/pim2/fail/switches-check-all-pim2-fail.exp (ENABLE_M2PLUGIN): Ditto. * gm2/switches/check-all/plugin/iso/fail/switches-check-all-plugin-iso-fail.exp (ENABLE_M2PLUGIN): Ditto. * gm2/switches/check-all/plugin/pim2/fail/switches-check-all-plugin-pim2-fail.exp (ENABLE_M2PLUGIN): Ditto. diff --git a/Makefile.def b/Makefile.def index 5f44190154e..d33e4528b63 100644 --- a/Makefile.def +++ b/Makefile.def @@ -103,7 +103,7 @@ host_modules= { module= libiberty; bootstrap=true; // @extra_linker_plugin_flags@ and @extra_linker_plugin_configure_flags@. host_modules= { module= libiberty-linker-plugin; bootstrap=true; module_srcdir=libiberty; - extra_configure_flags='@extra_host_libiberty_configure_flags@ --disable-install-libiberty @extra_linker_plugin_flags@ @extra_linker_plugin_configure_flags@'; + extra_configure_flags='@extra_host_libiberty_configure_flags@ --disable-install-libiberty @extra_linker_plugin_flags@ @extra_linker_plugin_configure_flags@ @enable_m2plugin@'; extra_make_flags='@extra_linker_plugin_flags@'; }; // We abuse missing to avoid installing anything for libiconv. host_modules= { module= libiconv; diff --git a/configure.ac b/configure.ac index c5191ce24ae..b771f61ef33 100644 --- a/configure.ac +++ b/configure.ac @@ -140,7 +140,7 @@ host_libs="intl libiberty opcodes bfd readline tcl tk itcl libgui zlib libbacktr # binutils, gas and ld appear in that order because it makes sense to run # "make check" in that particular order. # If --enable-gold is used, "gold" may replace "ld". -host_tools="texinfo flex bison binutils gas ld fixincludes gcc cgen sid sim gdb gdbserver gprof etc expect dejagnu m4 utils guile fastjar gnattools libcc1 gm2tools gotools c++tools" +host_tools="texinfo flex bison binutils gas ld fixincludes gcc cgen sid sim gdb gdbserver gprof etc expect dejagnu m4 utils guile fastjar gnattools libcc1 gotools c++tools" # these libraries are built for the target environment, and are built after # the host libraries and the host tools (which may be a cross compiler) @@ -465,13 +465,22 @@ if test "${ENABLE_LIBADA}" != "yes" ; then noconfigdirs="$noconfigdirs gnattools" fi + AC_ARG_ENABLE(libgm2, [AS_HELP_STRING([--enable-libgm2], [build libgm2 directory])], ENABLE_LIBGM2=$enableval, ENABLE_LIBGM2=no) -if test "${ENABLE_LIBGM2}" != "yes" ; then - noconfigdirs="$noconfigdirs gm2tools" + + +AC_ARG_ENABLE(m2plugin, +[AS_HELP_STRING([--enable-m2plugin], [enable m2rte plugin])], +enable_m2plugin=$enableval, +enable_m2plugin=yes) +if test "${enable_m2plugin}" != "yes" ; then + enable_m2plugin=no fi +AC_SUBST(enable_m2plugin) + AC_ARG_ENABLE(libssp, [AS_HELP_STRING([--enable-libssp], [build libssp directory])], diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 995d77f96c4..46bdcb730aa 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -404,6 +404,8 @@ PLUGINCFLAGS = @CXXFLAGS@ PLUGINLIBS = @pluginlibs@ enable_plugin = @enable_plugin@ +# Should we build the m2plugin? +enable_m2plugin = @enable_m2plugin@ # On MinGW plugin installation involves installing import libraries. ifeq ($(enable_plugin),yes) @@ -4101,6 +4103,9 @@ site.exp: ./config.status Makefile echo "set PLUGINCFLAGS \"$(PLUGINCFLAGS)\"" >> ./site.tmp; \ echo "set GMPINC \"$(GMPINC)\"" >> ./site.tmp; \ fi + @if test "@enable_m2plugin@" = "yes" ; then \ + echo "set ENABLE_M2PLUGIN 1" >> ./site.tmp; \ + fi # If newlib has been configured, we need to pass -B to gcc so it can find # newlib's crt0.o if it exists. This will cause a "path prefix not used" # message if it doesn't, but the testsuite is supposed to ignore the message - diff --git a/gcc/configure.ac b/gcc/configure.ac index 5efbf11793c..61052d4a2bc 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -1011,6 +1011,7 @@ analyzer=1) AC_DEFINE_UNQUOTED(ENABLE_ANALYZER, $analyzer, [Define 0/1 if static analyzer feature is enabled.]) + AC_ARG_ENABLE(objc-gc, [AS_HELP_STRING([--enable-objc-gc], [enable the use of Boehm's garbage collector with @@ -7375,6 +7376,26 @@ if test x"$enable_plugin" = x"yes"; then fi +AC_ARG_ENABLE(m2plugin, +[AS_HELP_STRING([--enable-m2plugin], + [enable the modula-2 static analysis plugin])], +if test x$enable_m2plugin = xno; then + m2plugin=0 +else + if test x"$enable_plugin" = x"yes"; then + m2plugin=1 + else + m2plugin=0 + AC_MSG_WARN([modula-2 plugin is disabled as the host has disabled plugins]) + fi +fi, +m2plugin=0) +if test x"$enable_m2plugin" = x"yes"; then + AC_DEFINE(ENABLE_M2PLUGIN, 1, [Define to enable m2plugin support.]) +fi +AC_SUBST(enable_m2plugin) + + # Enable --enable-host-shared AC_ARG_ENABLE(host-shared, [AS_HELP_STRING([--enable-host-shared], diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi index 6884a74936b..b1966369ff2 100644 --- a/gcc/doc/install.texi +++ b/gcc/doc/install.texi @@ -1926,6 +1926,9 @@ do a @samp{make -C gcc gnatlib_and_tools}. Specify that the run-time libraries and tools used by Modula-2 should not be built. This can be useful for debugging. +@item --enable-m2plugin +Specify that the modula-2 static analysis plugin should be built. + @item --disable-libsanitizer Specify that the run-time libraries for the various sanitizers should not be built. diff --git a/gcc/m2/Make-lang.in b/gcc/m2/Make-lang.in index a8bd7fe4d19..3d9c84f7607 100644 --- a/gcc/m2/Make-lang.in +++ b/gcc/m2/Make-lang.in @@ -82,6 +82,18 @@ PGE=m2/pge$(exeext) SRC_PREFIX=G +ifeq ($(enable_plugin),no) +# Override enable_m2plugin if host does not support plugins. +ifeq ($(enable_m2plugin),yes) +$(warning modula-2 plugin will be disabled as the host does not support plugins) +endif +enable_m2plugin=no +endif + +ifeq ($(enable_m2plugin),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 @@ -114,9 +126,9 @@ po-generated: # Build hooks: -m2.all.cross: gm2-cross$(exeext) plugin/m2rte$(exeext).so +m2.all.cross: gm2-cross$(exeext) $(M2RTE_PLUGIN_SO) -m2.start.encap: gm2$(exeext) plugin/m2rte$(exeext).so +m2.start.encap: gm2$(exeext) $(M2RTE_PLUGIN_SO) m2.rest.encap: @@ -401,16 +413,22 @@ m2.uninstall: -rm -rf $(bindir)/$(GM2_INSTALL_NAME) -rm -rf $(bindir)/$(GM2_CROSS_NAME) + +ifeq ($(enable_m2plugin),yes) m2.install-plugin: installdirs $(mkinstalldirs) $(DESTDIR)$(plugin_resourcesdir) - $(INSTALL_PROGRAM) plugin/m2rte$(exeext).so $(DESTDIR)$(plugin_resourcesdir)/m2rte$(exeext).so + $(INSTALL_PROGRAM) $(M2RTE_PLUGIN_SO) $(DESTDIR)$(plugin_resourcesdir)/m2rte$(exeext).so chmod a+x $(DESTDIR)$(plugin_resourcesdir)/m2rte$(exeext).so plugin/m2rte$(exeext).so: $(srcdir)/m2/plugin/m2rte.cc $(GCC_HEADER_DEPENDENCIES_FOR_M2) \ insn-attr-common.h insn-flags.h $(generated_files) test -d plugin || mkdir plugin - $(PLUGINCC) $(PLUGINCFLAGS) -fno-rtti -I. -I$(srcdir) -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) -fno-rtti -I. -I$(srcdir) -I$(srcdir)/m2 -I$(srcdir)/m2/gm2-gcc -I$(srcdir)/../include -I$(srcdir)/../libcpp/include -I$(objdir)/../intl -Wall $(GMPINC) -Wno-literal-suffix -fPIC -c -o plugin/m2rte.o $(srcdir)/m2/plugin/m2rte.cc $(PLUGINCC) $(PLUGINCFLAGS) $(PLUGINLIBS) -fno-rtti plugin/m2rte.o -shared -o $@ +else +m2.install-plugin: +plugin/m2rte$(exeext).so: +endif # Clean hooks: @@ -526,7 +544,7 @@ cc1gm2$(exeext): stage1/m2/cc1gm2$(exeext) $(m2.prev) stage2/m2/cc1gm2$(exeext): stage1/m2/cc1gm2$(exeext) m2/gm2-compiler/m2flex.o $(P) \ $(GM2_C_OBJS) $(BACKEND) $(LIBDEPS) $(GM2_LIBS) \ - m2/gm2-gcc/rtegraph.o plugin/m2rte$(exeext).so m2/gm2-libs-boot/M2LINK.o + m2/gm2-gcc/rtegraph.o $(M2RTE_PLUGIN_SO) m2/gm2-libs-boot/M2LINK.o @$(call LINK_PROGRESS,$(INDEX.m2),start) +$(LLINKER) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(GM2_C_OBJS) m2/gm2-compiler/m2flex.o \ attribs.o \ @@ -538,7 +556,7 @@ stage2/m2/cc1gm2$(exeext): stage1/m2/cc1gm2$(exeext) m2/gm2-compiler/m2flex.o $( stage1/m2/cc1gm2$(exeext): gm2$(exeext) m2/gm2-compiler-boot/m2flex.o \ $(P) $(GM2_C_OBJS) $(BACKEND) $(LIBDEPS) \ $(GM2_LIBS_BOOT) $(MC_LIBS) \ - m2/gm2-gcc/rtegraph.o plugin/m2rte$(exeext).so \ + m2/gm2-gcc/rtegraph.o $(M2RTE_PLUGIN_SO) \ m2/gm2-libs-boot/M2LINK.o \ $(m2.prev) @$(call LINK_PROGRESS,$(INDEX.m2),start) diff --git a/gcc/m2/gm2spec.cc b/gcc/m2/gm2spec.cc index 680dd3602ef..49ad14038d2 100644 --- a/gcc/m2/gm2spec.cc +++ b/gcc/m2/gm2spec.cc @@ -610,7 +610,7 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options, /* The number of libraries added in. */ int added_libraries; -#ifdef ENABLE_PLUGIN +#ifdef ENABLE_M2PLUGIN /* True if we should add -fplugin=m2rte to the command-line. */ bool need_plugin = true; #else @@ -678,10 +678,10 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options, break; case OPT_fm2_plugin: need_plugin = decoded_options[i].value; -#ifndef ENABLE_PLUGIN +#ifndef ENABLE_M2PLUGIN if (need_plugin) error ("plugin support is disabled; configure with " - "%<--enable-plugin%>"); + "%<--enable-m2plugin%>"); #endif break; case OPT_fscaffold_dynamic: @@ -802,7 +802,6 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options, "-fgen-module-list=", "-fuse-list="); } - /* There's no point adding -shared-libgcc if we don't have a shared libgcc. */ #ifndef ENABLE_SHARED_LIBGCC @@ -848,7 +847,8 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options, if (allow_libraries) { /* If the libraries have not been specified by the user but the - dialect has been specified then select the appropriate libraries. */ + dialect has been specified then select the appropriate + libraries. */ if (libraries == NULL) { if (strcmp (dialect, "iso") == 0) @@ -865,8 +865,10 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options, if ((! seen_x_flag) && seen_module_extension) append_option (OPT_x, "modula-2", 1); +#ifdef ENABLE_M2PLUGIN if (need_plugin) append_option (OPT_fplugin_, "m2rte", 1); +#endif if (linking) { diff --git a/gcc/testsuite/gm2/iso/check/fail/iso-check-fail.exp b/gcc/testsuite/gm2/iso/check/fail/iso-check-fail.exp index a519f839f90..4aa02ef61fb 100644 --- a/gcc/testsuite/gm2/iso/check/fail/iso-check-fail.exp +++ b/gcc/testsuite/gm2/iso/check/fail/iso-check-fail.exp @@ -21,10 +21,13 @@ load_lib target-supports.exp global TESTING_IN_BUILD_TREE global ENABLE_PLUGIN +global ENABLE_M2PLUGIN # The plugin testcases currently only work when the build tree is available. # Also check whether the host supports plugins. -if { ![info exists TESTING_IN_BUILD_TREE] || ![info exists ENABLE_PLUGIN] } { +if { ![info exists TESTING_IN_BUILD_TREE] + || ![info exists ENABLE_PLUGIN] + || ![info exists ENABLE_M2PLUGIN] } { return } diff --git a/gcc/testsuite/gm2/switches/auto-init/fail/switches-auto-init-fail.exp b/gcc/testsuite/gm2/switches/auto-init/fail/switches-auto-init-fail.exp index c60027ff751..1b5488bc4da 100644 --- a/gcc/testsuite/gm2/switches/auto-init/fail/switches-auto-init-fail.exp +++ b/gcc/testsuite/gm2/switches/auto-init/fail/switches-auto-init-fail.exp @@ -22,10 +22,13 @@ load_lib target-supports.exp global TESTING_IN_BUILD_TREE global ENABLE_PLUGIN +global ENABLE_M2PLUGIN # The plugin testcases currently only work when the build tree is available. # Also check whether the host supports plugins. -if { ![info exists TESTING_IN_BUILD_TREE] || ![info exists ENABLE_PLUGIN] } { +if { ![info exists TESTING_IN_BUILD_TREE] + || ![info exists ENABLE_PLUGIN] + || ![info exists ENABLE_M2PLUGIN] } { return } diff --git a/gcc/testsuite/gm2/switches/check-all/pim2/fail/switches-check-all-pim2-fail.exp b/gcc/testsuite/gm2/switches/check-all/pim2/fail/switches-check-all-pim2-fail.exp index 3c654ad0b73..791ebe294b2 100644 --- a/gcc/testsuite/gm2/switches/check-all/pim2/fail/switches-check-all-pim2-fail.exp +++ b/gcc/testsuite/gm2/switches/check-all/pim2/fail/switches-check-all-pim2-fail.exp @@ -22,10 +22,13 @@ load_lib target-supports.exp global TESTING_IN_BUILD_TREE global ENABLE_PLUGIN +global ENABLE_M2PLUGIN # The plugin testcases currently only work when the build tree is available. # Also check whether the host supports plugins. -if { ![info exists TESTING_IN_BUILD_TREE] || ![info exists ENABLE_PLUGIN] } { +if { ![info exists TESTING_IN_BUILD_TREE] + || ![info exists ENABLE_PLUGIN] + || ![info exists ENABLE_M2PLUGIN] } { return } diff --git a/gcc/testsuite/gm2/switches/check-all/plugin/iso/fail/switches-check-all-plugin-iso-fail.exp b/gcc/testsuite/gm2/switches/check-all/plugin/iso/fail/switches-check-all-plugin-iso-fail.exp index 84a3f37e2bb..2c6b56fcca0 100644 --- a/gcc/testsuite/gm2/switches/check-all/plugin/iso/fail/switches-check-all-plugin-iso-fail.exp +++ b/gcc/testsuite/gm2/switches/check-all/plugin/iso/fail/switches-check-all-plugin-iso-fail.exp @@ -22,10 +22,13 @@ load_lib target-supports.exp global TESTING_IN_BUILD_TREE global ENABLE_PLUGIN +global ENABLE_M2PLUGIN # The plugin testcases currently only work when the build tree is available. # Also check whether the host supports plugins. -if { ![info exists TESTING_IN_BUILD_TREE] || ![info exists ENABLE_PLUGIN] } { +if { ![info exists TESTING_IN_BUILD_TREE] + || ![info exists ENABLE_PLUGIN] + || ![info exists ENABLE_M2PLUGIN] } { return } diff --git a/gcc/testsuite/gm2/switches/check-all/plugin/pim2/fail/switches-check-all-plugin-pim2-fail.exp b/gcc/testsuite/gm2/switches/check-all/plugin/pim2/fail/switches-check-all-plugin-pim2-fail.exp index 238e5c8af90..24644ce9044 100644 --- a/gcc/testsuite/gm2/switches/check-all/plugin/pim2/fail/switches-check-all-plugin-pim2-fail.exp +++ b/gcc/testsuite/gm2/switches/check-all/plugin/pim2/fail/switches-check-all-plugin-pim2-fail.exp @@ -22,10 +22,13 @@ load_lib target-supports.exp global TESTING_IN_BUILD_TREE global ENABLE_PLUGIN +global ENABLE_M2PLUGIN # The plugin testcases currently only work when the build tree is available. # Also check whether the host supports plugins. -if { ![info exists TESTING_IN_BUILD_TREE] || ![info exists ENABLE_PLUGIN] } { +if { ![info exists TESTING_IN_BUILD_TREE] + || ![info exists ENABLE_PLUGIN] + || ![info exists ENABLE_M2PLUGIN] } { return }