From d2d085e82a0db947c003d97266a49b89b616fe73 Mon Sep 17 00:00:00 2001 From: dinoex Date: Fri, 21 Aug 2009 04:39:28 +0000 Subject: - add experimetal support for new archs --- lang/tcc/Makefile | 14 +++++++++++-- lang/tcc/files/patch-Makefile | 45 ++++++++++++++++++++++++++++++++++++++++-- lang/tcc/files/patch-configure | 12 +++++++++++ lang/tcc/files/patch-libtcc.c | 21 ++++++++++++++++++++ lang/tcc/pkg-plist | 2 +- 5 files changed, 89 insertions(+), 5 deletions(-) create mode 100644 lang/tcc/files/patch-configure create mode 100644 lang/tcc/files/patch-libtcc.c diff --git a/lang/tcc/Makefile b/lang/tcc/Makefile index 770def7489a0..2d8adbd11a55 100644 --- a/lang/tcc/Makefile +++ b/lang/tcc/Makefile @@ -15,6 +15,8 @@ MAINTAINER= dinoex@FreeBSD.org COMMENT= Tiny C Compiler ONLY_FOR_ARCHS= i386 +#ONLY_FOR_ARCHS= i386 amd64 arm alpha mips powerpc + CONFLICTS= TenDRA-* USE_BZIP2= yes @@ -25,7 +27,15 @@ MAKE_ARGS+= CONFIG_NOLDL=1 MAN1= tcc.1 .if defined(NOPORTDOCS) -MAKE_ARGS+= NOPORTDOCS=1 +MAKE_ARGS+= NOPORTDOCS=1 CFLAGS="${CFLAGS}" +.endif + +.include + +.if (${ARCH} == i386) +PLIST_SUB+= WITH_I386="" +.else +PLIST_SUB+= WITH_I386="@comment " .endif -.include +.include diff --git a/lang/tcc/files/patch-Makefile b/lang/tcc/files/patch-Makefile index 919887498898..b8248da8158b 100644 --- a/lang/tcc/files/patch-Makefile +++ b/lang/tcc/files/patch-Makefile @@ -1,6 +1,47 @@ --- Makefile.orig 2009-05-18 16:27:06.000000000 +0200 -+++ Makefile 2009-05-21 06:39:33.000000000 +0200 -@@ -210,8 +210,10 @@ ++++ Makefile 2009-07-03 07:40:15.000000000 +0200 +@@ -28,6 +28,9 @@ + ifeq ($(ARCH),x86-64) + CFLAGS+=-Wno-pointer-sign + endif ++ifeq ($(ARCH),amd64) ++CFLAGS+=-Wno-pointer-sign ++endif + + ifndef CONFIG_WIN32 + LIBS=-lm +@@ -53,6 +56,11 @@ + ifeq ($(ARCH),x86-64) + NATIVE_TARGET=-DTCC_TARGET_X86_64 + LIBTCC1=libtcc1.a ++else ++ifeq ($(ARCH),amd64) ++NATIVE_TARGET=-DTCC_TARGET_X86_64 ++LIBTCC1=libtcc1.a ++endif + endif + endif + endif +@@ -99,6 +107,10 @@ + NATIVE_FILES=$(X86_64_FILES) + PROGS_CROSS=$(I386_CROSS) $(WIN32_CROSS) $(ARM_CROSS) $(C67_CROSS) + else ++ifeq ($(ARCH),amd64) ++NATIVE_FILES=$(X86_64_FILES) ++PROGS_CROSS=$(I386_CROSS) $(WIN32_CROSS) $(ARM_CROSS) $(C67_CROSS) ++else + ifeq ($(ARCH),arm) + NATIVE_FILES=$(ARM_FILES) + PROGS_CROSS=$(I386_CROSS) $(X64_CROSS) $(WIN32_CROSS) $(C67_CROSS) +@@ -106,6 +118,7 @@ + endif + endif + endif ++endif + + ifdef CONFIG_CROSS + PROGS+=$(PROGS_CROSS) +@@ -210,8 +223,10 @@ $(INSTALL) -m644 $(BCHECK_O) "$(tccdir)" endif $(INSTALL) -m644 $(addprefix include/,$(TCC_INCLUDES)) "$(tccdir)/include" diff --git a/lang/tcc/files/patch-configure b/lang/tcc/files/patch-configure new file mode 100644 index 000000000000..15d6f7241aca --- /dev/null +++ b/lang/tcc/files/patch-configure @@ -0,0 +1,12 @@ +--- configure.orig 2009-05-18 16:27:06.000000000 +0200 ++++ configure 2009-07-03 07:32:51.000000000 +0200 +@@ -38,6 +38,9 @@ + i386|i486|i586|i686|i86pc|BePC) + cpu="x86" + ;; ++ amd64) ++ cpu="x86-64" ++ ;; + x86_64) + cpu="x86-64" + ;; diff --git a/lang/tcc/files/patch-libtcc.c b/lang/tcc/files/patch-libtcc.c new file mode 100644 index 000000000000..9c514b3dcfc7 --- /dev/null +++ b/lang/tcc/files/patch-libtcc.c @@ -0,0 +1,21 @@ +--- libtcc.c.orig 2009-05-18 16:27:06.000000000 +0200 ++++ libtcc.c 2009-07-03 07:51:05.000000000 +0200 +@@ -1509,10 +1509,18 @@ + + if (level == 0) { + /* XXX: only support linux */ ++#if defined(__FreeBSD__) ++ *paddr = uc->uc_mcontext.mc_rip; ++#else + *paddr = uc->uc_mcontext.gregs[REG_RIP]; ++#endif + return 0; + } else { ++#if defined(__FreeBSD__) ++ fp = uc->uc_mcontext.mc_rbp; ++#else + fp = uc->uc_mcontext.gregs[REG_RBP]; ++#endif + for(i=1;i