From ee62ec76ff365c8e08de24cfa1eaa3a45fcfafa5 Mon Sep 17 00:00:00 2001 From: nwhitehorn Date: Thu, 2 Dec 2010 04:58:07 +0000 Subject: 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(-) (limited to 'gnu/usr.bin/cc') 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 -- cgit v1.1 From 789892d7ed5efe3e04bd964f26650d2043686819 Mon Sep 17 00:00:00 2001 From: nwhitehorn Date: Thu, 2 Dec 2010 17:36:47 +0000 Subject: Unbreak amd64<->i386 cross builds. --- gnu/usr.bin/cc/Makefile.fe | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gnu/usr.bin/cc') diff --git a/gnu/usr.bin/cc/Makefile.fe b/gnu/usr.bin/cc/Makefile.fe index 46b9bbc..a681510 100644 --- a/gnu/usr.bin/cc/Makefile.fe +++ b/gnu/usr.bin/cc/Makefile.fe @@ -19,8 +19,9 @@ CFLAGS+= ${DRIVER_DEFINES} SRCS= gcc.c opts-common.c options.c intl.c prefix.c version.c -.if ${TARGET_ARCH} == ${MACHINE_ARCH} && \ - exists(${GCCDIR}/config/${GCC_CPU}/driver-${GCC_CPU}.c) +# Include -march=native support for native-ish compilers only +.if (${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64") && \ + ${GCC_CPU} == "i386" SRCS+= driver-${GCC_CPU}.c .endif -- cgit v1.1