Skip to content

Commit

Permalink
Treat both clang and gcc the same for the purpose of figuring out
Browse files Browse the repository at this point in the history
CC_ARCH. Also use -m32 when linking on i386 with clang.
  • Loading branch information
sobomax committed Oct 17, 2020
1 parent 27634ff commit bd7aca6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Makefile.defs
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit bd7aca6

Please sign in to comment.