git: 4de701de115a - main - lang/gcc13-devel: Expose non-default -stdlib=libc++ support

From: Lorenzo Salvadore <salvadore_at_FreeBSD.org>
Date: Mon, 22 Aug 2022 12:00:51 UTC
The branch main has been updated by salvadore:

URL: https://cgit.FreeBSD.org/ports/commit/?id=4de701de115afbd0789dd5fd9e276423fc1df500

commit 4de701de115afbd0789dd5fd9e276423fc1df500
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2022-08-21 23:25:49 +0000
Commit:     Lorenzo Salvadore <salvadore@FreeBSD.org>
CommitDate: 2022-08-22 12:00:04 +0000

    lang/gcc13-devel: Expose non-default -stdlib=libc++ support
    
    Fix -stdlib=libc++ option which produced "error: unrecognized
    command-line option '-stdlib=libc++'".
    
    PR:             265962
    Reported by:    jbeich
---
 lang/gcc13-devel/Makefile             |  2 ++
 lang/gcc13-devel/files/patch-libcxxrt | 18 ++++++++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/lang/gcc13-devel/Makefile b/lang/gcc13-devel/Makefile
index 053c31430d1d..7aa7c002e20e 100644
--- a/lang/gcc13-devel/Makefile
+++ b/lang/gcc13-devel/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	gcc
 PORTVERSION=	13.0.0.s20220731
+PORTREVISION=	1
 CATEGORIES=	lang
 MASTER_SITES=	GCC/snapshots/${DIST_VERSION}
 PKGNAMESUFFIX=	${SUFFIX}-devel
@@ -105,6 +106,7 @@ CONFIGURE_ARGS+=--disable-nls \
 		--with-as=${LOCALBASE}/bin/as \
 		--with-gmp=${LOCALBASE} \
 		--with-gxx-include-dir=${TARGLIB}/include/c++/ \
+		--with-gxx-libcxx-include-dir=/usr/include/c++/v1 \
 		--with-ld=${LOCALBASE}/bin/ld \
 		${ICONV_CONFIGURE_ARG} \
 		--with-pkgversion="FreeBSD Ports Collection" \
diff --git a/lang/gcc13-devel/files/patch-libcxxrt b/lang/gcc13-devel/files/patch-libcxxrt
new file mode 100644
index 000000000000..4225df7aad1e
--- /dev/null
+++ b/lang/gcc13-devel/files/patch-libcxxrt
@@ -0,0 +1,18 @@
+libc++ on FreeBSD always uses PathScale libcxxrt and cannot change to
+LLVM libc++abi without breaking backward compatibility. Besides, mixing
+different C++ ABIs is not supported unless subset via DT_FILTER.
+
+https://github.com/llvm/llvm-project/commit/35479ffb1251
+https://github.com/freebsd/freebsd-src/commit/cf56074e5271
+
+--- gcc/cp/g++spec.cc.orig	2022-07-31 22:32:16 UTC
++++ gcc/cp/g++spec.cc
+@@ -60,7 +60,7 @@ along with GCC; see the file COPYING3.  If not see
+ #endif
+ 
+ #ifndef LIBCXXABI
+-#define LIBCXXABI "c++abi"
++#define LIBCXXABI "cxxrt"
+ #endif
+ #ifndef LIBCXXABI_PROFILE
+ #define LIBCXXABI_PROFILE LIBCXXABI