History

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.

Milutin Jovanovic committed 14 years ago

Commit 6e13c351 parent 8ca8b082 files · +9 −4Browse files

Unified · Split

2 files
  1. Makefile +7 −2
  2. lib/Makefile +2 −2
Makefile+7−2
@@ -36,10 +36,12 @@ endif · 35 unmodified lines
36endif36endif
37 37
38ifeq ($(ARCH),i386)38ifeq ($(ARCH),i386)
39NATIVE_DEFINES=-DTCC_TARGET_I38639NATIVE_DEFINES=-DTCC_TARGET_I386
40CFLAGS+=-m32
40else41else
41ifeq ($(ARCH),x86-64)42ifeq ($(ARCH),x86-64)
42NATIVE_DEFINES=-DTCC_TARGET_X86_6443NATIVE_DEFINES=-DTCC_TARGET_X86_64
44CFLAGS+=-m64
43NATIVE_DEFINES+=$(if $(wildcard /lib64/ld-linux-x86-64.so.2),-DTCC_TARGET_X86_64_CENTOS)45NATIVE_DEFINES+=$(if $(wildcard /lib64/ld-linux-x86-64.so.2),-DTCC_TARGET_X86_64_CENTOS)
44endif46endif
45endif47endif
@@ -140,6 +142,9 @@ endif · 94 unmodified lines
140ifdef CONFIG_UCLIBC142ifdef CONFIG_UCLIBC
141BCHECK_O=143BCHECK_O=
142endif144endif
145ifeq ($(TARGETOS),Darwin)
146BCHECK_O=
147endif
143 148
144ifdef CONFIG_USE_LIBGCC149ifdef CONFIG_USE_LIBGCC
145LIBTCC1=150LIBTCC1=
@@ -157,7 +162,7 @@ all: $(PROGS) $(TCCLIBS) $(TCCDOCS) · 11 unmodified lines
157 162
158# Host Tiny C Compiler163# Host Tiny C Compiler
159tcc$(EXESUF): tcc.o $(LIBTCC)164tcc$(EXESUF): tcc.o $(LIBTCC)
160 $(CC) -o $@ $^ $(LIBS) $(LDFLAGS) $(LINK_LIBTCC)165 $(CC) -o $@ $^ $(LIBS) $(CFLAGS) $(LDFLAGS) $(LINK_LIBTCC)
161 166
162# Cross Tiny C Compilers167# Cross Tiny C Compilers
163%-tcc$(EXESUF):168%-tcc$(EXESUF):
lib/Makefile+2−2
@@ -14,11 +14,11 @@ ifndef TARGET · 13 unmodified lines
14 else14 else
15 ifeq ($(ARCH),i386)15 ifeq ($(ARCH),i386)
16 TARGET = i38616 TARGET = i386
17 XCC = gcc -O217 XCC = gcc -O2 -m32
18 else18 else
19 ifeq ($(ARCH),x86-64)19 ifeq ($(ARCH),x86-64)
20 TARGET = x86_6420 TARGET = x86_64
21 XCC = gcc -O221 XCC = gcc -O2 -m64
22 endif22 endif
23 endif23 endif
24 endif24 endif

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t