diff options
author | John Baldwin <jhb@FreeBSD.org> | 2018-06-27 18:14:33 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2018-06-27 18:14:33 +0000 |
commit | 104f6a2dcdde64f316849b60a428066aaa73cc9c (patch) | |
tree | 33dae3bd66fb50c1bf22a597143c05762a3b63d8 /gnu/usr.bin | |
parent | 7cdb6a830526fb77fc1270c34145d512e3269812 (diff) | |
download | src-104f6a2dcdde64f316849b60a428066aaa73cc9c.tar.gz src-104f6a2dcdde64f316849b60a428066aaa73cc9c.zip |
Fix GCC 4.2.1 to honor --sysroot for includes.
- Change the C++ directory entries to honor --sysroot if it is set.
- Don't define CROSS_INCLUDE_DIR for the cross compiler. Instead, set
TARGET_SYSTEM_ROOT to point to WORLDTMP and always define
STANDARD_INCLUDE_DIR.
- Change STANDARD_INCLUDE_DIR and the C++ include directories to just
start with "/usr" always. The compiler will prepend the sysroot when
doing cross-builds. GCC_INCLUDE_DIR (which contains headers that ship
with the compiler such as intrinsincs rather than OS-supplied headers)
remains hardcoded to look in TOOLS_PREFIX.
Reviewed by: bdrewery (older version)
Sponsored by: DARPA / AFRL
Differential Revision: https://reviews.freebsd.org/D15127
Notes
Notes:
svn path=/head/; revision=335717
Diffstat (limited to 'gnu/usr.bin')
-rw-r--r-- | gnu/usr.bin/cc/Makefile.inc | 1 | ||||
-rw-r--r-- | gnu/usr.bin/cc/cc_tools/freebsd-native.h | 10 |
2 files changed, 4 insertions, 7 deletions
diff --git a/gnu/usr.bin/cc/Makefile.inc b/gnu/usr.bin/cc/Makefile.inc index 7e196965ddbf..1af7d46fa777 100644 --- a/gnu/usr.bin/cc/Makefile.inc +++ b/gnu/usr.bin/cc/Makefile.inc @@ -25,6 +25,7 @@ CSTD?= gnu89 .if ${TARGET_ARCH} != ${MACHINE_ARCH} CFLAGS+= -DCROSS_DIRECTORY_STRUCTURE +CFLAGS+= -DTARGET_SYSTEM_ROOT=\"${TOOLS_PREFIX}\" .endif .if ${TARGET_CPUARCH} == "arm" diff --git a/gnu/usr.bin/cc/cc_tools/freebsd-native.h b/gnu/usr.bin/cc/cc_tools/freebsd-native.h index fce911f94649..7e11bd83537c 100644 --- a/gnu/usr.bin/cc/cc_tools/freebsd-native.h +++ b/gnu/usr.bin/cc/cc_tools/freebsd-native.h @@ -15,14 +15,10 @@ #undef LOCAL_INCLUDE_DIR /* We don't wish to support one. */ /* Look for the include files in the system-defined places. */ -#define GPLUSPLUS_INCLUDE_DIR PREFIX"/include/c++/"GCCVER -#define GPLUSPLUS_BACKWARD_INCLUDE_DIR PREFIX"/include/c++/"GCCVER"/backward" +#define GPLUSPLUS_INCLUDE_DIR "/usr/include/c++/"GCCVER +#define GPLUSPLUS_BACKWARD_INCLUDE_DIR "/usr/include/c++/"GCCVER"/backward" #define GCC_INCLUDE_DIR PREFIX"/include/gcc/"GCCVER -#ifdef CROSS_DIRECTORY_STRUCTURE -#define CROSS_INCLUDE_DIR PREFIX"/include" -#else -#define STANDARD_INCLUDE_DIR PREFIX"/include" -#endif +#define STANDARD_INCLUDE_DIR "/usr/include" /* Under FreeBSD, the normal location of the compiler back ends is the /usr/libexec directory. |