aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2022-10-31 13:20:13 +0545
committerMike Frysinger <vapier@gentoo.org>2022-11-02 20:59:14 +0545
commitfde7c6bf646146aa342919b413dff07f558d55dc (patch)
tree5b617116d058a48dcd7af66cba9f149759de1afc
parente4f2bc9c05303d399093a8b944ce4b07fa86c513 (diff)
downloadgdb-fde7c6bf646146aa342919b413dff07f558d55dc.zip
gdb-fde7c6bf646146aa342919b413dff07f558d55dc.tar.gz
gdb-fde7c6bf646146aa342919b413dff07f558d55dc.tar.bz2
sim: split CPPFLAGS between build & host
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.
-rw-r--r--sim/Makefile.am5
-rw-r--r--sim/Makefile.in5
-rw-r--r--sim/arch-subdir.mk.in1
-rw-r--r--sim/common/local.mk1
-rwxr-xr-xsim/configure8
-rw-r--r--sim/m4/sim_ac_toolchain.m43
6 files changed, 19 insertions, 4 deletions
diff --git a/sim/Makefile.am b/sim/Makefile.am
index 79537e7..594c91f 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/Makefile.in b/sim/Makefile.in
index f471289..36e95cf 100644
--- a/sim/Makefile.in
+++ b/sim/Makefile.in
@@ -741,6 +741,7 @@ CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
CGEN_MAINT = @CGEN_MAINT@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@
CYGPATH_W = @CYGPATH_W@
C_DIALECT = @C_DIALECT@
DATADIRNAME = @DATADIRNAME@
@@ -945,7 +946,9 @@ MOSTLYCLEANFILES = core $(am__append_5) site-sim-config.exp \
$(am__append_34) $(am__append_37) $(am__append_39)
AM_CFLAGS = $(WERROR_CFLAGS) $(WARN_CFLAGS)
AM_CPPFLAGS = -I$(srcroot)/include $(SIM_INLINE) -I$(srcdir)/common
-COMPILE_FOR_BUILD = $(CC_FOR_BUILD) $(AM_CPPFLAGS) $(CFLAGS_FOR_BUILD)
+AM_CPPFLAGS_FOR_BUILD = -I$(srcroot)/include $(SIM_INLINE) \
+ -I$(srcdir)/common
+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 $@
SIM_ALL_RECURSIVE_DEPS = 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 69a8e2f..2c0e2bb 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 377ebe6..65a375f 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/configure b/sim/configure
index dac7f08..5283ef9 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" = "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
@@ -5014,6 +5017,7 @@ fi
+
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
set dummy ${ac_tool_prefix}ar; ac_word=$2
@@ -12771,7 +12775,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12774 "configure"
+#line 12778 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -12877,7 +12881,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12880 "configure"
+#line 12884 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
diff --git a/sim/m4/sim_ac_toolchain.m4 b/sim/m4/sim_ac_toolchain.m4
index 7453214..f3bcf46 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)