This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: Pull alpha*-*-freebsd* configuration from mainline to 3.1 branch
- From: Loren James Rittle <rittle at latour dot rsch dot comm dot mot dot com>
- To: libjava at gcc dot gnu dot org
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sat, 30 Mar 2002 01:17:54 -0600 (CST)
- Subject: PATCH: Pull alpha*-*-freebsd* configuration from mainline to 3.1 branch
- Reply-to: rittle at labs dot mot dot com
I would like permission to transfer the following patches to the 3.1
branch. They allow alpha-*-freebsd* to bootstrap with --enable-libgcj
(such fails without these patches). Test suite results for libjava
look about as good/bad as i386-*-freebsd* (i.e. remaining issues are
orthogonal). I will commit each directory in proper dependency order
as shown. Summary (and exactly how I pulled them into my source tree):
cvs update -j1.19 -j1.20 libffi/configure.in
cvs update -j1.22 -j1.23 libffi/configure
cvs update -j1.11 -j1.12 boehm-gc/include/private/gcconfig.h
cvs update -j1.22 -j1.23 boehm-gc/os_dep.c
cvs update -j1.21 -j1.22 libjava/include/posix-threads.h
cvs update -j1.93 -j1.94 gcc/doc/install.texi
Fully bootstrapped --enable-libgcj configuration on 3.1 branch and
checked with no related regressions on i386-*-freebsd4.5 and
alpha-*-freebsd4.2 (required the manual tweak documented).
alpha-*-freebsd5.0 will also get routine daily testing tonight. My
efforts to kill remaining simple EH issues with this port are ongoing.
Every other language (and library) looks great on these ports thus
this is my only outstanding effort until the 3.1 release.
Thanks,
Loren
Standard FSF patch style:
libffi:
* configure.in: Enable alpha*-*-freebsd*.
* configure: Rebuilt.
boehm-gc:
* include/private/gcconfig.h: Add unified test for FreeBSD.
Support FreeBSD/alpha.
* os_dep.c: Do not include <machine/trap.h> unless available.
(GC_freebsd_stack_base): Fix types.
libjava:
* include/posix-threads.h: Support <.../pal.h> on FreeBSD/alpha.
gcc (self-approved, if all the above are approved for transfer):
* doc/install.texi (*-*-freebsd*): Update.
Index: libffi/configure.in
===================================================================
RCS file: /cvs/gcc/gcc/libffi/configure.in,v
retrieving revision 1.19
diff -c -r1.19 configure.in
*** configure.in 2002/01/31 22:25:31 1.19
--- configure.in 2002/03/29 23:42:14
***************
*** 51,57 ****
sparc*-sun-*) TARGET=SPARC; TARGETDIR=sparc;;
sparc-*-linux*) TARGET=SPARC; TARGETDIR=sparc;;
sparc64-*-linux*) TARGET=SPARC; TARGETDIR=sparc;;
! alpha*-*-linux* | alpha*-*-osf*) TARGET=ALPHA; TARGETDIR=alpha;;
ia64*-*-*) TARGET=IA64; TARGETDIR=ia64;;
m68k-*-linux*) TARGET=M68K; TARGETDIR=m68k;;
powerpc-*-linux* | powerpc-*-sysv*) TARGET=POWERPC; TARGETDIR=powerpc;;
--- 51,57 ----
sparc*-sun-*) TARGET=SPARC; TARGETDIR=sparc;;
sparc-*-linux*) TARGET=SPARC; TARGETDIR=sparc;;
sparc64-*-linux*) TARGET=SPARC; TARGETDIR=sparc;;
! alpha*-*-linux* | alpha*-*-osf* | alpha*-*-freebsd*) TARGET=ALPHA; TARGETDIR=alpha;;
ia64*-*-*) TARGET=IA64; TARGETDIR=ia64;;
m68k-*-linux*) TARGET=M68K; TARGETDIR=m68k;;
powerpc-*-linux* | powerpc-*-sysv*) TARGET=POWERPC; TARGETDIR=powerpc;;
Index: boehm-gc/include/private/gcconfig.h
===================================================================
RCS file: /cvs/gcc/gcc/boehm-gc/include/private/gcconfig.h,v
retrieving revision 1.11
diff -c -r1.11 gcconfig.h
*** gcconfig.h 2002/02/12 04:37:57 1.11
--- gcconfig.h 2002/03/29 23:42:14
***************
*** 38,43 ****
--- 38,48 ----
# define OPENBSD
# endif
+ /* And one for FreeBSD: */
+ # if defined(__FreeBSD__)
+ # define FREEBSD
+ # endif
+
/* Determine the machine type: */
# if defined(__XSCALE__)
# define ARM32
***************
*** 214,220 ****
# endif
# if defined(__alpha) || defined(__alpha__)
# define ALPHA
! # if !defined(LINUX) && !defined(NETBSD) && !defined(OPENBSD)
# define OSF1 /* a.k.a Digital Unix */
# endif
# define mach_type_known
--- 219,225 ----
# endif
# if defined(__alpha) || defined(__alpha__)
# define ALPHA
! # if !defined(LINUX) && !defined(NETBSD) && !defined(OPENBSD) && !defined(FREEBSD)
# define OSF1 /* a.k.a Digital Unix */
# endif
# define mach_type_known
***************
*** 262,270 ****
# define OPENBSD
# define mach_type_known
# endif
! # if defined(__FreeBSD__) && (defined(i386) || defined(__i386__))
# define I386
- # define FREEBSD
# define mach_type_known
# endif
# if defined(__NetBSD__) && (defined(i386) || defined(__i386__))
--- 267,274 ----
# define OPENBSD
# define mach_type_known
# endif
! # if defined(FREEBSD) && (defined(i386) || defined(__i386__))
# define I386
# define mach_type_known
# endif
# if defined(__NetBSD__) && (defined(i386) || defined(__i386__))
***************
*** 1329,1334 ****
--- 1333,1358 ----
# else /* ECOFF, until OpenBSD/Alpha 2.7 */
# define DATASTART ((ptr_t) 0x140000000)
# endif
+ # endif
+ # ifdef FREEBSD
+ # define OS_TYPE "FREEBSD"
+ /* MPROTECT_VDB is not yet supported at all on FreeBSD/alpha. */
+ # define SIG_SUSPEND SIGUSR1
+ # define SIG_THR_RESTART SIGUSR2
+ # define FREEBSD_STACKBOTTOM
+ # ifdef __ELF__
+ # define DYNAMIC_LOADING
+ # endif
+ /* Handle unmapped hole alpha*-*-freebsd[45]* puts between etext and edata. */
+ extern char etext;
+ extern char edata;
+ extern char end;
+ # define NEED_FIND_LIMIT
+ # define DATASTART ((ptr_t)(&etext))
+ # define DATAEND (GC_find_limit (DATASTART, TRUE))
+ # define DATASTART2 ((ptr_t)(&edata))
+ # define DATAEND2 ((ptr_t)(&end))
+ # define CPP_WORDSZ 64
# endif
# ifdef OSF1
# define OS_TYPE "OSF1"
Index: boehm-gc/os_dep.c
===================================================================
RCS file: /cvs/gcc/gcc/boehm-gc/os_dep.c,v
retrieving revision 1.21.2.1
diff -c -r1.21.2.1 os_dep.c
*** os_dep.c 2002/03/12 18:31:11 1.21.2.1
--- os_dep.c 2002/03/29 23:42:15
***************
*** 84,90 ****
# include <setjmp.h>
#endif
! #ifdef FREEBSD
# include <machine/trap.h>
#endif
--- 84,90 ----
# include <setjmp.h>
#endif
! #if defined(FREEBSD) && defined(I386)
# include <machine/trap.h>
#endif
***************
*** 747,760 ****
ptr_t GC_freebsd_stack_base(void)
{
! int nm[2] = { CTL_KERN, KERN_USRSTACK}, base, len, r;
- len = sizeof(int);
- r = sysctl(nm, 2, &base, &len, NULL, 0);
-
if (r) ABORT("Error getting stack base");
! return (ptr_t)base;
}
#endif /* FREEBSD_STACKBOTTOM */
--- 747,760 ----
ptr_t GC_freebsd_stack_base(void)
{
! int nm[2] = {CTL_KERN, KERN_USRSTACK};
! ptr_t base;
! size_t len = sizeof(ptr_t);
! int r = sysctl(nm, 2, &base, &len, NULL, 0);
if (r) ABORT("Error getting stack base");
! return base;
}
#endif /* FREEBSD_STACKBOTTOM */
Index: libjava/include/posix-threads.h
===================================================================
RCS file: /cvs/gcc/gcc/libjava/include/posix-threads.h,v
retrieving revision 1.20.14.1
diff -c -r1.20.14.1 posix-threads.h
*** posix-threads.h 2002/03/10 03:30:50 1.20.14.1
--- posix-threads.h 2002/03/29 23:42:15
***************
*** 244,250 ****
--- 244,255 ----
#ifdef __alpha__
+ #ifdef __FreeBSD__
+ #include <machine/pal.h>
+ #define PAL_rduniq PAL_rdunique
+ #else
#include <asm/pal.h>
+ #endif
typedef unsigned long _Jv_ThreadId_t;
Index: gcc/doc/install.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/install.texi,v
retrieving revision 1.92.2.4
diff -c -r1.92.2.4 install.texi
*** install.texi 2002/03/29 23:32:09 1.92.2.4
--- install.texi 2002/03/29 23:42:15
***************
*** 2046,2052 ****
The version of binutils installed in @file{/usr/bin} is known to work unless
otherwise specified in any per-architecture notes. However, binutils
! 2.11 is known to improve overall testsuite results.
For FreeBSD 1, FreeBSD 2 or any mutant a.out versions of FreeBSD 3: All
configuration support and files as shipped with GCC 2.95 are still in
--- 2046,2052 ----
The version of binutils installed in @file{/usr/bin} is known to work unless
otherwise specified in any per-architecture notes. However, binutils
! 2.11 or greater is known to improve overall testsuite results.
For FreeBSD 1, FreeBSD 2 or any mutant a.out versions of FreeBSD 3: All
configuration support and files as shipped with GCC 2.95 are still in
***************
*** 2064,2073 ****
particular, @option{--enable-threads} is now configured by default.
However, as a general user, do not attempt to replace the system
compiler with this release. Known to bootstrap and check with good
! results on FreeBSD 3.0, 3.4, 4.0, 4.2, 4.3 and 5-CURRENT@.
! At this time, @option{--enable-threads} is not compatible with
! @option{--enable-libgcj} on FreeBSD@.
Shared @file{libgcc_s.so} is now built and installed by default.
--- 2064,2083 ----
particular, @option{--enable-threads} is now configured by default.
However, as a general user, do not attempt to replace the system
compiler with this release. Known to bootstrap and check with good
! results on FreeBSD 3.0, 3.4, 4.0, 4.2, 4.3, 4.4, 4.5-STABLE and 5-CURRENT@.
! In principle, @option{--enable-threads} is now compatible with
! @option{--enable-libgcj} on FreeBSD@. However, it has only been built
! and tested on i386-*-freebsd4.5 and alpha-*-freebsd5.0 and important
! test suite failures remain. Multi-threaded boehm-gc (required for
! libjava) exposes severe threaded signal-handling bugs on FreeBSD before
! 4.5-RELEASE. The alpha port may not fully bootstrap without some manual
! intervention: gcjh will crash with a floating-point exception while
! generating @file{java/lang/Double.h} (just copy the version built on
! i386-*-freebsd* and rerun the top-level gmake with no arguments and it
! should properly complete the bootstrap). Other CPU architectures
! supported by FreeBSD will require additional configuration tuning in, at
! the very least, both boehm-gc and libffi.
Shared @file{libgcc_s.so} is now built and installed by default.