diff --git a/devel/freebsd-gcc12/Makefile b/devel/freebsd-gcc12/Makefile index 677f60f8c5dd..e6ac2069852a 100644 --- a/devel/freebsd-gcc12/Makefile +++ b/devel/freebsd-gcc12/Makefile @@ -1,148 +1,148 @@ PORTNAME= gcc PORTVERSION= 12.2.0 -PORTREVISION= 8 +PORTREVISION= 9 CATEGORIES= devel MASTER_SITES= GCC PKGNAMEPREFIX= ${TARGETARCH}- PKGNAMESUFFIX= ${SUFFIX} MAINTAINER= jhb@FreeBSD.org COMMENT= Cross GNU Compiler Collection for ${TARGETARCH} WWW= https://gcc.gnu.org/ LICENSE= GPLv3 GPLv3RLE LICENSE_COMB= multi IGNORE_FreeBSD_12= Not supported on FreeBSD 12 BUILD_DEPENDS= ${BU_PREFIX}-as:devel/binutils@${BU_FLAVOR} \ objdump:devel/binutils LIB_DEPENDS= libgmp.so:math/gmp \ libmpfr.so:math/mpfr \ libmpc.so:math/mpc RUN_DEPENDS= ${BU_PREFIX}-as:devel/binutils@${BU_FLAVOR} FLAVORS= aarch64 amd64 armv6 armv7 i386 powerpc powerpc64 riscv64 TARGETARCH= ${FLAVOR} USES= compiler:c++11-lang cpe gmake iconv libtool makeinfo tar:xz CPE_VENDOR= gnu PLIST_SUB= OPSYS=${OPSYS:tl} \ SUFFIX=${SUFFIX} \ TARGETARCH=${TARGETARCH} \ GCC_TARGET=${GCC_TARGET} \ GCC_VERSION=${PORTVERSION} SUB_FILES= xtoolchain.mk SUB_LIST= BU_PREFIX=${BU_PREFIX} \ GCC_TARGET=${GCC_TARGET} \ SUFFIX=${SUFFIX} SUFFIX= ${PORTVERSION:C/([0-9]+).*/\1/} GNU_CONFIGURE= yes CONFIGURE_OUTSOURCE= yes CONFIGURE_ARGS+=--target=${GCC_TARGET} --disable-nls --enable-languages=c,c++ \ --enable-gnu-indirect-function \ --enable-initfini-array \ --program-prefix=${GCC_TARGET}- \ --program-suffix=${SUFFIX} \ --without-headers \ --with-gmp=${LOCALBASE} \ --with-pkgversion="FreeBSD Ports Collection for ${PKGNAMEPREFIX:C/-//g}" \ --with-system-zlib \ --without-zstd \ - --with-gxx-include-dir=/usr/include/c++/v1/ \ + --with-gxx-libcxx-include-dir=//usr/include/c++/v1 \ --with-sysroot="/" \ --with-as=${LOCALBASE}/bin/${BU_PREFIX}-as \ --with-ld=${LOCALBASE}/bin/${BU_PREFIX}-ld .if ${TARGETARCH:Mpowerpc64*} CONFIGURE_ARGS+=--with-abi=elfv2 .endif +CPPFLAGS+= -DLIBCXXABI=NULL + ALL_TARGET= all-gcc INSTALL_TARGET= install-gcc .include .if ${TARGETARCH:Marm*} TARGET_ABI= gnueabi BU_FLAVOR= arm_${TARGET_ABI} BU_PREFIX= arm-${TARGET_ABI}-${OPSYS:tl}${OSREL} .else TARGET_ABI= unknown BU_FLAVOR= ${TARGETARCH} BU_PREFIX= ${GCC_TARGET} .endif GCC_TARGET= ${TARGETARCH:S/amd64/x86_64/}-${TARGET_ABI}-${OPSYS:tl}${OSREL} post-patch: - @${REINPLACE_CMD} -e '/LIBSTDCXX/ s/stdc\+\+/c\+\+/g ' \ - ${WRKSRC}//gcc/cp/g++spec.cc @${REINPLACE_CMD} -e '/LOCAL_INCLUDE_DIR/ d ' \ ${WRKSRC}//gcc/Makefile.in .if ${ARCH} == "amd64" CONFIGURE_TARGET= x86_64-unknown-${OPSYS:tl}${OSREL} .else CONFIGURE_TARGET= ${ARCH}-unknown-${OPSYS:tl}${OSREL} .endif .if ${TARGETARCH} == "amd64" || ${TARGETARCH} == "powerpc64" CONFIGURE_ARGS+=--enable-multilib .endif .if ${ARCH} == "aarch64" PLIST_SUB+= PLUGINS="@comment plugin does not build" .else PLIST_SUB+= PLUGINS="" .endif .if ${TARGETARCH} == "amd64" || ${TARGETARCH} == "i386" PLIST_SUB+= FLOAT_H="@comment " .else PLIST_SUB+= FLOAT_H="" .endif PLIST= ${.CURDIR}/pkg-plist .if ${TARGETARCH} == "aarch64" PLIST+= ${.CURDIR}/pkg-plist.aarch64 .endif .if ${TARGETARCH} == "aarch64" || ${TARGETARCH:Marm*} PLIST+= ${.CURDIR}/pkg-plist.arm .endif .if ${TARGETARCH:Marm*} PLIST+= ${.CURDIR}/pkg-plist.arm_gnueabi .endif .if ${TARGETARCH} == "amd64" PLIST+= ${.CURDIR}/pkg-plist.amd64 .endif .if ${TARGETARCH} == "amd64" || ${TARGETARCH} == "i386" PLIST+= ${.CURDIR}/pkg-plist.i386 .endif .if ${TARGETARCH:Mpowerpc64*} PLIST+= ${.CURDIR}/pkg-plist.powerpc64 .elif ${TARGETARCH:Mpowerpc*} PLIST+= ${.CURDIR}/pkg-plist.powerpc .endif .if ${TARGETARCH:Mriscv*} PLIST+= ${.CURDIR}/pkg-plist.riscv .endif post-install: @${RM} ${STAGEDIR}${PREFIX}/bin/${GCC_TARGET}-${GCC_TARGET}-* @${RM} ${STAGEDIR}${PREFIX}/share/info/* @${RM} ${STAGEDIR}${PREFIX}/man/man7/* @${RM} -r ${STAGEDIR}${PREFIX}/lib/gcc/${GCC_TARGET}/${PORTVERSION}/include-fixed .if ${TARGETARCH} == "amd64" || ${TARGETARCH} == "i386" # Conflicts with sys/x86/include/float.h ${RM} ${STAGEDIR}${PREFIX}/lib/gcc/${GCC_TARGET}/${PORTVERSION}/include/float.h .endif ${MKDIR} ${STAGEDIR}${PREFIX}/share/toolchains/ ${INSTALL_DATA} ${WRKDIR}/xtoolchain.mk \ ${STAGEDIR}${PREFIX}/share/toolchains/${TARGETARCH}-gcc${SUFFIX}.mk .include diff --git a/devel/freebsd-gcc12/files/patch-gcc-configure b/devel/freebsd-gcc12/files/patch-gcc-configure deleted file mode 100644 index 77263f826378..000000000000 --- a/devel/freebsd-gcc12/files/patch-gcc-configure +++ /dev/null @@ -1,13 +0,0 @@ ---- gcc/configure.orig 2019-11-29 16:01:46.850423000 -0800 -+++ gcc/configure 2019-11-29 16:05:09.818243000 -0800 -@@ -3673,7 +3673,9 @@ if test x${gcc_gxx_include_dir} = x; then - fi - elif test "${with_sysroot+set}" = set; then - gcc_gxx_without_sysroot=`expr "${gcc_gxx_include_dir}" : "${with_sysroot}"'\(.*\)'` -- if test "${gcc_gxx_without_sysroot}"; then -+ if test "${with_sysroot}" = "/"; then -+ gcc_gxx_include_dir_add_sysroot=1 -+ elif test "${gcc_gxx_without_sysroot}"; then - gcc_gxx_include_dir="${gcc_gxx_without_sysroot}" - gcc_gxx_include_dir_add_sysroot=1 - fi diff --git a/devel/freebsd-gcc12/files/patch-gcc_c-family_c.opt b/devel/freebsd-gcc12/files/patch-gcc_c-family_c.opt new file mode 100644 index 000000000000..2883e47e4e05 --- /dev/null +++ b/devel/freebsd-gcc12/files/patch-gcc_c-family_c.opt @@ -0,0 +1,11 @@ +--- gcc/c-family/c.opt.orig 2023-07-01 21:56:03 UTC ++++ gcc/c-family/c.opt +@@ -2464,7 +2464,7 @@ stdlib= + Conform to the ISO 2017 C standard (published in 2018). + + stdlib= +-Driver C++ ObjC++ Common Condition(ENABLE_STDLIB_OPTION) Var(flag_stdlib_kind) Joined Enum(stdlib_kind) RejectNegative Init(1) ++Driver C++ ObjC++ Common Condition(ENABLE_STDLIB_OPTION) Var(flag_stdlib_kind) Joined Enum(stdlib_kind) RejectNegative Init(2) + -stdlib=[libstdc++|libc++] The standard library to be used for C++ headers + and runtime. + diff --git a/devel/freebsd-gcc12/files/patch-gcc_cp_g++spec.cc b/devel/freebsd-gcc12/files/patch-gcc_cp_g++spec.cc new file mode 100644 index 000000000000..ba527535ca0c --- /dev/null +++ b/devel/freebsd-gcc12/files/patch-gcc_cp_g++spec.cc @@ -0,0 +1,11 @@ +--- gcc/cp/g++spec.cc.orig 2023-05-08 12:14:39 UTC ++++ gcc/cp/g++spec.cc +@@ -95,7 +95,7 @@ lang_specific_driver (struct cl_decoded_option **in_de + int library = 0; + + /* Which c++ runtime library to link. */ +- stdcxxlib_kind which_library = USE_LIBSTDCXX; ++ stdcxxlib_kind which_library = USE_LIBCXX; + + /* The number of arguments being added to what's in argv, other than + libraries. We use this to track the number of times we've inserted