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
This commit is contained in:
John Baldwin 2020-01-02 19:20:06 +00:00
parent 9d7858290f
commit d7993e8946
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=521870
7 changed files with 39 additions and 3 deletions

View File

@ -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>

View File

@ -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

View File

@ -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

View File

@ -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>

View File

@ -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"

View File

@ -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

View File

@ -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