From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1521) id A7602385AC2D; Wed, 2 Nov 2022 16:31:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A7602385AC2D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667406669; bh=OJlsB0J0pAMRpf/+HNeLhL0oPvKbwl9v/l1MQ4fCECw=; h=From:To:Subject:Date:From; b=Wx0mMNVrsN435NGjld4x9e1iyOT4Z9JmC947Ervkxca/alxfIgH+i3GVcgNf2x8QY DaVBptMAh5+RKQCgsnE7cjUNXSWxm8ZaFZ3EvqQXl/bUYObuTVz088lwiST2iWRE/n CVnkFsvT6vq/RuVqaxJqLEFuIMhsZK592j88Oua8= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Michael Frysinger To: gdb-cvs@sourceware.org Subject: [binutils-gdb] sim: split CPPFLAGS between build & host X-Act-Checkin: binutils-gdb X-Git-Author: Mike Frysinger X-Git-Refname: refs/heads/master X-Git-Oldrev: e4f2bc9c05303d399093a8b944ce4b07fa86c513 X-Git-Newrev: fde7c6bf646146aa342919b413dff07f558d55dc Message-Id: <20221102163109.A7602385AC2D@sourceware.org> Date: Wed, 2 Nov 2022 16:31:09 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Dfde7c6bf6461= 46aa342919b413dff07f558d55dc commit fde7c6bf646146aa342919b413dff07f558d55dc Author: Mike Frysinger Date: Mon Oct 31 13:20:13 2022 +0545 sim: split CPPFLAGS between build & host =20 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. Diff: --- 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 79537e779b3..594c91ff19b 100644 --- a/sim/Makefile.am +++ b/sim/Makefile.am @@ -42,7 +42,10 @@ AM_CPPFLAGS =3D \ -I$(srcroot)/include \ $(SIM_INLINE) =20 -COMPILE_FOR_BUILD =3D $(CC_FOR_BUILD) $(AM_CPPFLAGS) $(CFLAGS_FOR_BUILD) +AM_CPPFLAGS_FOR_BUILD =3D \ + -I$(srcroot)/include \ + $(SIM_INLINE) +COMPILE_FOR_BUILD =3D $(CC_FOR_BUILD) $(AM_CPPFLAGS_FOR_BUILD) $(CPPFLAGS_= FOR_BUILD) $(CFLAGS_FOR_BUILD) LINK_FOR_BUILD =3D $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD= ) -o $@ =20 ## Deps to add to the all-recursive target. These are built before descen= ding diff --git a/sim/Makefile.in b/sim/Makefile.in index f471289600c..36e95cf3046 100644 --- a/sim/Makefile.in +++ b/sim/Makefile.in @@ -741,6 +741,7 @@ CFLAGS_FOR_BUILD =3D @CFLAGS_FOR_BUILD@ CGEN_MAINT =3D @CGEN_MAINT@ CPP =3D @CPP@ CPPFLAGS =3D @CPPFLAGS@ +CPPFLAGS_FOR_BUILD =3D @CPPFLAGS_FOR_BUILD@ CYGPATH_W =3D @CYGPATH_W@ C_DIALECT =3D @C_DIALECT@ DATADIRNAME =3D @DATADIRNAME@ @@ -945,7 +946,9 @@ MOSTLYCLEANFILES =3D core $(am__append_5) site-sim-conf= ig.exp \ $(am__append_34) $(am__append_37) $(am__append_39) AM_CFLAGS =3D $(WERROR_CFLAGS) $(WARN_CFLAGS) AM_CPPFLAGS =3D -I$(srcroot)/include $(SIM_INLINE) -I$(srcdir)/common -COMPILE_FOR_BUILD =3D $(CC_FOR_BUILD) $(AM_CPPFLAGS) $(CFLAGS_FOR_BUILD) +AM_CPPFLAGS_FOR_BUILD =3D -I$(srcroot)/include $(SIM_INLINE) \ + -I$(srcdir)/common +COMPILE_FOR_BUILD =3D $(CC_FOR_BUILD) $(AM_CPPFLAGS_FOR_BUILD) $(CPPFLAGS_= FOR_BUILD) $(CFLAGS_FOR_BUILD) LINK_FOR_BUILD =3D $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD= ) -o $@ SIM_ALL_RECURSIVE_DEPS =3D common/libcommon.a $(am__append_2) \ $(am__append_6) $(am__append_8) $(am__append_11) \ diff --git a/sim/arch-subdir.mk.in b/sim/arch-subdir.mk.in index 69a8e2f1e55..2c0e2bbce93 100644 --- a/sim/arch-subdir.mk.in +++ b/sim/arch-subdir.mk.in @@ -32,6 +32,7 @@ CC =3D @CC@ C_DIALECT =3D @C_DIALECT@ CC_FOR_BUILD =3D @CC_FOR_BUILD@ CFLAGS_FOR_BUILD =3D @CFLAGS_FOR_BUILD@ +CPPFLAGS_FOR_BUILD =3D @CPPFLAGS_FOR_BUILD@ CFLAGS =3D @CFLAGS@ CPPFLAGS =3D @CPPFLAGS@ LDFLAGS =3D @LDFLAGS@ diff --git a/sim/common/local.mk b/sim/common/local.mk index 377ebe64730..65a375f349f 100644 --- a/sim/common/local.mk +++ b/sim/common/local.mk @@ -19,6 +19,7 @@ ## Most still lives in common/Make-common.in. =20 AM_CPPFLAGS +=3D -I$(srcdir)/%D% +AM_CPPFLAGS_FOR_BUILD +=3D -I$(srcdir)/%D% =20 ## This makes sure common parts are available before building the arch-sub= dirs ## which will refer to these. diff --git a/sim/configure b/sim/configure index dac7f085be1..5283ef9c0dc 100755 --- a/sim/configure +++ b/sim/configure @@ -903,6 +903,7 @@ PKG_CONFIG RANLIB AR LDFLAGS_FOR_BUILD +CPPFLAGS_FOR_BUILD CFLAGS_FOR_BUILD RANLIB_FOR_BUILD CC_FOR_BUILD @@ -4999,12 +5000,14 @@ if test "x$cross_compiling" =3D "xno"; then : "${CC_FOR_BUILD:=3D\$(CC)}" : "${RANLIB_FOR_BUILD:=3D\$(RANLIB)}" : "${CFLAGS_FOR_BUILD:=3D\$(CFLAGS)}" + : "${CPPFLAGS_FOR_BUILD:=3D\$(CPPFLAGS)}" : "${LDFLAGS_FOR_BUILD:=3D\$(LDFLAGS)}" else : "${AR_FOR_BUILD:=3Dar}" : "${CC_FOR_BUILD:=3Dgcc}" : "${RANLIB_FOR_BUILD:=3Dranlib}" : "${CFLAGS_FOR_BUILD:=3D-g -O}" + : "${CPPFLAGS_FOR_BUILD:=3D}" : "${LDLFAGS_FOR_BUILD:=3D}" fi =20 @@ -5014,6 +5017,7 @@ fi =20 =20 =20 + if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a progra= m name with args. set dummy ${ac_tool_prefix}ar; ac_word=3D$2 @@ -12771,7 +12775,7 @@ else lt_dlunknown=3D0; lt_dlno_uscore=3D1; lt_dlneed_uscore=3D2 lt_status=3D$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12774 "configure" +#line 12778 "configure" #include "confdefs.h" =20 #if HAVE_DLFCN_H @@ -12877,7 +12881,7 @@ else lt_dlunknown=3D0; lt_dlno_uscore=3D1; lt_dlneed_uscore=3D2 lt_status=3D$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12880 "configure" +#line 12884 "configure" #include "confdefs.h" =20 #if HAVE_DLFCN_H diff --git a/sim/m4/sim_ac_toolchain.m4 b/sim/m4/sim_ac_toolchain.m4 index 74532142929..f3bcf463656 100644 --- a/sim/m4/sim_ac_toolchain.m4 +++ b/sim/m4/sim_ac_toolchain.m4 @@ -32,18 +32,21 @@ if test "x$cross_compiling" =3D "xno"; then : "${CC_FOR_BUILD:=3D\$(CC)}" : "${RANLIB_FOR_BUILD:=3D\$(RANLIB)}" : "${CFLAGS_FOR_BUILD:=3D\$(CFLAGS)}" + : "${CPPFLAGS_FOR_BUILD:=3D\$(CPPFLAGS)}" : "${LDFLAGS_FOR_BUILD:=3D\$(LDFLAGS)}" else : "${AR_FOR_BUILD:=3Dar}" : "${CC_FOR_BUILD:=3Dgcc}" : "${RANLIB_FOR_BUILD:=3Dranlib}" : "${CFLAGS_FOR_BUILD:=3D-g -O}" + : "${CPPFLAGS_FOR_BUILD:=3D}" : "${LDLFAGS_FOR_BUILD:=3D}" 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) =20 AC_SUBST(CFLAGS)