From bd7aca676d5f9f5f6b7faa615e2669e06e3416c2 Mon Sep 17 00:00:00 2001 From: Maksym Sobolyev Date: Thu, 15 Oct 2020 18:14:29 -0700 Subject: [PATCH] Treat both clang and gcc the same for the purpose of figuring out CC_ARCH. Also use -m32 when linking on i386 with clang. --- Makefile.defs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile.defs b/Makefile.defs index efee66054c5..5cb817de293 100644 --- a/Makefile.defs +++ b/Makefile.defs @@ -238,7 +238,7 @@ mips64_macros= _MIPS_ISA_MIPS64 _MIPS_ARCH_MIPS64 alpha_macros= __alpha__ __alpha _M_ALPHA_ -ifeq ($(CC_NAME),gcc) +ifeq ($(CC_NAME:clang=gcc),gcc) #if gcc use gcc arch predef_macros:=$(shell $(CC) -dM -E -x c $(CC_EXTRA_OPTS) $(extra_defs) \ $(CFLAGS) /dev/null) @@ -886,7 +886,8 @@ ifeq ($(CC_NAME), suncc) # -Dinline="" # add this if cc < 5.3 (define inline as null) else ifeq ($(CC_NAME), clang) - CFLAGS+=$(CC_OPTIMIZE_FLAG) -Wall -funroll-loops -fno-common + CFLAGS+=-m32 $(CC_OPTIMIZE_FLAG) -Wall -funroll-loops -fno-common + LDFLAGS+=-m32 else #other compilers $(error Unsupported compiler ($(CC):$(CC_NAME)), try gcc)