From 5a7bfc90a9f08da82086c84134b8a3513a7c584e Mon Sep 17 00:00:00 2001 From: Nathan Whitehorn Date: Thu, 2 Dec 2010 04:58:07 +0000 Subject: [PATCH] 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. --- gnu/usr.bin/cc/Makefile.fe | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gnu/usr.bin/cc/Makefile.fe b/gnu/usr.bin/cc/Makefile.fe index d9c5fe58574..46b9bbc316e 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