From patchwork Fri Nov 22 23:30:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Terekhov, Mikhail via Gdb-patches" X-Patchwork-Id: 36141 Received: (qmail 85416 invoked by alias); 22 Nov 2019 23:30:43 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 85142 invoked by uid 89); 22 Nov 2019 23:30:21 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mail-qv1-f73.google.com Received: from mail-qv1-f73.google.com (HELO mail-qv1-f73.google.com) (209.85.219.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 22 Nov 2019 23:30:11 +0000 Received: by mail-qv1-f73.google.com with SMTP id 41so5784805qvw.5 for ; Fri, 22 Nov 2019 15:30:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=msBlGPqJV7Bwwr0PwJAxot5y2Fwbtl6w1tBatnM8PKk=; b=tD4BKNaW6AHityQqozFOdYIk/zSgDQ+TgPpwrtdDO7rXGDaz9k3fKlZis/13QXjr0x GoJoiCIqsGLyeIV1xT7RUFeQH+v56nZQfNVfJKNCn+QMoiVM2DAJkLXGGp9wMWIJFBLc 4Gqg4Fregzm/L0TOL3D7SzYrG9dzLTdMpMx2Q9dpWEYtsWqf4M/Cag1OlmCRj80FTQvS dx9oehjZ8m89thKheoLAmu6Jtmklc9bbCbO6ixNHYB/SrwpnviiNbNqhalvIADFElNTA R2ir0KvQQ5lAIgNWwysm0ePdtOqxK35Zpw18bzljW7m1ctgYG6rnRPTdYze88mH7peTH P0tA== Date: Fri, 22 Nov 2019 17:30:03 -0600 Message-Id: <20191122233003.211567-1-cbiesinger@google.com> Mime-Version: 1.0 Subject: [PATCH] Don't override various Makefile variables for gnulib et al X-Patchwork-Original-From: "Christian Biesinger via gdb-patches" From: "Terekhov, Mikhail via Gdb-patches" Reply-To: Christian Biesinger To: gdb-patches@sourceware.org, gcc-patches@gcc.gnu.org Cc: Christian Biesinger X-IsSubscribed: yes 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(-) base-commit: 987012b89bce7f6385ed88585547f852a8005a3f 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 +]