1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-20 00:21:35 +00:00

- add experimetal support for new archs

This commit is contained in:
Dirk Meyer 2009-08-21 04:39:28 +00:00
parent f5fbd84513
commit ba5c69b381
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=240007
5 changed files with 89 additions and 5 deletions

View File

@ -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 <bsd.port.mk>
.include <bsd.port.pre.mk>
.if (${ARCH} == i386)
PLIST_SUB+= WITH_I386=""
.else
PLIST_SUB+= WITH_I386="@comment "
.endif
.include <bsd.port.post.mk>

View File

@ -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"

View File

@ -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"
;;

View File

@ -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<level;i++) {
/* XXX: check address validity with program info */
if (fp <= 0x1000)

View File

@ -1,7 +1,7 @@
bin/tcc
include/libtcc.h
lib/libtcc.a
lib/tcc/bcheck.o
%%WITH_I386%%lib/tcc/bcheck.o
lib/tcc/include/float.h
lib/tcc/include/stdarg.h
lib/tcc/include/stdbool.h