mirror of
https://github.com/frida/tinycc
synced 2024-12-25 06:26:49 +03:00
Attempt to fix 32 bit OSX build. The fix consists of adding -m32 and -m64
to the appropriate CFLAGS. In addition, memory hooks are very different on OSX, so build of bcheck.c had to be disabled for now. Change of the CFLAGS does affect builds on other platforms, and this needs to be tested.
This commit is contained in:
parent
8ca8b08890
commit
6e13c35334
9
Makefile
9
Makefile
@ -36,10 +36,12 @@ endif
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(ARCH),i386)
|
ifeq ($(ARCH),i386)
|
||||||
NATIVE_DEFINES=-DTCC_TARGET_I386
|
NATIVE_DEFINES=-DTCC_TARGET_I386
|
||||||
|
CFLAGS+=-m32
|
||||||
else
|
else
|
||||||
ifeq ($(ARCH),x86-64)
|
ifeq ($(ARCH),x86-64)
|
||||||
NATIVE_DEFINES=-DTCC_TARGET_X86_64
|
NATIVE_DEFINES=-DTCC_TARGET_X86_64
|
||||||
|
CFLAGS+=-m64
|
||||||
NATIVE_DEFINES+=$(if $(wildcard /lib64/ld-linux-x86-64.so.2),-DTCC_TARGET_X86_64_CENTOS)
|
NATIVE_DEFINES+=$(if $(wildcard /lib64/ld-linux-x86-64.so.2),-DTCC_TARGET_X86_64_CENTOS)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@ -140,6 +142,9 @@ endif
|
|||||||
ifdef CONFIG_UCLIBC
|
ifdef CONFIG_UCLIBC
|
||||||
BCHECK_O=
|
BCHECK_O=
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(TARGETOS),Darwin)
|
||||||
|
BCHECK_O=
|
||||||
|
endif
|
||||||
|
|
||||||
ifdef CONFIG_USE_LIBGCC
|
ifdef CONFIG_USE_LIBGCC
|
||||||
LIBTCC1=
|
LIBTCC1=
|
||||||
@ -157,7 +162,7 @@ all: $(PROGS) $(TCCLIBS) $(TCCDOCS)
|
|||||||
|
|
||||||
# Host Tiny C Compiler
|
# Host Tiny C Compiler
|
||||||
tcc$(EXESUF): tcc.o $(LIBTCC)
|
tcc$(EXESUF): tcc.o $(LIBTCC)
|
||||||
$(CC) -o $@ $^ $(LIBS) $(LDFLAGS) $(LINK_LIBTCC)
|
$(CC) -o $@ $^ $(LIBS) $(CFLAGS) $(LDFLAGS) $(LINK_LIBTCC)
|
||||||
|
|
||||||
# Cross Tiny C Compilers
|
# Cross Tiny C Compilers
|
||||||
%-tcc$(EXESUF):
|
%-tcc$(EXESUF):
|
||||||
|
@ -14,11 +14,11 @@ ifndef TARGET
|
|||||||
else
|
else
|
||||||
ifeq ($(ARCH),i386)
|
ifeq ($(ARCH),i386)
|
||||||
TARGET = i386
|
TARGET = i386
|
||||||
XCC = gcc -O2
|
XCC = gcc -O2 -m32
|
||||||
else
|
else
|
||||||
ifeq ($(ARCH),x86-64)
|
ifeq ($(ARCH),x86-64)
|
||||||
TARGET = x86_64
|
TARGET = x86_64
|
||||||
XCC = gcc -O2
|
XCC = gcc -O2 -m64
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user