From 75b43586ed623f5d0f9f3340a6eb1e5c95d75387 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Sat, 7 Apr 2018 00:29:42 +0000 Subject: [PATCH] Bring over some fixes from the other external GCC toolchain ports. This is generally inspired by the changes in r465416 and subsequent fixes. - Remove include-fixed headers. - Strip /usr/local/include from the default include path. - Use libc++ for C++ instead of libstdc++. - Force build of a cross compiler if built on a riscv64 host. - Bump PORTREVISION. Reviewed by: lwhsu Differential Revision: https://reviews.freebsd.org/D14787 --- devel/riscv64-gcc/Makefile | 13 ++++++++++++- devel/riscv64-gcc/pkg-plist | 15 --------------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/devel/riscv64-gcc/Makefile b/devel/riscv64-gcc/Makefile index c1ca5c8617d5..641352fce8b3 100644 --- a/devel/riscv64-gcc/Makefile +++ b/devel/riscv64-gcc/Makefile @@ -2,7 +2,7 @@ PORTNAME= gcc PORTVERSION= 7.2.0 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= devel PKGNAMEPREFIX= riscv64- @@ -32,6 +32,7 @@ GCC_TARGET= ${PKGNAMEPREFIX}unknown-${OPSYS:tl}${OSREL} GNU_CONFIGURE= yes CONFIGURE_OUTSOURCE= yes CONFIGURE_ARGS= --target=${GCC_TARGET} \ + --with-gxx-include-dir=/usr/include/c++/v1/ \ --with-sysroot=/ \ --without-newlib \ --without-headers \ @@ -59,12 +60,22 @@ CONFIGURE_ARGS= --target=${GCC_TARGET} \ ALL_TARGET= inhibit-libc=true all-gcc INSTALL_TARGET= inhibit-libc=true install-gcc +# Force build of a cross compiler even if the target matches the host. +CFLAGS+= -DCROSS_DIRECTORY_STRUCTURE + PLIST_SUB= GCC_TARGET=${GCC_TARGET} \ GCC_VERSION=${PORTVERSION} +post-patch: + @${REINPLACE_CMD} -e '/LIBSTDCXX/ s/stdc\+\+/c\+\+/g ' \ + ${WRKSRC}//gcc/cp/g++spec.c + @${REINPLACE_CMD} -e '/LOCAL_INCLUDE_DIR/ d ' \ + ${WRKSRC}//gcc/Makefile.in + post-install: @if [ -d ${STAGEDIR}${PREFIX}/${INFO_PATH} ] ; then ${RM} -r ${STAGEDIR}${PREFIX}/${INFO_PATH}; fi @${RM} ${STAGEDIR}${PREFIX}/man/man7/* + @${RM} -r ${STAGEDIR}${PREFIX}/lib/gcc/${GCC_TARGET}/${PORTVERSION}/include-fixed BROKEN_aarch64= fails to package diff --git a/devel/riscv64-gcc/pkg-plist b/devel/riscv64-gcc/pkg-plist index 8bd0907a8603..fcbc60821f1c 100644 --- a/devel/riscv64-gcc/pkg-plist +++ b/devel/riscv64-gcc/pkg-plist @@ -9,21 +9,6 @@ bin/%%GCC_TARGET%%-gcc-ranlib bin/%%GCC_TARGET%%-gcov bin/%%GCC_TARGET%%-gcov-dump bin/%%GCC_TARGET%%-gcov-tool -lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include-fixed/README -lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include-fixed/limits.h -lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include-fixed/netinet/ip_fil.h -lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include-fixed/netinet/ip_lookup.h -lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include-fixed/netinet/ip_nat.h -lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include-fixed/netinet/ip_proxy.h -lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include-fixed/netinet/ip_scan.h -lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include-fixed/netinet/ip_state.h -lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include-fixed/stddef.h -lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include-fixed/stdio.h -lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include-fixed/stdlib.h -lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include-fixed/sys/types.h -lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include-fixed/syslimits.h -lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include-fixed/unistd.h -lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include-fixed/wchar.h lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include/float.h lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include/iso646.h lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include/stdalign.h