Skip to content

Commit

Permalink
libcxxrt: allow build with gcc13 and --no-undefined-version
Browse files Browse the repository at this point in the history
GCC 13 supports _Float16 and __int128 on fewer architectures than clang
and thus libcxxrt compiled with gcc13 is sometimes missing related
symbols.  Hack around this by explicitly appending --undefined-version
to LDFLAGS in problematic cases.

Reviewed by:	theraven, dim
Differential Revision:	https://reviews.freebsd.org/D45233
  • Loading branch information
brooksdavis committed May 17, 2024
1 parent f7d45c5 commit 1062db3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/libcxxrt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,13 @@ Version-64.map: Version.map
.endif

.include <bsd.lib.mk>

# gcc13 doesn't support _Float16 on riscv, powerpc64, and x86 or __int128
# on i386. Disable checks for missing symbols to allow this to link.
#
# XXX: This is a hack that hides an ABI divergence between clang and gcc.
.if ${COMPILER_TYPE} == "gcc" && \
(${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" || \
${MACHINE_ARCH:Mpowerpc64*} || ${MACHINE_ARCH} == "riscv64")
LDFLAGS+= -Wl,--undefined-version
.endif

0 comments on commit 1062db3

Please sign in to comment.