Fix in-tree GCC builds after r304681.
There were a few issues.
- In-tree GCC won't have X_COMPILER_TYPE defined but will have
WANT_COMPILER_TYPE==gcc set from the SYSTEM_COMPILER logic that can
be used. Make the clang check specific to clang as well to ensure
-target doesn't leak into a GCC build.
- When using a cross-compiler GCC (with a default sysroot or arch) and also
passing --sysroot, it basically forgets all internal paths for
libraries. We've already worked around this quite a bit for
the external toolchains. Now for the in-tree bootstrap cross-compiler
GCC, also pass in the needed -B${WORLDTMP}/usr/lib to find the crt
object files, but also -isystem and -L to fix the paths. This creates
quite a spammy build log, but it is clear and still achieves the goals
and stays consistent between internal and external build flags.
Reducing the spam by using the '=' prefix feature will help and be
done later.
MFC after: 3 days
X-MFC-With: r304681
Reported by: bz
Pointyhat to: bdrewery
Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
+2
-1
@@ -73,7 +73,8 @@ LIBCOMPATCFLAGS+= ${LIBCOMPATCPUFLAGS} \
|
||||
# Clang/GCC.
|
||||
LIBCOMPATCFLAGS+= -B${LIBCOMPATTMP}/usr/lib${libcompat}
|
||||
|
||||
.if defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc
|
||||
.if ${WANT_COMPILER_TYPE} == gcc || \
|
||||
(defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc)
|
||||
# GCC requires -isystem when using a cross-compiler and --sysroot. Note that
|
||||
# Makefile.inc1 only applies this with an external compiler but libcompat
|
||||
# always does since even in-tree GCC 4.2 needs this to override the built-in
|
||||
|
||||
Reference in New Issue
Block a user