From 8ca8b08890c220a9e238c711aef96b49727e80f0 Mon Sep 17 00:00:00 2001 From: Milutin Jovanovic Date: Thu, 9 Feb 2012 12:53:17 -0500 Subject: Patch attempting to build OSX TinyCC. Applied patch found on stackoverflow (link below). I also found some related changes that looked like logically needed. The stackoverflow changes addressed only two registers which were breaking a compile. However reading the code in the same file shows two other register accesses that, while not breaking the build, should have the same fix. http://stackoverflow.com/questions/3712902/problems-compiling-tcc-on-os-x/3713144#3713144 The test driver was changed by changing 'cp -u' into 'cp' as '-u' is not supported on mac osx. I found that osx build required the WITHOUT_LIBTCC define. I suspect the reason for this is tcc unability to handle mach-o files. In order to properly address this I had to change 'configure' to propagate target os name to Makefile. Current state is that simple tests work, but not the whole 'make test' suite runs. To the best of my knowledge, these changes should not impact other platforms. --- tests/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/Makefile b/tests/Makefile index 8cd906d..2cf9e28 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -45,7 +45,7 @@ libtcc_test$(EXESUF): libtcc_test.c ../$(LIBTCC) # test.ref - generate using gcc # copy only tcclib.h so GCC's stddef and stdarg will be used test.ref: tcctest.c - cp -u ../include/tcclib.h . + cp ../include/tcclib.h . $(CC) -o tcctest.gcc $< -I. -w $(CFLAGS) -std=gnu99 ./tcctest.gcc > $@ -- cgit v1.3.1