pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
rust187: Apply ugly workaround for Darwin/arm64. Pull from main pkgsrc.
Module Name: pkgsrc-wip
Committed By: Havard Eidnes <he%NetBSD.org@localhost>
Pushed By: he
Date: Tue Jun 17 15:45:58 2025 +0000
Changeset: 41d3a1b8c88cd1972f509ea470797b351c642218
Modified Files:
rust187/Makefile
Log Message:
rust187: Apply ugly workaround for Darwin/arm64. Pull from main pkgsrc.
Ideally this should be resolved in the build process and only set the
library path at the specific points that it is required, but for now at
least it doesn't appear to have any harmful side-effects setting it for the
entire build, and makes the package build again.
Limit the blast radius of the other LD_LIBRARY_PATH settings to NetBSD, and
add a comment to explain why.
Original commit in main pkgsrc by jperkin@
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=41d3a1b8c88cd1972f509ea470797b351c642218
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
rust187/Makefile | 37 ++++++++++++++++++++++++++-----------
1 file changed, 26 insertions(+), 11 deletions(-)
diffs:
diff --git a/rust187/Makefile b/rust187/Makefile
index 52bb18dadd..f698d0ab06 100644
--- a/rust187/Makefile
+++ b/rust187/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.316 2024/07/31 12:30:43 he Exp $
+# $NetBSD: Makefile,v 1.339 2025/06/17 15:19:17 jperkin Exp $
DISTNAME= rustc-1.87.0-src
PKGNAME= ${DISTNAME:S/rustc/rust/:S/-src//}
@@ -59,16 +59,6 @@ REPLACE_BASH+= library/portable-simd/subtree-sync.sh
# optional from do-cross.mk
CONFIGURE_ARGS+= ${ADD_CONFIGURE_ARGS}
-# Getting RPATH with $ORIGIN into the bootstrap binaries is
-# problematic, since pkgsrc refuses to put $ORIGIN into RPATHs
-# of executables. So instead we need these so that the bootstrap
-# compiler can be run out of the $RUST_BOOTSTRAP_PATH directory as
-# part of the initial part of the rust compiler build.
-# This problem is not present with the amd64 bootstrap bits,
-# which are built by our upstream and uses $ORIGIN/../lib in RPATH.
-MAKE_ENV+= LD_LIBRARY_PATH=${RUST_BOOTSTRAP_PATH:Q}/lib
-PKGSRC_MAKE_ENV+= LD_LIBRARY_PATH=${RUST_BOOTSTRAP_PATH:Q}/lib
-
# This should allow us to perform "offline" builds (so cargo doesn't fetch
# dependencies during the build stage) but this isn't hooked up yet.
CONFIGURE_ARGS+= --enable-vendor
@@ -93,6 +83,31 @@ CHECK_SSP_SUPPORTED= no
.include "../../mk/bsd.prefs.mk"
+.if ${OPSYS} == "NetBSD"
+# Getting RPATH with $ORIGIN into the bootstrap binaries is
+# problematic, since pkgsrc refuses to put $ORIGIN into RPATHs
+# of executables. So instead we need these so that the bootstrap
+# compiler can be run out of the $RUST_BOOTSTRAP_PATH directory as
+# part of the initial part of the rust compiler build.
+# This problem is not present with the amd64 bootstrap bits,
+# which are built by our upstream and uses $ORIGIN/../lib in RPATH.
+#
+# The above is only true on NetBSD, for other bootstrap kits (e.g. illumos)
+# the binaries are made to be relocatable after the build using elfedit or
+# similar. It is unclear why this approach is not used by NetBSD too.
+#
+MAKE_ENV+= LD_LIBRARY_PATH=${RUST_BOOTSTRAP_PATH:Q}/lib
+PKGSRC_MAKE_ENV+= LD_LIBRARY_PATH=${RUST_BOOTSTRAP_PATH:Q}/lib
+.endif
+
+# TODO: Hack introduced for 1.86.0 as @loader_path is stripped from the
+# bootstrap compiler arguments and the stage1 libraries cannot be found.
+# Ideally this should be inserted only in the necessary points of the
+# bootstrap script.
+.if ${MACHINE_PLATFORM:MDarwin-*-aarch64}
+MAKE_ENV+= DYLD_LIBRARY_PATH=${WRKSRC}/build/aarch64-apple-darwin/stage1/lib
+.endif
+
# Allow overriding MAKE_JOBS_SAFE
# some may chose to mostly build faster,
# and deal with any failures due to deadlocks
Home |
Main Index |
Thread Index |
Old Index