git: e858e20eec81 - main - devel/freebsd-gcc12: Use -stdlib=libc++ to use libc++.
Date: Sat, 05 Aug 2023 15:24:37 UTC
The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/ports/commit/?id=e858e20eec8104648b25313b388e9f2532c980fb commit e858e20eec8104648b25313b388e9f2532c980fb Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2023-08-05 15:24:11 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2023-08-05 15:24:11 +0000 devel/freebsd-gcc12: Use -stdlib=libc++ to use libc++. Instead of overriding the path and library name of libstdc++, set the path for libc++ and change the default of -stdlib= from libstdc++ to libc++. --- devel/freebsd-gcc12/Makefile | 8 ++++---- devel/freebsd-gcc12/files/patch-gcc-configure | 13 ------------- devel/freebsd-gcc12/files/patch-gcc_c-family_c.opt | 11 +++++++++++ devel/freebsd-gcc12/files/patch-gcc_cp_g++spec.cc | 11 +++++++++++ 4 files changed, 26 insertions(+), 17 deletions(-) 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,6 +1,6 @@ PORTNAME= gcc PORTVERSION= 12.2.0 -PORTREVISION= 8 +PORTREVISION= 9 CATEGORIES= devel MASTER_SITES= GCC PKGNAMEPREFIX= ${TARGETARCH}- @@ -53,7 +53,7 @@ CONFIGURE_ARGS+=--target=${GCC_TARGET} --disable-nls --enable-languages=c,c++ \ --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 @@ -62,6 +62,8 @@ CONFIGURE_ARGS+=--target=${GCC_TARGET} --disable-nls --enable-languages=c,c++ \ CONFIGURE_ARGS+=--with-abi=elfv2 .endif +CPPFLAGS+= -DLIBCXXABI=NULL + ALL_TARGET= all-gcc INSTALL_TARGET= install-gcc @@ -79,8 +81,6 @@ BU_PREFIX= ${GCC_TARGET} 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 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