aboutsummaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2020-01-02 19:20:06 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2020-01-02 19:20:06 +0000
commitd7993e894699a1127a741094665934dd51ce69b1 (patch)
treece1f383cf7f0a46b38b382077dc5c384bdae688d /base
parent9d7858290fb91f2439e36c5e93909f443cba6677 (diff)
downloadports-d7993e894699a1127a741094665934dd51ce69b1.tar.gz
ports-d7993e894699a1127a741094665934dd51ce69b1.zip
Various fixes to base/binutils and base/gcc6.
- Add --with-sysroot=/ to CONFIGURE_ARGS. base/binutils needs this so that ld honors --sysroot in linker scripts. base/gcc6 needs this so that the C++ include paths honor --sysroot. - Remove a hack from GCC's configure to force C++98 mode when building GCC with GCC. libc++ assumes C++11, so this hack was breaking the build of base/gcc6 natively when the system compiler was GCC. - Add toolchain makefiles installed to /usr/share/toolchains. These are suitable to be used by CROSS_TOOLCHAIN when doing a native arch build. These makefiles enable appropriate knobs so that the in-tree components that are replaced by each package are not built or installed. The freebsd-gcc toolchain makefile includes the binutils toolchain makefile if it is present. Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D22984
Notes
Notes: svn path=/head/; revision=521870
Diffstat (limited to 'base')
-rw-r--r--base/binutils/Makefile4
-rw-r--r--base/binutils/files/freebsd-binutils.mk4
-rw-r--r--base/binutils/pkg-plist1
-rw-r--r--base/gcc6/Makefile5
-rw-r--r--base/gcc6/files/freebsd-gcc.mk8
-rw-r--r--base/gcc6/files/patch-configure19
-rw-r--r--base/gcc6/pkg-plist1
7 files changed, 39 insertions, 3 deletions
diff --git a/base/binutils/Makefile b/base/binutils/Makefile
index 92c4e8b15338..32a5ce321ab8 100644
--- a/base/binutils/Makefile
+++ b/base/binutils/Makefile
@@ -3,6 +3,7 @@
PORTNAME= binutils
PORTVERSION= 2.33.1
PORTEPOCH= 0
+PORTREVISION= 1
CATEGORIES= base
MASTER_SITES= SOURCEWARE/binutils/releases
PKGNAMEPREFIX= ${OPSYS:tl}-
@@ -35,6 +36,7 @@ CONFIGURE_ARGS+= --disable-host-shared \
--disable-shared \
--disable-nls \
--with-system-zlib \
+ --with-sysroot="/" \
--enable-relro=no \
--enable-x86-relax-relocations=no \
--target=${BUTARGET}
@@ -117,5 +119,7 @@ post-install:
${STAGEDIR}${MANPREFIX}/man/man1/${tool}.1 \
${STAGEDIR}${PREFIX}/${BUTARGET}/bin/${tool}
.endfor
+ @${MKDIR} ${STAGEDIR}${PREFIX}/share/toolchains
+ ${INSTALL_DATA} ${.CURDIR}/files/freebsd-binutils.mk ${STAGEDIR}${PREFIX}/share/toolchains/
.include <bsd.port.post.mk>
diff --git a/base/binutils/files/freebsd-binutils.mk b/base/binutils/files/freebsd-binutils.mk
new file mode 100644
index 000000000000..e2e3fa5e5e30
--- /dev/null
+++ b/base/binutils/files/freebsd-binutils.mk
@@ -0,0 +1,4 @@
+CROSS_BINUTILS_PREFIX=/usr/bin/
+export WITH_PORT_BASE_BINUTILS=yes
+export WITHOUT_BINUTILS=yes
+export WITHOUT_LLD_IS_LD=yes
diff --git a/base/binutils/pkg-plist b/base/binutils/pkg-plist
index 1d0cbb2c375f..847ef806e67d 100644
--- a/base/binutils/pkg-plist
+++ b/base/binutils/pkg-plist
@@ -561,3 +561,4 @@ bin/objdump
share/man/man1/as.1.gz
share/man/man1/ld.1.gz
share/man/man1/objdump.1.gz
+share/toolchains/freebsd-binutils.mk
diff --git a/base/gcc6/Makefile b/base/gcc6/Makefile
index fa6f67d4e423..b432af7a2c31 100644
--- a/base/gcc6/Makefile
+++ b/base/gcc6/Makefile
@@ -2,6 +2,7 @@
PORTNAME= gcc
PORTVERSION= 6.5.0
+PORTREVISION= 1
CATEGORIES= base
MASTER_SITES= GCC/releases/gcc-${DISTVERSION} \
http://www.mpfr.org/mpfr-3.1.6/:mpfr \
@@ -32,6 +33,7 @@ CONFIGURE_ENV+= ${_tool}_FOR_TARGET="${${_tool}}"
USES= gmake libtool tar:xz makeinfo
PLIST_SUB= OPSYS=${OPSYS:tl} \
+ SUFFIX=${SUFFIX} \
GCC_TARGET=${GCC_TARGET} \
GCC_VERSION=${PORTVERSION}
@@ -47,6 +49,7 @@ CONFIGURE_ARGS+= \
--disable-nls \
--without-headers \
--with-gxx-include-dir=/usr/include/c++/v1/ \
+ --with-sysroot="/" \
--with-build-sysroot=${CROSS_SYSROOT} \
-with-pkgversion="GNU Collection for FreeBSD"
@@ -119,5 +122,7 @@ post-install:
.if ${ARCH} == "amd64" || ${ARCH} == "i386"
${RM} ${STAGEDIR}/usr/lib/gcc/${GCC_TARGET}/${PORTVERSION}/include/float.h
.endif
+ @${MKDIR} ${STAGEDIR}${PREFIX}/share/toolchains
+ ${INSTALL_DATA} ${FILESDIR}/freebsd-gcc.mk ${STAGEDIR}${PREFIX}/share/toolchains/freebsd-gcc${SUFFIX}.mk
.include <bsd.port.post.mk>
diff --git a/base/gcc6/files/freebsd-gcc.mk b/base/gcc6/files/freebsd-gcc.mk
new file mode 100644
index 000000000000..e1e4ebaf6d55
--- /dev/null
+++ b/base/gcc6/files/freebsd-gcc.mk
@@ -0,0 +1,8 @@
+XCC=/usr/bin/cc
+XCXX=/usr/bin/c++
+XCPP=/usr/bin/cpp
+X_COMPILER_TYPE=gcc
+export WITH_PORT_BASE_GCC=yes
+export WITHOUT_GCC=yes
+export WITHOUT_CLANG_IS_CC=yes
+.sinclude "freebsd-binutils.mk"
diff --git a/base/gcc6/files/patch-configure b/base/gcc6/files/patch-configure
index 447a76f2b251..a80f4eca3b86 100644
--- a/base/gcc6/files/patch-configure
+++ b/base/gcc6/files/patch-configure
@@ -1,6 +1,6 @@
---- configure.orig 2015-05-03 17:29:57 UTC
-+++ configure
-@@ -3675,10 +3675,6 @@ case "${target}" in
+--- configure.orig 2017-01-09 13:01:26.582656000 -0800
++++ configure 2019-03-26 14:29:44.995174000 -0700
+@@ -3717,10 +3717,6 @@ case "${target}" in
*-*-dragonfly*)
;;
*-*-freebsd*)
@@ -11,3 +11,16 @@
;;
*-*-kaos*)
# Remove unsupported stuff on all kaOS configurations.
+@@ -5450,12 +5446,6 @@ $as_echo "$as_me: WARNING: trying to bootstrap a cross
+ as_fn_error "invalid option for --enable-bootstrap" "$LINENO" 5
+ ;;
+ esac
+-
+-# When bootstrapping with GCC, build stage 1 in C++98 mode to ensure that a
+-# C++98 compiler can still start the bootstrap.
+-if test "$enable_bootstrap:$GXX" = "yes:yes"; then
+- CXX="$CXX -std=gnu++98"
+-fi
+
+ # Used for setting $lt_cv_objdir
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
diff --git a/base/gcc6/pkg-plist b/base/gcc6/pkg-plist
index 933abadcbe64..8a5836bba260 100644
--- a/base/gcc6/pkg-plist
+++ b/base/gcc6/pkg-plist
@@ -27,3 +27,4 @@ share/man/man1/gcov-tool.1.gz
share/man/man7/fsf-funding.7.gz
share/man/man7/gfdl.7.gz
share/man/man7/gpl.7.gz
+share/toolchains/freebsd-gcc%%SUFFIX%%.mk