From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-sender-0.a4lg.com (mail-sender.a4lg.com [153.120.152.154]) by sourceware.org (Postfix) with ESMTPS id B19B13858404 for ; Thu, 15 Sep 2022 05:59:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B19B13858404 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=irq.a4lg.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=irq.a4lg.com Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id 80778300089; Thu, 15 Sep 2022 05:59:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irq.a4lg.com; s=2017s01; t=1663221566; bh=a13NZmeEbSpNblt31rWPpIuKWs1jRrv/jr1pfaXKqqQ=; h=From:To:Cc:Subject:Date:Message-Id:Mime-Version: Content-Transfer-Encoding; b=aNjKQkI1+Ng1BNKIKfSJp/0EGY0edFzJKsi/f7jLY3kB4b+juQ8xpLKFPErxX4VK7 eZoBAt8WiRCKwjMhV85fHObgupYGdEFaLVsvF0u9Jm+IMaWKL26p90nzbqhBFZbpXG jUWI1XeHH18FE1KKOENj8IxQs+S705rUoryjyTlY= From: Tsukasa OI To: Tsukasa OI , Nick Clifton , Jim Wilson Cc: binutils@sourceware.org Subject: [PATCH 0/1] configure: Pass CPPFLAGS_FOR_BUILD to subdirectories Date: Thu, 15 Sep 2022 05:59:22 +0000 Message-Id: Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 List-Id: Hello, While investigating previous -Wstack-usage=262144 removal (on Clang) patch, I found something intresting. cf. Here's some excerpt from "$(builddir)/bfd/config.log": gcc: warning: @CPPFLAGS_FOR_BUILD@: linker input file unused because linking not done gcc: error: @CPPFLAGS_FOR_BUILD@: linker input file not found: No such file or directory gcc: warning: @CPPFLAGS_FOR_BUILD@: linker input file unused because linking not done gcc: error: @CPPFLAGS_FOR_BUILD@: linker input file not found: No such file or directory gcc: warning: @CPPFLAGS_FOR_BUILD@: linker input file unused because linking not done gcc: error: @CPPFLAGS_FOR_BUILD@: linker input file not found: No such file or directory This is because command like this is called: gcc -E @CPPFLAGS_FOR_BUILD@ conftest.c I found that this is because "$(build)/Makefile" passes CPPFLAGS_FOR_BUILD environment variable without substituting with AC_SUBST (should be placed in "$(srcdir)/configure.ac"). Here's excerpt from "$(builddir)/Makefile": CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ THIS IS NOT "$(srcdir)/Makefile.in" (it's normal in Makefile.in but should be substituted while generating "$(builddir)/Makefile"). I searched similar examples and found that following environment variables are unsubstituted in "$(builddir)/Makefile" AND possibly used in subdirs: - CPPFLAGS_FOR_BUILD - DSYMUTIL - DSYMUTIL_FOR_BUILD - DSYMUTIL_FOR_TARGET - OTOOL - OTOOL_FOR_TARGET note: There are other unsubstituted variables but I think they are not used by any subdirectories. At least, CPPFLAGS_FOR_BUILD can be tested on my own. For that, I think this simple patch would work. Request for Feedback (not a part of this patchset): dsymutil and otool are macOS development tools (used by libtool). Since I don't have any modern Mac, I don't want to touch them without testing. I have a test commit "configure: pass OTOOL and DSYMUTIL to subdirs" in my GitHub and can someone (who has real Mac machine) test it? Thanks, Tsukasa Tsukasa OI (1): configure: Pass CPPFLAGS_FOR_BUILD to subdirs configure | 3 +++ configure.ac | 2 ++ 2 files changed, 5 insertions(+) base-commit: fe39ffdc202f04397f31557f17170b40bc42b77a -- 2.34.1