Enable .init_array and .fini_array with xtoolchain GCC.

For base/gcc, only enable .init_array and .fini_array for 12.0 and later
to match the policy used by clang and llvm.  For the xtoolchain ports,
enable these unconditionally since the only OS version handy is the OS
version of the build host, not the target OS to be built.  Unlike llvm,
the use of .init_array and .fini_array is set at compile-time for GCC
and can't be changed at runtime.

Bump PORTREVISION for base/gcc and the xtoolchain GCC ports.

Reviewed by:	bapt (earlier version)
Differential Revision:	https://reviews.freebsd.org/D16014
This commit is contained in:
John Baldwin 2018-07-11 16:50:00 +00:00
parent af3ce47a68
commit 9b66924988
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=474469
2 changed files with 10 additions and 0 deletions

View File

@ -2,6 +2,7 @@
PORTNAME= gcc
PORTVERSION= 6.4.0
PORTREVISION= 1
CATEGORIES= base
MASTER_SITES= GCC/releases/gcc-${DISTVERSION} \
http://www.mpfr.org/mpfr-3.1.6/:mpfr \
@ -61,6 +62,10 @@ INSTALL_TARGET?= install-gcc
.include <bsd.port.pre.mk>
.if ${OSVERSION} >= 1200000
CONFIGURE_ARGS+= --enable-initfini-array
.endif
.if ${ARCH:Mmips*}
PLIST_SUB+= MIPS=""
.else

View File

@ -2,6 +2,7 @@
PORTNAME= gcc
PORTVERSION= 6.4.0
PORTREVISION= 1
CATEGORIES= devel
MASTER_SITES= GCC/releases/gcc-${DISTVERSION}
PKGNAMEPREFIX?= powerpc64-
@ -60,6 +61,10 @@ CFLAGS+= -DCROSS_DIRECTORY_STRUCTURE
.include <bsd.port.options.mk>
.include <bsd.port.pre.mk>
.if ${GCC_TARGET:M*${OPSYS:tl}*} != ""
CONFIGURE_ARGS+= --enable-initfini-array
.endif
post-patch:
@${REINPLACE_CMD} -e '/LIBSTDCXX/ s/stdc\+\+/c\+\+/g ' \
${WRKSRC}//gcc/cp/g++spec.c