[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Tinycc-devel] Patch for building native non-i386 compiler
From: |
tike64 |
Subject: |
[Tinycc-devel] Patch for building native non-i386 compiler |
Date: |
Tue, 12 Dec 2006 00:31:04 -0800 (PST) |
Hi,
The attached patch makes it possible to build a native non-i386
compiler, for example a build=i386:host=arm:target=arm compiler. That
one can be configured like this: "./configure --cross-prefix=arm-linux-
--cpu=armv4l". Path to arm-linux- tools must of course be in the $PATH.
The patch is against latest cvs patched with gotoff32 and tcc-pic
patches; see recent postings.
Again, could someone please verify this and, if good, commit to cvs.
--
tike
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
diff -rudw tinycc-gotoff32-pic/Makefile tinycc/Makefile
--- tinycc-gotoff32-pic/Makefile 2006-10-28 22:50:24.000000000 +0300
+++ tinycc/Makefile 2006-12-11 15:27:30.000000000 +0200
@@ -5,17 +5,22 @@
CFLAGS+=-g -Wall
ifndef CONFIG_WIN32
-LIBS=-ldl
-BCHECK_O=bcheck.o
+LIBS=-ldl -lm
endif
CFLAGS_P=$(CFLAGS) -pg -static -DCONFIG_TCC_STATIC
LIBS_P=
+ifeq ($(ARCH),i386)
CFLAGS+=-mpreferred-stack-boundary=2
ifeq ($(GCC_MAJOR),2)
CFLAGS+=-m386 -malign-functions=0
else
-CFLAGS+=-march=i386 -falign-functions=0 -fno-strict-aliasing
+CFLAGS+=-march=i386 -falign-functions=0
+endif
+endif
+
+ifneq ($(GCC_MAJOR),2)
+CFLAGS+=-fno-strict-aliasing
endif
DISAS=objdump -d
@@ -30,6 +35,8 @@
else
ifeq ($(ARCH),i386)
PROGS=tcc$(EXESUF)
+BCHECK_O=bcheck.o
+TCC_LIBS=libtcc1.a
ifdef CONFIG_CROSS
PROGS+=arm-tcc$(EXESUF)
endif
@@ -49,7 +56,7 @@
TCC=./tcc -B. -I.
all: $(PROGS) \
- libtcc1.a $(BCHECK_O) tcc-doc.html tcc.1 libtcc.a \
+ $(TCC_LIBS) $(BCHECK_O) tcc-doc.html tcc.1 libtcc.a \
libtcc_test$(EXESUF)
Makefile: config.mak
@@ -191,7 +198,7 @@
install: tcc_install libinstall
-tcc_install: $(PROGS) tcc.1 libtcc1.a $(BCHECK_O) tcc-doc.html
+tcc_install: $(PROGS) tcc.1 $(TCC_LIBS) $(BCHECK_O) tcc-doc.html
mkdir -p "$(bindir)"
$(INSTALL) -s -m755 $(PROGS) "$(bindir)"
ifndef CONFIG_WIN32
@@ -202,11 +209,11 @@
mkdir -p "$(tccdir)/include"
ifdef CONFIG_WIN32
mkdir -p "$(tccdir)/lib"
- $(INSTALL) -m644 libtcc1.a win32/lib/*.def "$(tccdir)/lib"
+ $(INSTALL) -m644 $(TCC_LIBS) win32/lib/*.def "$(tccdir)/lib"
cp -r win32/include/. "$(tccdir)/include"
cp -r win32/examples/. "$(tccdir)/examples"
else
- $(INSTALL) -m644 libtcc1.a $(BCHECK_O) "$(tccdir)"
+ $(INSTALL) -m644 $(TCC_LIBS) $(BCHECK_O) "$(tccdir)"
$(INSTALL) -m644 stdarg.h stddef.h stdbool.h float.h varargs.h \
tcclib.h "$(tccdir)/include"
endif
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Tinycc-devel] Patch for building native non-i386 compiler,
tike64 <=