diff options
author | marino <marino@pkgsrc.org> | 2014-05-09 09:50:47 +0000 |
---|---|---|
committer | marino <marino@pkgsrc.org> | 2014-05-09 09:50:47 +0000 |
commit | 795893c98040ea5dfd69f68ba135684f7e4d21bc (patch) | |
tree | 5ff6e9bb8a2ff3b42ba22ae26fb78f9134a1db80 /lang/gcc-aux | |
parent | b4023680773248dfb88b7c4a4ab9780491ce0fa3 (diff) | |
download | pkgsrc-795893c98040ea5dfd69f68ba135684f7e4d21bc.tar.gz |
lang/gcc-aux: Primarily add Solaris i386 and x86_64 targets
I was never able to build gcc-aux with multilib support when it was
based on gcc 4.7. It turns out that this is because Ada support for
multilib was broken per GCC's bugzilla. It's been fixed since. After
some significant effort and many hours, I finally produced a multilib
bootstrap for Solaris. It can produce other multilib compilers (x86-64)
and it can produce 32-bit only compilers (i386). This was tested on a
stock OmniOS x86-64 installation and the Joyent dev area (i386).
Solaris has not supported static linking since Solaris 9, so it is not
possible to create a static bootstrap like the BSDs have, nor is it
possible to build the compiler statically, so that option is disabled.
That means it is unlikely that the bootstrap will run on Solaris 10 or
Solaris 11, but this theory has not been tested.
Much of the changes to the diff-* patchsets are a result of OpenBSD work.
An OpenBSD static bootstrap has been created against devel/binutils, and
as a result it fails to find system libraries such as libc and libm. That
is a side note explaining the OpenBSD additions. There are some DragonFly
and NetBSD changes in the diff-* patches though.
The bootstrap target was significantly modified, mainly to capture the
special needs of creating a Solaris bootstrap. The creation of the
bootstrap tarball was put in it's own target. The zlib and math libraries
were connected to the bootstrap option. It's not a good idea to use
system zlib on Illumos because the zlib header is not guaranteed to be
installed.
The feature to rebuild the compiler with the installed gcc-aux was fixed;
it should use it's own c++ compiler instead of the system c++ compiler.
OpenBSD 5.5 does not support "cp -a", so this was changed to "cp -RpP" for
portability reasons.
Diffstat (limited to 'lang/gcc-aux')
-rw-r--r-- | lang/gcc-aux/Makefile | 88 | ||||
-rw-r--r-- | lang/gcc-aux/distinfo | 8 | ||||
-rw-r--r-- | lang/gcc-aux/files/diff-ada | 39 | ||||
-rw-r--r-- | lang/gcc-aux/files/diff-core | 114 | ||||
-rw-r--r-- | lang/gcc-aux/files/diff-cxx | 15 | ||||
-rw-r--r-- | lang/gcc-aux/options.mk | 31 |
6 files changed, 222 insertions, 73 deletions
diff --git a/lang/gcc-aux/Makefile b/lang/gcc-aux/Makefile index 598fe53f1ea..0a86d785c72 100644 --- a/lang/gcc-aux/Makefile +++ b/lang/gcc-aux/Makefile @@ -1,8 +1,9 @@ -# $NetBSD: Makefile,v 1.17 2014/05/02 15:54:16 marino Exp $ +# $NetBSD: Makefile,v 1.18 2014/05/09 09:50:47 marino Exp $ # PKGNAME= gcc-aux-${SNAPSHOT} DISTNAME= gcc-${GCC_VERSION} +PKGREVISION= 1 CATEGORIES= lang MASTER_SITES= ${MASTER_SITE_GNU:=gcc/gcc-${GCC_VERSION}/} DISTFILES= ${DISTNAME}.tar.bz2 @@ -28,10 +29,13 @@ ONLY_FOR_PLATFORM= DragonFly-*-* \ FreeBSD-*-i386 \ FreeBSD-*-x86_64 \ NetBSD-[5-9]*-i386 \ - NetBSD-[5-9]*-x86_64 - -# SunOS-5.1[1-9]*-i386 -# gnat-bootstrap.i386.solaris.tar.bz2 + NetBSD-[5-9]*-x86_64 \ + SunOS-5.1[1-9]*-i386 \ + SunOS-5.1[1-9]*-x86_64 +# OpenBSD-*-amd64 +# OpenBSD-*-i386 +# MirBSD-*-amd64 +# MirBSD-*-i386 GARCH= ${MACHINE_ARCH:S/amd64/x86_64/} BLD_TARGET= ${GARCH}-aux-${LOWER_OPSYS}${OS_VERSION} @@ -52,7 +56,7 @@ BOOTSTRAP_COMPILER= ada-bootstrap.${GARCH}.freebsd.100B.tar.bz2 . endif .endif -.if ${OPSYS} == "NetBSD" +.if ${OPSYS} == NetBSD .if !empty(OS_VERSION:M6.99.*) NSUFF= 7.0_DEV .else @@ -61,28 +65,43 @@ BOOTSTRAP_COMPILER= ada-bootstrap.${GARCH}.freebsd.100B.tar.bz2 .if ${GARCH} == i386 NELF= elf .endif +XLDF= -lm BOOTSTRAP_COMPILER= ada-bootstrap.${GARCH}.netbsd.614.tar.bz2 BLD_TARGET= ${MACHINE_ARCH}-aux-netbsd${NELF}${NSUFF} .endif -.if ${OPSYS} == "SunOS" -BOOTSTRAP_TRIPLET= i386-bootstrap-solaris5.11/4.6.1 -SOL_OSV= `expr substr ${OS_VERSION} 3 2` +.if ${OPSYS} == SunOS +SOL_OSV!= expr substr ${OS_VERSION} 3 2 BLD_TARGET= ${MACHINE_ARCH}-aux-${LOWER_OPSYS}2.${SOL_OSV} -BOOTSTRAP_COMPILER= gnat-bootstrap.${MACHINE_ARCH}.solaris.tar.bz2 +BOOTSTRAP_COMPILER= ada-bootstrap.x86_64.solaris.511.tar.bz2 +. if ${ABI} == 64 +EXTRA_CONFARGS+= --enable-multilib +. else +COMPILER_ABI_SWITCH= -m32 +. endif +MY_CONFIGURE_ENV+= OBJDUMP=${PREFIX}/bin/gobjdump +MODERN_BINUTILS=x yes +NATIVE_LINKER!= which ld +.endif + +.if ${OPSYS} == OpenBSD || ${OPSYS} == MirBSD MODERN_BINUTILS= yes .endif .if defined(MODERN_BINUTILS) BUILDLINK_DEPMETHOD.binutils= full .include "../../devel/binutils/buildlink3.mk" -EXTRA_CONFARGS+= --with-gnu-ld --with-ld=${PREFIX}/bin/gld EXTRA_CONFARGS+= --with-gnu-as --with-as=${PREFIX}/bin/gas MY_CONFIGURE_ENV+= AR=${PREFIX}/bin/gar MY_CONFIGURE_ENV+= AS=${PREFIX}/bin/gas -MY_CONFIGURE_ENV+= LD=${PREFIX}/bin/gld MY_CONFIGURE_ENV+= NM=${PREFIX}/bin/gnm MY_CONFIGURE_ENV+= RANLIB=${PREFIX}/bin/granlib +. if defined(NATIVE_LINKER) +EXTRA_CONFARGS+= --without-gnu-ld --with-ld=${NATIVE_LINKER} +. else +EXTRA_CONFARGS+= --with-gnu-ld --with-ld=${PREFIX}/bin/gld +MY_CONFIGURE_ENV+= LD=${PREFIX}/bin/gld +. endif .else EXTRA_CONFARGS+= --with-gnu-ld --with-ld=/usr/bin/ld EXTRA_CONFARGS+= --with-gnu-as --with-as=/usr/bin/as @@ -104,6 +123,7 @@ BSFILENAME= ada-bootstrap.${GARCH}.${LOWER_OPSYS}.${OS_VERSION:C/[A-Z_.-]//g}.t # its gnatlink, gnatbind, and gnatmake rather than the older bootstrap versions .if exists(${LOCALBASE}/gcc-aux/bin/ada) FULL_GNATGCC=${LOCALBASE}/gcc-aux/bin/ada +FULL_GNATGXX=${LOCALBASE}/gcc-aux/bin/g++ .endif @@ -112,8 +132,8 @@ FULL_GNATGCC=${LOCALBASE}/gcc-aux/bin/ada . if defined(BOOTSTRAP_TRIPLET) FULL_GNATGCC=${BOOTSTRAP_PREFIX}/bin/gnatgcc . else -FULL_GNATGCC=${BOOTSTRAP_PREFIX}/bin/gcc -FULL_GNATGXX=${BOOTSTRAP_PREFIX}/bin/g++ +FULL_GNATGCC=${BOOTSTRAP_PREFIX}/bin/gcc ${COMPILER_ABI_SWITCH} +FULL_GNATGXX=${BOOTSTRAP_PREFIX}/bin/g++ ${COMPILER_ABI_SWITCH} . endif DISTFILES+= ${BOOTSTRAP_COMPILER} SITES.${BOOTSTRAP_COMPILER}= http://downloads.dragonlace.net/src/ @@ -134,15 +154,16 @@ DISTFILES= \ ada-bootstrap.x86_64.dragonfly.36A.tar.bz2 \ ada-bootstrap.x86_64.freebsd.84.tar.bz2 \ ada-bootstrap.x86_64.freebsd.100B.tar.bz2 \ - ada-bootstrap.x86_64.netbsd.614.tar.bz2 + ada-bootstrap.x86_64.netbsd.614.tar.bz2 \ + ada-bootstrap.x86_64.openbsd.55.tar.bz2 \ + ada-bootstrap.x86_64.solaris.511.tar.bz2 .endif - # establish ada-aware compiler for use -MY_CONFIGURE_ENV+= CC=${FULL_GNATGCC} -MY_CONFIGURE_ENV+= CXX=${FULL_GNATGXX} +MY_CONFIGURE_ENV+= CC=${FULL_GNATGCC:Q} +MY_CONFIGURE_ENV+= CXX=${FULL_GNATGXX:Q} MY_CONFIGURE_ENV+= PATH=${FULL_PATH} -MY_CONFIGURE_ENV+= LDFLAGS="-lm ${COMPILER_RPATH_FLAG}${PREFIX}/lib" +MY_CONFIGURE_ENV+= LDFLAGS="${XLDF} ${COMPILER_RPATH_FLAG}${PREFIX}/lib" MY_MAKE_ENV+= PATH=${FULL_PATH} MY_MAKE_ENV+= LD_LIBRARY_PATH=${BUILDDIR}/gcc${EXTRA_LLP} # ${WRKSRC}/fixincludes/ looks for sed and compiles the path to sed into @@ -156,10 +177,6 @@ MY_MAKE_ENV+= lt_cv_path_SED=${TOOLS_SED} CONFIGURE_ARGS= --enable-languages=${LANGS:Q} CONFIGURE_ARGS+= --build=${BLD_TARGET} CONFIGURE_ARGS+= --prefix=${PKG_PREFIX:Q} -CONFIGURE_ARGS+= --with-system-zlib -CONFIGURE_ARGS+= --with-gmp=${BUILDLINK_PREFIX.gmp} -CONFIGURE_ARGS+= --with-mpfr=${BUILDLINK_PREFIX.mpfr} -CONFIGURE_ARGS+= --with-mpc=${BUILDLINK_PREFIX.mpcomplex} CONFIGURE_ARGS+= --enable-threads=posix CONFIGURE_ARGS+= --disable-libmudflap CONFIGURE_ARGS+= --disable-libgomp @@ -193,10 +210,20 @@ post-extract: -pe 's|es_MX|es_ES|g;' \ -pe 's|ru_RU.UTF8|ru_RU.UTF-8|g' ${LOCALE22FIX}) .if !empty(PKG_OPTIONS:Mstatic) || !empty(PKG_OPTIONS:Mbootstrap) +. if ${OPSYS} != SunOS # Ensure GNAT tools are built statically ${PERL5} -pi -e 's/^GCC_LINK_FLAGS=.*/GCC_LINK_FLAGS=-static/' \ ${WRKSRC}/gcc/ada/gcc-interface/Makefile.in +. endif +.endif +.if !exists(${LOCALBASE}/gcc-aux/bin/ada) && ${OPSYS} == SunOS + # In case /usr/pkg/bin/gas doesn't exist, establish fallback + ${LN} -s ${PREFIX}/bin/gas ${BOOTSTRAP_PREFIX}/bin/as .endif + # Illumos /usr/ccs binaries are symlinked to /usr/bin + # elfdump was present on OmniOS but not in Joyent dev area + ${PERL5} -i -pe 's|/usr/ccs/bin|/usr/bin|g;' \ + -pe 's|readelf -s|greadelf -s|' ${WRKSRC}/contrib/make_sunver.pl # Update LINK_SPEC to add gcc-aux lib runpath in every binary @${ECHO} "Configuring LINK_SPEC runpath" ${PERL5} -pi -e 's;\@PREFIX\@;${PREFIX};' \ @@ -234,7 +261,7 @@ do-build: do-test: build test-ada test-fortran test-objc test-cxx test-c test-ada: -.if (${OPSYS} == "NetBSD") && (${MACHINE_ARCH} == "x86_64") +.if (${OPSYS} == NetBSD) && (${MACHINE_ARCH} == x86_64) # NetBSD has an extremely small default stacksize of 2MB, which is # insufficient for the gnat.dg testsuite. # specifically: entry_queues test on AMD64 @@ -270,19 +297,18 @@ do-install: cd ${BUILDDIR} && ${SETENV} ${MY_MAKE_ENV} ${GMAKE} install-strip \ DESTDIR=${DESTDIR} ${MV} ${DESTDIR}${PKG_PREFIX}/share ${WRKDIR}/moved_share + .if !empty(PKG_OPTIONS:Mbootstrap) +create-bootstrap: stage-install ${MKDIR} ${NEWBSDIR} - ${CP} -a ${DESTDIR}${PKG_PREFIX}/bin ${NEWBSDIR}/ - ${CP} -a ${DESTDIR}${PKG_PREFIX}/lib ${NEWBSDIR}/ - ${CP} -a ${DESTDIR}${PKG_PREFIX}/include ${NEWBSDIR}/ - ${CP} -a ${DESTDIR}${PKG_PREFIX}/libexec ${NEWBSDIR}/ + ${CP} -RpP ${DESTDIR}${PKG_PREFIX}/bin ${NEWBSDIR}/ + ${CP} -RpP ${DESTDIR}${PKG_PREFIX}/lib ${NEWBSDIR}/ + ${CP} -RpP ${DESTDIR}${PKG_PREFIX}/include ${NEWBSDIR}/ + ${CP} -RpP ${DESTDIR}${PKG_PREFIX}/libexec ${NEWBSDIR}/ ${RM} ${NEWBSDIR}/bin/${GARCH}* ${RM} -rf ${NEWBSDIR}/lib/gcc/${BLD_TARGET}/${GCC_VERSION}/include-fixed (cd ${NEWBSDIR}/.. ; \ ${TAR} -cf ${BSFILENAME} bootstrap; ${BZIP2} ${BSFILENAME}) .endif -.include "../../devel/gmp/buildlink3.mk" -.include "../../math/mpfr/buildlink3.mk" -.include "../../math/mpcomplex/buildlink3.mk" .include "../../mk/bsd.pkg.mk" diff --git a/lang/gcc-aux/distinfo b/lang/gcc-aux/distinfo index e0330feb76a..46836f8309c 100644 --- a/lang/gcc-aux/distinfo +++ b/lang/gcc-aux/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.7 2014/04/30 16:24:39 marino Exp $ +$NetBSD: distinfo,v 1.8 2014/05/09 09:50:47 marino Exp $ SHA1 (ada-bootstrap.i386.dragonfly.36A.tar.bz2) = 7e0725889ae752e6a9fdbac5b1d2ef0e3f62822e RMD160 (ada-bootstrap.i386.dragonfly.36A.tar.bz2) = f62c00515588804ce69368507822f30380d7e48d @@ -24,6 +24,12 @@ Size (ada-bootstrap.x86_64.freebsd.84.tar.bz2) = 40227668 bytes SHA1 (ada-bootstrap.x86_64.netbsd.614.tar.bz2) = 683f58e6e394a508a52ec1dc5f3d9ca2869d5252 RMD160 (ada-bootstrap.x86_64.netbsd.614.tar.bz2) = 4574857089e82fb80725161cc8b625ce75f6810e Size (ada-bootstrap.x86_64.netbsd.614.tar.bz2) = 39348972 bytes +SHA1 (ada-bootstrap.x86_64.openbsd.55.tar.bz2) = 18ee97939bd95e70cfc5773eb4cfb075f22e50e6 +RMD160 (ada-bootstrap.x86_64.openbsd.55.tar.bz2) = 8563f665f52e13ae4a379ae71a183bb01470fb78 +Size (ada-bootstrap.x86_64.openbsd.55.tar.bz2) = 38753186 bytes +SHA1 (ada-bootstrap.x86_64.solaris.511.tar.bz2) = abb16c1582e2a6ffe37df4afd96d04c44f2eea7b +RMD160 (ada-bootstrap.x86_64.solaris.511.tar.bz2) = 41677e2fd0cb02c89f200fb97b112ad3be7f19cd +Size (ada-bootstrap.x86_64.solaris.511.tar.bz2) = 60110383 bytes SHA1 (gcc-4.9.0.tar.bz2) = fbde8eb49f2b9e6961a870887cf7337d31cd4917 RMD160 (gcc-4.9.0.tar.bz2) = ac561660744127fa009ae75202d1ac81ac8d7668 Size (gcc-4.9.0.tar.bz2) = 89677407 bytes diff --git a/lang/gcc-aux/files/diff-ada b/lang/gcc-aux/files/diff-ada index 5d65a860e1e..6ee0ad37559 100644 --- a/lang/gcc-aux/files/diff-ada +++ b/lang/gcc-aux/files/diff-ada @@ -6994,7 +6994,7 @@ || defined (__GLIBC__) || defined (__APPLE__) eof_ch = termios_rec.c_cc[VEOF]; -@@ -853,8 +856,11 @@ +@@ -853,8 +856,12 @@ /* Darwin, Free BSD, Linux, where component tm_gmtoff is present in struct tm */ @@ -7003,6 +7003,7 @@ +#elif defined (__APPLE__) \ + || defined (__DragonFly__) \ + || defined (__FreeBSD__) \ ++ || defined (__OpenBSD__) \ + || defined (linux) \ + || defined (__GLIBC__) { @@ -7010,7 +7011,7 @@ *off = tp.tm_gmtoff; --- /dev/null +++ gcc/ada/system-dragonfly-x86.ads -@@ -0,0 +1,143 @@ +@@ -0,0 +1,144 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT RUN-TIME COMPONENTS -- @@ -7145,6 +7146,7 @@ + Stack_Check_Probes : constant Boolean := True; + Stack_Check_Limits : constant Boolean := False; + Support_Aggregates : constant Boolean := True; ++ Support_Atomic_Primitives : constant Boolean := True; + Support_Composite_Assign : constant Boolean := True; + Support_Composite_Compare : constant Boolean := True; + Support_Long_Shifts : constant Boolean := True; @@ -7156,7 +7158,7 @@ +end System; --- /dev/null +++ gcc/ada/system-dragonfly-x86_64.ads -@@ -0,0 +1,143 @@ +@@ -0,0 +1,144 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT RUN-TIME COMPONENTS -- @@ -7291,6 +7293,7 @@ + Stack_Check_Probes : constant Boolean := True; + Stack_Check_Limits : constant Boolean := False; + Support_Aggregates : constant Boolean := True; ++ Support_Atomic_Primitives : constant Boolean := True; + Support_Composite_Assign : constant Boolean := True; + Support_Composite_Compare : constant Boolean := True; + Support_Long_Shifts : constant Boolean := True; @@ -7302,7 +7305,7 @@ +end System; --- /dev/null +++ gcc/ada/system-netbsd-x86.ads -@@ -0,0 +1,143 @@ +@@ -0,0 +1,144 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT RUN-TIME COMPONENTS -- @@ -7437,6 +7440,7 @@ + Stack_Check_Probes : constant Boolean := True; + Stack_Check_Limits : constant Boolean := False; + Support_Aggregates : constant Boolean := True; ++ Support_Atomic_Primitives : constant Boolean := True; + Support_Composite_Assign : constant Boolean := True; + Support_Composite_Compare : constant Boolean := True; + Support_Long_Shifts : constant Boolean := True; @@ -7448,7 +7452,7 @@ +end System; --- /dev/null +++ gcc/ada/system-netbsd-x86_64.ads -@@ -0,0 +1,143 @@ +@@ -0,0 +1,144 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT RUN-TIME COMPONENTS -- @@ -7583,6 +7587,7 @@ + Stack_Check_Probes : constant Boolean := True; + Stack_Check_Limits : constant Boolean := False; + Support_Aggregates : constant Boolean := True; ++ Support_Atomic_Primitives : constant Boolean := True; + Support_Composite_Assign : constant Boolean := True; + Support_Composite_Compare : constant Boolean := True; + Support_Long_Shifts : constant Boolean := True; @@ -7594,7 +7599,7 @@ +end System; --- /dev/null +++ gcc/ada/system-openbsd-x86.ads -@@ -0,0 +1,143 @@ +@@ -0,0 +1,144 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT RUN-TIME COMPONENTS -- @@ -7604,7 +7609,7 @@ +-- S p e c -- +-- (OpenBSD/x86 Version) -- +-- -- -+-- Copyright (C) 1992-2011, Free Software Foundation, Inc. -- ++-- Copyright (C) 1992-2012, Free Software Foundation, Inc. -- +-- -- +-- This specification is derived from the Ada Reference Manual for use with -- +-- GNAT. The copyright notice above, and the license provisions that follow -- @@ -7729,18 +7734,19 @@ + Stack_Check_Probes : constant Boolean := True; + Stack_Check_Limits : constant Boolean := False; + Support_Aggregates : constant Boolean := True; ++ Support_Atomic_Primitives : constant Boolean := True; + Support_Composite_Assign : constant Boolean := True; + Support_Composite_Compare : constant Boolean := True; + Support_Long_Shifts : constant Boolean := True; -+ Always_Compatible_Rep : constant Boolean := True; ++ Always_Compatible_Rep : constant Boolean := False; + Suppress_Standard_Library : constant Boolean := False; + Use_Ada_Main_Program_Name : constant Boolean := False; -+ ZCX_By_Default : constant Boolean := False; ++ ZCX_By_Default : constant Boolean := True; + +end System; --- /dev/null +++ gcc/ada/system-openbsd-x86_64.ads -@@ -0,0 +1,143 @@ +@@ -0,0 +1,144 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT RUN-TIME COMPONENTS -- @@ -7748,9 +7754,9 @@ +-- S Y S T E M -- +-- -- +-- S p e c -- -+-- (OpenBSD/x86_64 Version) -- ++-- (OpenBSD/x86_64 Version) -- +-- -- -+-- Copyright (C) 1992-2011, Free Software Foundation, Inc. -- ++-- Copyright (C) 1992-2012, Free Software Foundation, Inc. -- +-- -- +-- This specification is derived from the Ada Reference Manual for use with -- +-- GNAT. The copyright notice above, and the license provisions that follow -- @@ -7875,13 +7881,14 @@ + Stack_Check_Probes : constant Boolean := True; + Stack_Check_Limits : constant Boolean := False; + Support_Aggregates : constant Boolean := True; ++ Support_Atomic_Primitives : constant Boolean := True; + Support_Composite_Assign : constant Boolean := True; + Support_Composite_Compare : constant Boolean := True; + Support_Long_Shifts : constant Boolean := True; -+ Always_Compatible_Rep : constant Boolean := True; ++ Always_Compatible_Rep : constant Boolean := False; + Suppress_Standard_Library : constant Boolean := False; + Use_Ada_Main_Program_Name : constant Boolean := False; -+ ZCX_By_Default : constant Boolean := False; ++ ZCX_By_Default : constant Boolean := True; + +end System; --- gcc/ada/terminals.c.orig @@ -8365,9 +8372,9 @@ + EXTRA_GNATRTL_NONTASKING_OBJS=g-sse.o g-ssvety.o + EXTRA_GNATRTL_TASKING_OBJS=a-exetim.o + -+ EH_MECHANISM= ++ EH_MECHANISM=-gcc + THREADSLIB= -lpthread -+ GMEM_LIB = ++ GMEM_LIB = gmemlib + LIBRARY_VERSION := $(LIB_VERSION) + MISCLIB = -lutil +endif diff --git a/lang/gcc-aux/files/diff-core b/lang/gcc-aux/files/diff-core index 4a8f1d90dbf..e4c7ddf44a4 100644 --- a/lang/gcc-aux/files/diff-core +++ b/lang/gcc-aux/files/diff-core @@ -1,3 +1,7 @@ +--- gcc/DEV-PHASE.orig ++++ gcc/DEV-PHASE +@@ -0,0 +1 @@ ++release --- /dev/null +++ gcc/config/dragonfly-stdint.h @@ -0,0 +1,56 @@ @@ -323,6 +327,49 @@ + +#define INTPTR_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "int") +#define UINTPTR_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "unsigned int") +--- gcc/config/openbsd-libpthread.h.orig ++++ gcc/config/openbsd-libpthread.h +@@ -18,5 +18,5 @@ + along with GCC; see the file COPYING3. If not see + <http://www.gnu.org/licenses/>. */ + +-#define OBSD_LIB_SPEC "%{!shared:%{pthread:-lpthread} -lc}" ++#define OBSD_LIB_SPEC "%{pthread:-lpthread%{!shared:%{p|pg:_p}}} %{!shared:-lc%{p:_p}%{!p:%{pg:_p}}}" + +--- gcc/config/openbsd.h.orig ++++ gcc/config/openbsd.h +@@ -108,9 +108,9 @@ + This two-stage defines makes it easy to pick that for targets that + have subspecs. */ + #ifdef CPP_CPU_SPEC +-#define OBSD_CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}" ++#define OBSD_CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}" + #else +-#define OBSD_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}" ++#define OBSD_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}" + #endif + + #undef LIB_SPEC +@@ -285,5 +285,9 @@ + + /* Storage layout. */ + ++/* The system headers on OpenBSD are C++-aware. */ ++#undef NO_IMPLICIT_EXTERN_C ++#define NO_IMPLICIT_EXTERN_C ++ + + #define HAVE_ENABLE_EXECUTE_STACK +--- gcc/config/openbsd.opt.orig ++++ gcc/config/openbsd.opt +@@ -32,4 +32,7 @@ + pthread + Driver + ++rdynamic ++Driver ++ + ; This comment is to ensure we retain the blank line above. --- /dev/null +++ gcc/config/i386/dragonfly.h @@ -0,0 +1,105 @@ @@ -505,9 +552,49 @@ +#if defined(HAVE_LD_EH_FRAME_HDR) +#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " +#endif +--- gcc/config/i386/openbsd.h.orig ++++ gcc/config/i386/openbsd.h +@@ -38,10 +38,10 @@ + + /* This must agree with <machine/ansi.h> */ + #undef SIZE_TYPE +-#define SIZE_TYPE "unsigned int" ++#define SIZE_TYPE "long unsigned int" + + #undef PTRDIFF_TYPE +-#define PTRDIFF_TYPE "int" ++#define PTRDIFF_TYPE "long int" + + #undef WCHAR_TYPE + #define WCHAR_TYPE "int" +@@ -49,6 +49,9 @@ + #undef WCHAR_TYPE_SIZE + #define WCHAR_TYPE_SIZE 32 + ++#undef WINT_TYPE ++#define WINT_TYPE "int" ++ + /* Assembler format: overall framework. */ + + #undef ASM_APP_ON +--- gcc/config/i386/openbsdelf.h.orig ++++ gcc/config/i386/openbsdelf.h +@@ -97,9 +97,12 @@ + %{shared:-shared} %{R*} \ + %{static:-Bstatic} \ + %{!static:-Bdynamic} \ ++ %{rdynamic:-export-dynamic} \ + %{assert*} \ + -dynamic-linker /usr/libexec/ld.so" + ++#define SUBTARGET32_DEFAULT_CPU "i486" ++ + #undef STARTFILE_SPEC + #define STARTFILE_SPEC "\ + %{!shared: %{pg:gcrt0%O%s} %{!pg:%{p:gcrt0%O%s} %{!p:crt0%O%s}} \ --- gcc/ginclude/stddef.h.orig +++ gcc/ginclude/stddef.h -@@ -50,12 +50,21 @@ +@@ -50,6 +50,11 @@ one less case to deal with in the following. */ #if defined (__BSD_NET2__) || defined (____386BSD____) || (defined (__FreeBSD__) && (__FreeBSD__ < 5)) || defined(__NetBSD__) #include <machine/ansi.h> @@ -519,17 +606,7 @@ #endif /* On FreeBSD 5, machine/ansi.h does not exist anymore... */ #if defined (__FreeBSD__) && (__FreeBSD__ >= 5) - #include <sys/_types.h> - #endif - -+#if defined(__DragonFly__) -+#include <sys/types.h> -+#endif -+ - /* In 4.3bsd-net2, machine/ansi.h defines these symbols, which are - defined if the corresponding type is *not* defined. - FreeBSD-2.1 defines _MACHINE_ANSI_H_ instead of _ANSI_H_. -@@ -133,6 +142,7 @@ +@@ -133,6 +138,7 @@ #ifndef _BSD_PTRDIFF_T_ #ifndef ___int_ptrdiff_t_h #ifndef _GCC_PTRDIFF_T @@ -537,7 +614,7 @@ #define _PTRDIFF_T #define _T_PTRDIFF_ #define _T_PTRDIFF -@@ -141,10 +151,12 @@ +@@ -141,10 +147,12 @@ #define _BSD_PTRDIFF_T_ #define ___int_ptrdiff_t_h #define _GCC_PTRDIFF_T @@ -550,7 +627,7 @@ #endif /* _GCC_PTRDIFF_T */ #endif /* ___int_ptrdiff_t_h */ #endif /* _BSD_PTRDIFF_T_ */ -@@ -198,6 +210,7 @@ +@@ -198,6 +206,7 @@ #define _GCC_SIZE_T #define _SIZET_ #if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \ @@ -558,15 +635,6 @@ || defined(__FreeBSD_kernel__) /* __size_t is a typedef on FreeBSD 5, must not trash it. */ #elif defined (__VMS__) -@@ -306,7 +319,7 @@ - /* FreeBSD 5 can't be handled well using "traditional" logic above - since it no longer defines _BSD_RUNE_T_ yet still desires to export - rune_t in some cases... */ --#if defined (__FreeBSD__) && (__FreeBSD__ >= 5) -+#if defined (__DragonFly__) || (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) - #if !defined (_ANSI_SOURCE) && !defined (_POSIX_SOURCE) - #if __BSD_VISIBLE - #ifndef _RUNE_T_DECLARED --- include/libiberty.h.orig +++ include/libiberty.h @@ -106,7 +106,16 @@ diff --git a/lang/gcc-aux/files/diff-cxx b/lang/gcc-aux/files/diff-cxx index 29ed481a78e..9e709e19055 100644 --- a/lang/gcc-aux/files/diff-cxx +++ b/lang/gcc-aux/files/diff-cxx @@ -1049,6 +1049,21 @@ return __high; } +--- libstdc++-v3/config/os/bsd/openbsd/os_defines.h.orig ++++ libstdc++-v3/config/os/bsd/openbsd/os_defines.h +@@ -38,4 +38,12 @@ + #define _GLIBCXX_USE_C99_FLOAT_TRANSCENDENTALS_DYNAMIC _GLIBCXX_USE_C99_DYNAMIC + #define _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC _GLIBCXX_USE_C99_DYNAMIC + ++/* max_align_t is defined in ginclude/stddef.h which OpenBSD intentionally ++ excludes. Bringing the definition here fixes the libstdc++ build. */ ++ ++typedef struct { ++ long long __max_align_ll __attribute__((__aligned__(__alignof__(long long)))); ++ long double __max_align_ld __attribute__((__aligned__(__alignof__(long double)))); ++} max_align_t; ++ + #endif --- libstdc++-v3/acinclude.m4.orig +++ libstdc++-v3/acinclude.m4 @@ -1989,6 +1989,9 @@ diff --git a/lang/gcc-aux/options.mk b/lang/gcc-aux/options.mk index 6812c4ceeca..6598fe67e32 100644 --- a/lang/gcc-aux/options.mk +++ b/lang/gcc-aux/options.mk @@ -1,4 +1,4 @@ -# $NetBSD: options.mk,v 1.2 2014/04/30 16:24:39 marino Exp $ +# $NetBSD: options.mk,v 1.3 2014/05/09 09:50:47 marino Exp $ PKG_OPTIONS_VAR= PKG_OPTIONS.gcc-aux PKG_SUPPORTED_OPTIONS= fortran objc testsuite nls static bootstrap @@ -20,7 +20,7 @@ EXTRA_CONFARGS+= --disable-libquadmath .else LANGS+= fortran APPLY_DIFFS+= fortran -.if ${OPSYS} == "NetBSD" +.if ${OPSYS} == NetBSD EXTRA_CONFARGS+= --disable-libquadmath .else EXTRA_CONFARGS+= --enable-libquadmath @@ -72,7 +72,11 @@ EXTRA_CONFARGS+= --disable-nls ############################### .if !empty(PKG_OPTIONS:Mstatic) && empty(PKG_OPTIONS:Mbootstrap) +. if ${OPSYS} == SunOS +PKG_FAIL_REASON+= SunOS does not support static builds +. else EXTRA_CONFARGS+= --with-stage1-ldflags=-static +. endif .endif @@ -80,11 +84,34 @@ EXTRA_CONFARGS+= --with-stage1-ldflags=-static ## BOOTSTRAP COMPILER OPTION ## ################################# +# Solaris does not support static linking, so bootstraps on SunOS require +# gmp&co to be built with gcc. In addition, the multilib-bootstrap compiler +# will choke on the 32ELF gmp&co libraries on i836 targets. It's extra work +# but always rebuilding these libraries solves both issues on SunOS. + +.if ${OPSYS} == SunOS && !empty(PKG_OPTIONS:Mbootstrap) +.include "../../devel/gmp/inplace.mk" +.include "../../math/mpcomplex/inplace.mk" +.include "../../math/mpfr/inplace.mk" +.else +EXTRA_CONFARGS+= --with-gmp=${BUILDLINK_PREFIX.gmp} +EXTRA_CONFARGS+= --with-mpfr=${BUILDLINK_PREFIX.mpfr} +EXTRA_CONFARGS+= --with-mpc=${BUILDLINK_PREFIX.mpcomplex} +.include "../../devel/gmp/buildlink3.mk" +.include "../../math/mpfr/buildlink3.mk" +.include "../../math/mpcomplex/buildlink3.mk" +.endif + .if !empty(PKG_OPTIONS:Mbootstrap) EXTRA_CONFARGS+= --disable-shared --disable-lto +EXTRA_CONFARGS+= --disable-libstdcxx-pch +. if ${OPSYS} != SunOS EXTRA_CONFARGS+= --with-stage1-ldflags=-static EXTRA_CONFARGS+= --with-boot-ldflags=-static +EXTRA_CONFARGS+= --with-system-zlib +. endif .else EXTRA_CONFARGS+= --enable-shared EXTRA_CONFARGS+= --disable-bootstrap + .endif |