This patch lets you build gcj41 for amd64. 1. Boehm-gc build fix by arno@heho.snv.jussieu.fr. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25652 2. Small configure fix. Added files: lang/gcc41/files/patch-boehm-gc lang/gcc41/files/patch-configure Modified files: lang/gcc41/Makefile Index: lang/gcc41/Makefile =================================================================== RCS file: /home/ncvs/ports/lang/gcc41/Makefile,v retrieving revision 1.265 diff -u -r1.265 Makefile --- lang/gcc41/Makefile 14 May 2006 10:05:16 -0000 1.265 +++ lang/gcc41/Makefile 17 May 2006 00:12:33 -0000 @@ -44,7 +44,7 @@ .include -.if ${ARCH} == amd64 || ${ARCH} == ia64 || ${ARCH} == sparc64 +.if ${ARCH} == ia64 || ${ARCH} == sparc64 WITHOUT_JAVA= yes .endif Index: lang/gcc41/files/patch-boehm-gc =================================================================== RCS file: lang/gcc41/files/patch-boehm-gc diff -N lang/gcc41/files/patch-boehm-gc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lang/gcc41/files/patch-boehm-gc 17 May 2006 00:12:33 -0000 @@ -0,0 +1,267 @@ +Index: boehm-gc/include/gc.h +=================================================================== +--- boehm-gc/include/gc.h (revision 109278) ++++ boehm-gc/include/gc.h (working copy) +@@ -532,6 +532,7 @@ + /* gcc knows how to retrieve return address, but we don't know */ + /* how to generate call stacks. */ + # define GC_RETURN_ADDR (GC_word)__builtin_return_address(0) ++# define GC_RETURN_ADDR_PARENT (GC_word)__builtin_return_address(1) + # else + /* Just pass 0 for gcc compatibility. */ + # define GC_RETURN_ADDR 0 +Index: boehm-gc/include/gc_cpp.h +=================================================================== +--- boehm-gc/include/gc_cpp.h (revision 109278) ++++ boehm-gc/include/gc_cpp.h (working copy) +@@ -281,7 +281,7 @@ + else + return GC_MALLOC_UNCOLLECTABLE( size );} + +-inline void* gc::operator new( size_t size, void *p ) { ++inline void* gc::operator new( size_t, void *p ) { + return p;} + + inline void gc::operator delete( void* obj ) { +@@ -299,7 +299,7 @@ + inline void* gc::operator new[]( size_t size, GCPlacement gcp ) { + return gc::operator new( size, gcp );} + +-inline void* gc::operator new[]( size_t size, void *p ) { ++inline void* gc::operator new[]( size_t, void *p ) { + return p;} + + inline void gc::operator delete[]( void* obj ) { +Index: boehm-gc/include/private/gc_priv.h +=================================================================== +--- boehm-gc/include/private/gc_priv.h (revision 109278) ++++ boehm-gc/include/private/gc_priv.h (working copy) +@@ -1955,7 +1955,11 @@ + # if defined(_SIGRTMIN) + # define SIG_SUSPEND _SIGRTMIN + 6 + # else +-# define SIG_SUSPEND SIGRTMIN + 6 ++# if defined(SIGRTMIN) ++# define SIG_SUSPEND SIGRTMIN + 6 ++# else ++# define SIG_SUSPEND SIGUSR1 ++# endif + # endif + # endif + # endif /* !SIG_SUSPEND */ +Index: boehm-gc/include/private/gcconfig.h +=================================================================== +--- boehm-gc/include/private/gcconfig.h (revision 109278) ++++ boehm-gc/include/private/gcconfig.h (working copy) +@@ -326,6 +326,10 @@ + # define X86_64 + # define mach_type_known + # endif ++# if defined(FREEBSD) && defined(__amd64__) ++# define X86_64 ++# define mach_type_known ++# endif + # if defined(bsdi) && (defined(i386) || defined(__i386__)) + # define I386 + # define BSDI +@@ -1859,6 +1863,17 @@ + extern int _end[]; + # define DATAEND (_end) + # endif ++# ifdef FREEBSD ++# define OS_TYPE "FREEBSD" ++# define SIG_SUSPEND SIGUSR1 ++# define SIG_THR_RESTART SIGUSR2 ++# ifdef __ELF__ ++# define DYNAMIC_LOADING ++# endif ++# define HEURISTIC2 ++ extern char etext[]; ++# define SEARCH_FOR_DATA_START ++# endif + # endif + + # ifdef SH4 +@@ -1932,6 +1947,17 @@ + extern char etext[]; + # define SEARCH_FOR_DATA_START + # endif ++# ifdef FREEBSD ++# define OS_TYPE "FREEBSD" ++# define SIG_SUSPEND SIGUSR1 ++# define SIG_THR_RESTART SIGUSR2 ++# ifdef __ELF__ ++# define DYNAMIC_LOADING ++# endif ++# define HEURISTIC2 ++ extern char etext[]; ++# define SEARCH_FOR_DATA_START ++# endif + # endif + + #if defined(LINUX) && defined(USE_MMAP) +Index: boehm-gc/dbg_mlc.c +=================================================================== +--- boehm-gc/dbg_mlc.c (revision 109278) ++++ boehm-gc/dbg_mlc.c (working copy) +@@ -475,6 +475,23 @@ + GC_register_displacement((word)sizeof(oh) + offset); + } + ++#if defined(FREEBSD) ++#include ++static void GC_caller_func_offset(ad, symp, offp) ++const GC_word ad; ++const char **symp; ++int *offp; ++{ ++ Dl_info caller; ++ if (dladdr((const void *)ad, &caller) && caller.dli_sname != NULL) { ++ *symp = caller.dli_sname; ++ *offp = (const char *)ad - (const char *)caller.dli_saddr; ++ } ++} ++#else ++#define GC_caller_func(ad, symp, offp) ++#endif ++ + # ifdef __STDC__ + GC_PTR GC_debug_malloc(size_t lb, GC_EXTRA_PARAMS) + # else +@@ -489,6 +506,13 @@ + { + GC_PTR result = GC_malloc(lb + DEBUG_BYTES); + ++#ifdef GC_ADD_CALLER ++ if (s == NULL) { ++ GC_caller_func_offset(ra, &s, &i); ++ if (s == NULL) ++ s = "unknown"; ++ } ++#endif + if (result == 0) { + GC_err_printf1("GC_debug_malloc(%ld) returning NIL (", + (unsigned long) lb); +@@ -858,6 +882,13 @@ + register size_t old_sz; + register hdr * hhdr; + ++#ifdef GC_ADD_CALLER ++ if (s == NULL) { ++ GC_caller_func_offset(ra, &s, &i); ++ if (s == NULL) ++ s = "unknown"; ++ } ++#endif + if (p == 0) return(GC_debug_malloc(lb, OPT_RA s, i)); + if (base == 0) { + GC_err_printf1( +@@ -1166,7 +1197,11 @@ + } + + #ifdef GC_ADD_CALLER +-# define RA GC_RETURN_ADDR, ++# ifdef GC_RETURN_ADDR_PARENT ++# define RA GC_RETURN_ADDR_PARENT, ++# else ++# define RA GC_RETURN_ADDR, ++# endif + #else + # define RA + #endif +@@ -1174,12 +1209,12 @@ + GC_PTR GC_debug_malloc_replacement(lb) + size_t lb; + { +- return GC_debug_malloc(lb, RA "unknown", 0); ++ return GC_debug_malloc(lb, RA NULL, 0); + } + + GC_PTR GC_debug_realloc_replacement(p, lb) + GC_PTR p; + size_t lb; + { +- return GC_debug_realloc(p, lb, RA "unknown", 0); ++ return GC_debug_realloc(p, lb, RA NULL, 0); + } +Index: boehm-gc/pthread_support.c +=================================================================== +--- boehm-gc/pthread_support.c (revision 109278) ++++ boehm-gc/pthread_support.c (working copy) +@@ -928,6 +928,8 @@ + /* Disable true incremental collection, but generational is OK. */ + GC_time_limit = GC_TIME_UNLIMITED; + } ++ /* If we are using a parallel marker, actually start helper threads. */ ++ if (GC_parallel) start_mark_threads(); + # endif + } + +@@ -944,10 +946,6 @@ + + /* GC_init() calls us back, so set flag first. */ + if (!GC_is_initialized) GC_init(); +- /* If we are using a parallel marker, start the helper threads. */ +-# ifdef PARALLEL_MARK +- if (GC_parallel) start_mark_threads(); +-# endif + /* Initialize thread local free lists if used. */ + # if defined(THREAD_LOCAL_ALLOC) && !defined(DBG_HDRS_ALL) + LOCK(); +@@ -1223,7 +1221,7 @@ + if (!GC_thr_initialized) GC_thr_init(); + # ifdef GC_ASSERTIONS + { +- int stack_size; ++ size_t stack_size; + if (NULL == attr) { + pthread_attr_t my_attr; + pthread_attr_init(&my_attr); +Index: boehm-gc/os_dep.c +=================================================================== +--- boehm-gc/os_dep.c (revision 109278) ++++ boehm-gc/os_dep.c (working copy) +@@ -697,10 +697,10 @@ + # endif + + # if defined(SUNOS5SIGS) || defined(IRIX5) || defined(OSF1) \ +- || defined(HURD) || defined(NETBSD) ++ || defined(HURD) || defined(NETBSD) || defined(FREEBSD) + static struct sigaction old_segv_act; + # if defined(_sigargs) /* !Irix6.x */ || defined(HPUX) \ +- || defined(HURD) || defined(NETBSD) ++ || defined(HURD) || defined(NETBSD) || defined(FREEBSD) + static struct sigaction old_bus_act; + # endif + # else +@@ -715,7 +715,7 @@ + # endif + { + # if defined(SUNOS5SIGS) || defined(IRIX5) \ +- || defined(OSF1) || defined(HURD) || defined(NETBSD) ++ || defined(OSF1) || defined(HURD) || defined(NETBSD) || defined(FREEBSD) + struct sigaction act; + + act.sa_handler = h; +@@ -735,7 +735,7 @@ + # else + (void) sigaction(SIGSEGV, &act, &old_segv_act); + # if defined(IRIX5) && defined(_sigargs) /* Irix 5.x, not 6.x */ \ +- || defined(HPUX) || defined(HURD) || defined(NETBSD) ++ || defined(HPUX) || defined(HURD) || defined(NETBSD) || defined(FREEBSD) + /* Under Irix 5.x or HP/UX, we may get SIGBUS. */ + /* Pthreads doesn't exist under Irix 5.x, so we */ + /* don't have to worry in the threads case. */ +@@ -771,10 +771,10 @@ + void GC_reset_fault_handler() + { + # if defined(SUNOS5SIGS) || defined(IRIX5) \ +- || defined(OSF1) || defined(HURD) || defined(NETBSD) ++ || defined(OSF1) || defined(HURD) || defined(NETBSD) || defined(FREEBSD) + (void) sigaction(SIGSEGV, &old_segv_act, 0); + # if defined(IRIX5) && defined(_sigargs) /* Irix 5.x, not 6.x */ \ +- || defined(HPUX) || defined(HURD) || defined(NETBSD) ++ || defined(HPUX) || defined(HURD) || defined(NETBSD) || defined(FREEBSD) + (void) sigaction(SIGBUS, &old_bus_act, 0); + # endif + # else Index: lang/gcc41/files/patch-configure =================================================================== RCS file: lang/gcc41/files/patch-configure diff -N lang/gcc41/files/patch-configure --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lang/gcc41/files/patch-configure 17 May 2006 00:12:33 -0000 @@ -0,0 +1,10 @@ +--- configure.orig Fri Dec 16 07:57:40 2005 ++++ configure Wed May 3 18:32:50 2006 +@@ -1174,6 +1174,7 @@ + case "${target}" in + i*86-*-*) ;; + alpha*-*-*) ;; ++ x86_64-*-*) ;; + *) + noconfigdirs="$noconfigdirs ${libgcj}" + ;;