summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/cc
diff options
context:
space:
mode:
authornwhitehorn <nwhitehorn@FreeBSD.org>2010-12-02 04:58:07 +0000
committernwhitehorn <nwhitehorn@FreeBSD.org>2010-12-02 04:58:07 +0000
commitee62ec76ff365c8e08de24cfa1eaa3a45fcfafa5 (patch)
treeda733140479e007bc49885119d6898eff540a511 /gnu/usr.bin/cc
parent716b18c1570bdc613419f9a91614a5e1e193063f (diff)
downloadFreeBSD-src-ee62ec76ff365c8e08de24cfa1eaa3a45fcfafa5.zip
FreeBSD-src-ee62ec76ff365c8e08de24cfa1eaa3a45fcfafa5.tar.gz
The driver-XXX.c files used for host CPU detection with -march=native
should not be compiled in the cross-tools case (where -march=native makes no sense). This fixes cross-building x86 toolchains on non-x86 systems.
Diffstat (limited to 'gnu/usr.bin/cc')
-rw-r--r--gnu/usr.bin/cc/Makefile.fe3
1 files changed, 2 insertions, 1 deletions
diff --git a/gnu/usr.bin/cc/Makefile.fe b/gnu/usr.bin/cc/Makefile.fe
index d9c5fe5..46b9bbc 100644
--- a/gnu/usr.bin/cc/Makefile.fe
+++ b/gnu/usr.bin/cc/Makefile.fe
@@ -19,7 +19,8 @@ CFLAGS+= ${DRIVER_DEFINES}
SRCS= gcc.c opts-common.c options.c intl.c prefix.c version.c
-.if exists(${GCCDIR}/config/${GCC_CPU}/driver-${GCC_CPU}.c)
+.if ${TARGET_ARCH} == ${MACHINE_ARCH} && \
+ exists(${GCCDIR}/config/${GCC_CPU}/driver-${GCC_CPU}.c)
SRCS+= driver-${GCC_CPU}.c
.endif
OpenPOWER on IntegriCloud