From 4340a5addb0c9da67b1f68dc00ba2a3fc80436cb Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Tue, 15 Oct 2024 09:04:42 -0400 Subject: [PATCH] bintools-wrapper: ensure Swift auto-linked libraries can be found While the Swift wrapper should take care of this, not everything that links these libraries goes through the wrapper. --- .../bintools-wrapper/add-darwin-ldflags-before.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/build-support/bintools-wrapper/add-darwin-ldflags-before.sh b/pkgs/build-support/bintools-wrapper/add-darwin-ldflags-before.sh index 79f0546403f7a..0a2961bbe46ec 100644 --- a/pkgs/build-support/bintools-wrapper/add-darwin-ldflags-before.sh +++ b/pkgs/build-support/bintools-wrapper/add-darwin-ldflags-before.sh @@ -89,3 +89,9 @@ DEVELOPER_DIR=${DEVELOPER_DIR_@suffixSalt@:-@fallback_sdk@} # Darwin looks for frameworks in the SDK located at `DEVELOPER_DIR`. extraBefore+=("-F$DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks") extraBefore+=("-L$DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib") + +# While the Swift wrapper should take care of this, anything that needs to link Swift auto-linked frameworks +# also needs these paths. Note: Test and conditionally add it because the path may not exist in older SDKs. +if [ -d "$DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/swift" ]; then + extraBefore+=("-L$DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/swift") +fi