From patchwork Mon Oct 31 16:32:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 59696 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A329A38576AA for ; Mon, 31 Oct 2022 17:47:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A329A38576AA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667238428; bh=UhtLi7kogOpr7Ujzftzxu0pCm0vEtnWrzWeVh/jv7jk=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=NWFjEzz7UdKF3d75EY9ln7/Yxs8LE//8pNeD2YWDlO8DsHo3n5j+bg9ZDWM35hkaf ViDvwhyZoTJLOTNH9VWCq5yYrj/+mOXcyMBqWFj6jLz8rpGBJ9NEo2P6QY6yFtdWmk SBPUY25EP5TW2XD9nJix2JEadUqufMHtV6NfFmWo= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id EB2F03857697 for ; Mon, 31 Oct 2022 17:46:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EB2F03857697 Received: by smtp.gentoo.org (Postfix, from userid 559) id 3A8D4340DC5; Mon, 31 Oct 2022 17:46:40 +0000 (UTC) To: gdb-patches@sourceware.org Subject: [PATCH] sim: split CPPFLAGS between build & host Date: Mon, 31 Oct 2022 22:17:16 +0545 Message-Id: <20221031163217.27452-1-vapier@gentoo.org> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_PASS, 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: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Mike Frysinger via Gdb-patches From: Mike Frysinger Reply-To: Mike Frysinger Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" In order to merge more common/ files into the top-level, we need to add more host flags to CPPFLAGS, and that conflicts with our current use with build-time tools. So split them apart like we do with all other build flags to avoid the issue. --- sim/Makefile.am | 5 ++++- sim/Makefile.in | 5 ++++- sim/arch-subdir.mk.in | 1 + sim/common/local.mk | 1 + sim/configure | 8 ++++++-- sim/m4/sim_ac_toolchain.m4 | 3 +++ 6 files changed, 19 insertions(+), 4 deletions(-) diff --git a/sim/Makefile.am b/sim/Makefile.am index 79537e779b3a..594c91ff19bd 100644 --- a/sim/Makefile.am +++ b/sim/Makefile.am @@ -42,7 +42,10 @@ AM_CPPFLAGS = \ -I$(srcroot)/include \ $(SIM_INLINE) -COMPILE_FOR_BUILD = $(CC_FOR_BUILD) $(AM_CPPFLAGS) $(CFLAGS_FOR_BUILD) +AM_CPPFLAGS_FOR_BUILD = \ + -I$(srcroot)/include \ + $(SIM_INLINE) +COMPILE_FOR_BUILD = $(CC_FOR_BUILD) $(AM_CPPFLAGS_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) LINK_FOR_BUILD = $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ ## Deps to add to the all-recursive target. These are built before descending diff --git a/sim/arch-subdir.mk.in b/sim/arch-subdir.mk.in index 69a8e2f1e551..2c0e2bbce93d 100644 --- a/sim/arch-subdir.mk.in +++ b/sim/arch-subdir.mk.in @@ -32,6 +32,7 @@ CC = @CC@ C_DIALECT = @C_DIALECT@ CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ +CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ diff --git a/sim/common/local.mk b/sim/common/local.mk index 377ebe647308..65a375f349f7 100644 --- a/sim/common/local.mk +++ b/sim/common/local.mk @@ -19,6 +19,7 @@ ## Most still lives in common/Make-common.in. AM_CPPFLAGS += -I$(srcdir)/%D% +AM_CPPFLAGS_FOR_BUILD += -I$(srcdir)/%D% ## This makes sure common parts are available before building the arch-subdirs ## which will refer to these. diff --git a/sim/m4/sim_ac_toolchain.m4 b/sim/m4/sim_ac_toolchain.m4 index 74532142929c..f3bcf463656e 100644 --- a/sim/m4/sim_ac_toolchain.m4 +++ b/sim/m4/sim_ac_toolchain.m4 @@ -32,18 +32,21 @@ if test "x$cross_compiling" = "xno"; then : "${CC_FOR_BUILD:=\$(CC)}" : "${RANLIB_FOR_BUILD:=\$(RANLIB)}" : "${CFLAGS_FOR_BUILD:=\$(CFLAGS)}" + : "${CPPFLAGS_FOR_BUILD:=\$(CPPFLAGS)}" : "${LDFLAGS_FOR_BUILD:=\$(LDFLAGS)}" else : "${AR_FOR_BUILD:=ar}" : "${CC_FOR_BUILD:=gcc}" : "${RANLIB_FOR_BUILD:=ranlib}" : "${CFLAGS_FOR_BUILD:=-g -O}" + : "${CPPFLAGS_FOR_BUILD:=}" : "${LDLFAGS_FOR_BUILD:=}" fi AC_SUBST(AR_FOR_BUILD) AC_SUBST(CC_FOR_BUILD) AC_SUBST(RANLIB_FOR_BUILD) AC_SUBST(CFLAGS_FOR_BUILD) +AC_SUBST(CPPFLAGS_FOR_BUILD) AC_SUBST(LDFLAGS_FOR_BUILD) AC_SUBST(CFLAGS)