Skip to content

Commit

Permalink
lang/rust: Disable static linking against libstdc++
Browse files Browse the repository at this point in the history
 - According to the PR below and due to some llvm-tools
   and bootstrap untangling, the default was made to link
   statically against libstdc++, although it can be opted-out:
   rust-lang/rust#94832
 - Our static libstdc++ is not compiled with -fPIC apparently
   (dunno why) so it's not possible to do the static linking
   against it when other libraries are compiled with -fPIC.
   There is probably more to it though.

Pointed-out-by: jynelson (rust's discord)
  • Loading branch information
tuxillo committed Jul 26, 2022
1 parent 120b746 commit 32c1f90
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions ports/lang/rust/diffs/Makefile.diff
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- Makefile.orig 2022-01-20 00:07:08 UTC
--- Makefile.orig 2022-07-26 22:50:42 UTC
+++ Makefile
@@ -92,10 +92,6 @@ _CARGO_BOOTSTRAP= ${BOOTSTRAPS_DATE_${AR
@@ -105,10 +105,6 @@ SHEBANG_FILES= compiler/rustc_codegen_c

.include <bsd.port.pre.mk>

Expand All @@ -11,3 +11,11 @@
.if ${ARCH} == powerpc
# bfd to link rustc_driver; lld currently can't
BUILD_DEPENDS+= ld.bfd:devel/binutils
@@ -229,6 +225,7 @@ do-configure:
@${ECHO_CMD} 'ccache=false' >> ${WRKSRC}/config.toml
.endif
@${ECHO_CMD} 'ninja=true' >> ${WRKSRC}/config.toml
+ @${ECHO_CMD} 'static-libstdcpp=false' >> ${WRKSRC}/config.toml
.if ${ARCH} == powerpc
# Rust doesn't call the system compiler with the full version of the target.
# This makes powerpc miscompile due to the secure-plt ABI change.

0 comments on commit 32c1f90

Please sign in to comment.