Skip to content

Commit

Permalink
devel/freebsd-gcc12: Use -stdlib=libc++ to use libc++.
Browse files Browse the repository at this point in the history
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++.
  • Loading branch information
bsdjhb committed Aug 5, 2023
1 parent 30e39d6 commit e858e20
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 17 deletions.
8 changes: 4 additions & 4 deletions 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}-
Expand Down Expand Up @@ -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
Expand All @@ -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

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

Expand Down
13 changes: 0 additions & 13 deletions devel/freebsd-gcc12/files/patch-gcc-configure

This file was deleted.

11 changes: 11 additions & 0 deletions 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.

11 changes: 11 additions & 0 deletions 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

0 comments on commit e858e20

Please sign in to comment.