From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 53434 invoked by alias); 29 Jan 2020 14:07:42 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 53425 invoked by uid 89); 29 Jan 2020 14:07:41 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-29.3 required=5.0 tests=AWL,BAYES_00,ENV_AND_HDR_SPF_MATCH,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS,USER_IN_DEF_SPF_WL autolearn=ham version=3.3.1 spammy=sid, sim, TARGET, HX-Spam-Relays-External:209.85.210.67 X-HELO: mail-ot1-f67.google.com Received: from mail-ot1-f67.google.com (HELO mail-ot1-f67.google.com) (209.85.210.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 29 Jan 2020 14:07:39 +0000 Received: by mail-ot1-f67.google.com with SMTP id r16so15631174otd.2 for ; Wed, 29 Jan 2020 06:07:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=9iSW92Nhf+WzDK6xpL6Ohs3cXBFlE/KzztDCR9mdhKQ=; b=Fjjk93VL8+oxb5he7DvKVKRXOFn+WwyZXA5o+v+FEuziqgC1gGm7Lz6Bn69u9SQ4vY ZZmLJ9bmVE0PvttpjlV2vy6h2Zjz+Ht5xIx7CGppz5qGwN4lrN1wEAdLr89CEXheIF9q HOS6RJhuGUyoq2g5WQk/uvbESL3/oUcShW6ZAhhO6u0Z3UIdqK5wnFOHnDHozMAqscEC l8bHwkJHIqDKCLGLHfhfyt66bu0AGEjd82Ef6vLvv08WEk84BrrGUyeIeSA53T9Iahmd GwctyxjdbJdhPyoItCFzEMXmScBUybdBbCS8yMsH1oEbBHWwuU+yLKhed6bSiDfbV1nA kX2Q== MIME-Version: 1.0 References: <20191122233003.211567-1-cbiesinger@google.com> In-Reply-To: <20191122233003.211567-1-cbiesinger@google.com> From: "Christian Biesinger via gdb-patches" Reply-To: Christian Biesinger Date: Wed, 29 Jan 2020 14:07:00 -0000 Message-ID: Subject: Re: [PATCH] Don't override various Makefile variables for gnulib et al To: gdb-patches Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2020-01/txt/msg00929.txt.bz2 Ping On Sat, Nov 23, 2019 at 12:30 AM Christian Biesinger wrote: > > Normally the toplevel Makefile will pass various CC=foo and other > flags down to subdir Makefiles. However, for Gnulib this is a problem > because Gnulib's configure specifically sets CC to something that > includes a -std=gnu11 flag on some systems, and this override would > set it back to CC=gcc, leading to compile errors in a GDB build > with an updated Gnulib. > > I don't believe this is needed outside of GCC, so this patch changes > Gnulib and other non-GCC modules to just not override any flags -- > the values set during configure time should be fine. If a user > overrides them manually when invoking make, those will still work. > > Under the same condition, I also removed the host_exports. I don't > understand why this is ever necessary (this is only after configure > has run). > > The other option is to clear MAKEOVERRIDES in gnulib/Makefile.am, but > that means the user can't override any variables for this subdirectory. > > ChangeLog: > > 2019-11-22 Christian Biesinger > > * Makefile.def: Pass no_exports_and_flags to various non-GCC > modules. > * Makefile.in: Allow passing a no_exports_and_flags argument to > "all" to suppress emitting exports and make flags. Useful when > invoked via host_modules from Makefile.def. > * Makefile.tpl: Regenerate. > > Change-Id: I7d80328cf81c133ba6157eec7d10c422b6790723 > --- > Makefile.def | 12 ++++++------ > Makefile.in | 30 ++++++++++++------------------ > Makefile.tpl | 9 ++++++--- > 3 files changed, 24 insertions(+), 27 deletions(-) > > diff --git a/Makefile.def b/Makefile.def > index 311feb9de3..e1ff065202 100644 > --- a/Makefile.def > +++ b/Makefile.def > @@ -33,7 +33,7 @@ build_modules= { module= fixincludes; }; > build_modules= { module= libcpp; > extra_configure_flags='--disable-nls am_cv_func_iconv=no';}; > > -host_modules= { module= bfd; bootstrap=true; }; > +host_modules= { module= bfd; bootstrap=true; no_exports_and_flags=true; }; > host_modules= { module= opcodes; bootstrap=true; }; > host_modules= { module= binutils; bootstrap=true; }; > host_modules= { module= bison; no_check_cross= true; }; > @@ -105,15 +105,15 @@ host_modules= { module= libiconv; > missing= install-html; > missing= install-info; }; > host_modules= { module= m4; }; > -host_modules= { module= readline; }; > +host_modules= { module= readline; no_exports_and_flags=true; }; > host_modules= { module= sid; }; > -host_modules= { module= sim; }; > +host_modules= { module= sim; no_exports_and_flags=true; }; > host_modules= { module= texinfo; no_install= true; }; > host_modules= { module= zlib; no_install=true; no_check=true; > bootstrap=true; > extra_configure_flags='@extra_host_zlib_configure_flags@';}; > -host_modules= { module= gnulib; }; > -host_modules= { module= gdb; }; > +host_modules= { module= gnulib; no_exports_and_flags=true; }; > +host_modules= { module= gdb; no_exports_and_flags=true; }; > host_modules= { module= expect; }; > host_modules= { module= guile; }; > host_modules= { module= tk; }; > @@ -129,7 +129,7 @@ host_modules= { module= lto-plugin; bootstrap=true; > extra_make_flags='@extra_linker_plugin_flags@'; }; > host_modules= { module= libcc1; extra_configure_flags=--enable-shared; }; > host_modules= { module= gotools; }; > -host_modules= { module= libctf; no_check=true; > +host_modules= { module= libctf; no_check=true; no_exports_and_flags=true; > bootstrap=true; }; > > target_modules = { module= libstdc++-v3; > diff --git a/Makefile.in b/Makefile.in > index 1aabf6ede4..bd41753543 100644 > --- a/Makefile.in > +++ b/Makefile.in > @@ -3414,10 +3414,9 @@ maybe-all-bfd: all-bfd > all-bfd: configure-bfd > @r=`${PWD_COMMAND}`; export r; \ > s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ > - $(HOST_EXPORTS) \ > + \ > (cd $(HOST_SUBDIR)/bfd && \ > - $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(STAGE1_FLAGS_TO_PASS) \ > - $(TARGET-bfd)) > + $(MAKE) $(TARGET-bfd)) > @endif bfd > > > @@ -25530,10 +25529,9 @@ all-readline: configure-readline > @: $(MAKE); $(unstage) > @r=`${PWD_COMMAND}`; export r; \ > s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ > - $(HOST_EXPORTS) \ > + \ > (cd $(HOST_SUBDIR)/readline && \ > - $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(STAGE1_FLAGS_TO_PASS) \ > - $(TARGET-readline)) > + $(MAKE) $(TARGET-readline)) > @endif readline > > > @@ -26412,10 +26410,9 @@ all-sim: configure-sim > @: $(MAKE); $(unstage) > @r=`${PWD_COMMAND}`; export r; \ > s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ > - $(HOST_EXPORTS) \ > + \ > (cd $(HOST_SUBDIR)/sim && \ > - $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(STAGE1_FLAGS_TO_PASS) \ > - $(TARGET-sim)) > + $(MAKE) $(TARGET-sim)) > @endif sim > > > @@ -28150,10 +28147,9 @@ all-gnulib: configure-gnulib > @: $(MAKE); $(unstage) > @r=`${PWD_COMMAND}`; export r; \ > s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ > - $(HOST_EXPORTS) \ > + \ > (cd $(HOST_SUBDIR)/gnulib && \ > - $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(STAGE1_FLAGS_TO_PASS) \ > - $(TARGET-gnulib)) > + $(MAKE) $(TARGET-gnulib)) > @endif gnulib > > > @@ -28591,10 +28587,9 @@ all-gdb: configure-gdb > @: $(MAKE); $(unstage) > @r=`${PWD_COMMAND}`; export r; \ > s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ > - $(HOST_EXPORTS) \ > + \ > (cd $(HOST_SUBDIR)/gdb && \ > - $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(STAGE1_FLAGS_TO_PASS) \ > - $(TARGET-gdb)) > + $(MAKE) $(TARGET-gdb)) > @endif gdb > > > @@ -33571,10 +33566,9 @@ maybe-all-libctf: all-libctf > all-libctf: configure-libctf > @r=`${PWD_COMMAND}`; export r; \ > s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ > - $(HOST_EXPORTS) \ > + \ > (cd $(HOST_SUBDIR)/libctf && \ > - $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(STAGE1_FLAGS_TO_PASS) \ > - $(TARGET-libctf)) > + $(MAKE) $(TARGET-libctf)) > @endif libctf > > > diff --git a/Makefile.tpl b/Makefile.tpl > index 5b118a8ba4..876ecf8dbd 100644 > --- a/Makefile.tpl > +++ b/Makefile.tpl > @@ -1126,10 +1126,13 @@ all-[+prefix+][+module+]: configure-[+prefix+][+module+][+ IF bootstrap +][+ ELS > @: $(MAKE); $(unstage)[+ ENDIF bootstrap +] > @r=`${PWD_COMMAND}`; export r; \ > s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ > - [+exports+] [+extra_exports+] \ > + [+ IF no_exports_and_flags +][+ ELSE > + +][+exports+] [+extra_exports+][+ > + ENDIF no_exports_and_flags +] \ > (cd [+subdir+]/[+module+] && \ > - $(MAKE) $(BASE_FLAGS_TO_PASS) [+args+] [+stage1_args+] [+extra_make_flags+] \ > - $(TARGET-[+prefix+][+module+])) > + $(MAKE) [+ IF no_exports_and_flags +][+ ELSE > + +]$(BASE_FLAGS_TO_PASS) [+args+] [+stage1_args+] [+extra_make_flags+] \ > + [+ ENDIF no_exports_and_flags +]$(TARGET-[+prefix+][+module+])) > @endif [+prefix+][+module+] > > [+ IF bootstrap +] > > base-commit: 987012b89bce7f6385ed88585547f852a8005a3f > -- > 2.24.0.432.g9d3f5f5b63-goog >