Thu Dec 15 21:47:46 2022 UTC ()
rust: Remove -Wl,--strip-all on SunOS.

pkgsrc has its own strip handling, and we need to ensure objects aren't
stripped before we optionally generate CTF data for them.


(jperkin)
diff -r1.30 -r1.31 pkgsrc/lang/rust/cargo.mk

cvs diff -r1.30 -r1.31 pkgsrc/lang/rust/cargo.mk (expand / switch to unified diff)

--- pkgsrc/lang/rust/cargo.mk 2022/05/24 09:51:51 1.30
+++ pkgsrc/lang/rust/cargo.mk 2022/12/15 21:47:46 1.31
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: cargo.mk,v 1.30 2022/05/24 09:51:51 nia Exp $ 1# $NetBSD: cargo.mk,v 1.31 2022/12/15 21:47:46 jperkin Exp $
2# 2#
3# Common logic that can be used by packages that depend on cargo crates 3# Common logic that can be used by packages that depend on cargo crates
4# from crates.io. This lets existing pkgsrc infrastructure fetch and verify 4# from crates.io. This lets existing pkgsrc infrastructure fetch and verify
5# cargo crates instead of using the rust package manager in the build phase. 5# cargo crates instead of using the rust package manager in the build phase.
6# Inspired by cargo.mk from FreeBSD ports. 6# Inspired by cargo.mk from FreeBSD ports.
7# 7#
8# Usage example: 8# Usage example:
9# 9#
10# CARGO_CRATE_DEPENDS+= sha1-0.20 10# CARGO_CRATE_DEPENDS+= sha1-0.20
11# .include "../../lang/rust/cargo.mk" 11# .include "../../lang/rust/cargo.mk"
12# 12#
13# If modifying the list of dependencies, re-run the build once without 13# If modifying the list of dependencies, re-run the build once without
14# --offline in CARGO_ARGS to generate a new valid Cargo.lock. 14# --offline in CARGO_ARGS to generate a new valid Cargo.lock.
@@ -26,26 +26,29 @@ CHECK_SSP_SUPPORTED= no @@ -26,26 +26,29 @@ CHECK_SSP_SUPPORTED= no
26.include "../../lang/rust/rust.mk" 26.include "../../lang/rust/rust.mk"
27 27
28USE_TOOLS+= bsdtar 28USE_TOOLS+= bsdtar
29CARGO_VENDOR_DIR= ${WRKDIR}/vendor 29CARGO_VENDOR_DIR= ${WRKDIR}/vendor
30CARGO_WRKSRC?= ${WRKSRC} 30CARGO_WRKSRC?= ${WRKSRC}
31 31
32DISTFILES?= ${DEFAULT_DISTFILES} 32DISTFILES?= ${DEFAULT_DISTFILES}
33.for crate in ${CARGO_CRATE_DEPENDS} 33.for crate in ${CARGO_CRATE_DEPENDS}
34DISTFILES+= ${crate}.crate 34DISTFILES+= ${crate}.crate
35SITES.${crate}.crate+= -${MASTER_SITE_CRATESIO}${crate:C/-[0-9]+\.[0-9.]+.*$//}/${crate:C/^.*-([0-9]+\.[0-9.]+.*)$/\1/}/download 35SITES.${crate}.crate+= -${MASTER_SITE_CRATESIO}${crate:C/-[0-9]+\.[0-9.]+.*$//}/${crate:C/^.*-([0-9]+\.[0-9.]+.*)$/\1/}/download
36EXTRACT_DIR.${crate}.crate?= ${CARGO_VENDOR_DIR} 36EXTRACT_DIR.${crate}.crate?= ${CARGO_VENDOR_DIR}
37.endfor 37.endfor
38 38
 39# pkgsrc handles stripping and we might need to generate CTF data.
 40BUILDLINK_TRANSFORM.SunOS+= rm:-Wl,--strip-all
 41
39.include "../../mk/bsd.prefs.mk" 42.include "../../mk/bsd.prefs.mk"
40# Triggers NetBSD ld.so bug (PR toolchain/54192) 43# Triggers NetBSD ld.so bug (PR toolchain/54192)
41# See Makefile for further information. 44# See Makefile for further information.
42.if ${OPSYS} == "NetBSD" && ${OPSYS_VERSION} < 099957 45.if ${OPSYS} == "NetBSD" && ${OPSYS_VERSION} < 099957
43MAKE_JOBS_SAFE= no 46MAKE_JOBS_SAFE= no
44.endif 47.endif
45 48
46post-extract: cargo-vendor-crates 49post-extract: cargo-vendor-crates
47.PHONY: cargo-vendor-crates 50.PHONY: cargo-vendor-crates
48cargo-vendor-crates: 51cargo-vendor-crates:
49 @${STEP_MSG} "Extracting local cargo crates" 52 @${STEP_MSG} "Extracting local cargo crates"
50 ${RUN}${MKDIR} ${CARGO_WRKSRC}/.cargo 53 ${RUN}${MKDIR} ${CARGO_WRKSRC}/.cargo
51 ${RUN}${PRINTF} "[source.crates-io]\nreplace-with = \"vendored-sources\"\n[source.vendored-sources]\ndirectory = \"${CARGO_VENDOR_DIR}\"\n" > ${CARGO_WRKSRC}/.cargo/config 54 ${RUN}${PRINTF} "[source.crates-io]\nreplace-with = \"vendored-sources\"\n[source.vendored-sources]\ndirectory = \"${CARGO_VENDOR_DIR}\"\n" > ${CARGO_WRKSRC}/.cargo/config