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
3636 endif
3737
3838 ifeq ($(ARCH),i386)
39−NATIVE_DEFINES=-DTCC_TARGET_I386
39+NATIVE_DEFINES=-DTCC_TARGET_I386
40+CFLAGS+=-m32
4041 else
4142 ifeq ($(ARCH),x86-64)
4243 NATIVE_DEFINES=-DTCC_TARGET_X86_64
44+CFLAGS+=-m64
4345 NATIVE_DEFINES+=$(if $(wildcard /lib64/ld-linux-x86-64.so.2),-DTCC_TARGET_X86_64_CENTOS)
4446 endif
4547 endif
@@ -140,6 +142,9 @@ endif · 94 unmodified lines
140142 ifdef CONFIG_UCLIBC
141143 BCHECK_O=
142144 endif
145+ifeq ($(TARGETOS),Darwin)
146+BCHECK_O=
147+endif
143148
144149 ifdef CONFIG_USE_LIBGCC
145150 LIBTCC1=
@@ -157,7 +162,7 @@ all: $(PROGS) $(TCCLIBS) $(TCCDOCS) · 11 unmodified lines
157162
158163 # Host Tiny C Compiler
159164 tcc$(EXESUF): tcc.o $(LIBTCC)
160− $(CC) -o $@ $^ $(LIBS) $(LDFLAGS) $(LINK_LIBTCC)
165+ $(CC) -o $@ $^ $(LIBS) $(CFLAGS) $(LDFLAGS) $(LINK_LIBTCC)
161166
162167 # Cross Tiny C Compilers
163168 %-tcc$(EXESUF):
lib/Makefile+2−2
@@ -14,11 +14,11 @@ ifndef TARGET · 13 unmodified lines
1414 else
1515 ifeq ($(ARCH),i386)
1616 TARGET = i386
17− XCC = gcc -O2
17+ XCC = gcc -O2 -m32
1818 else
1919 ifeq ($(ARCH),x86-64)
2020 TARGET = x86_64
21− XCC = gcc -O2
21+ XCC = gcc -O2 -m64
2222 endif
2323 endif
2424 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