aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2024-04-29 15:18:45 -0500
committerRob Landley <rob@landley.net>2024-04-29 15:18:45 -0500
commit3101559d3589fdd71a23132998bc8feee37b6b71 (patch)
treeabbc0e354e52dc8da8d92ab6201a8a1d84afb259
parent6ab0eb54d53607bdc12b7e01af716b66cc102375 (diff)
downloadtoybox-upstream-master.tar.gz
Only --start-group and --end-group when static linking.upstream-master
Mac doesn't use llvm's lld linker, it uses its own producing mach-o binaries, which barfs on --start-group.
-rwxr-xr-xscripts/make.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/make.sh b/scripts/make.sh
index de849f83..b94751dd 100755
--- a/scripts/make.sh
+++ b/scripts/make.sh
@@ -70,7 +70,8 @@ LIBRARIES=$(
done | sort | xargs
)
# Actually resolve dangling dependencies in extra libraries when static linking
-[ -n "$LIBRARIES" ] && LIBRARIES="-Wl,--start-group $LIBRARIES -Wl,--end-group"
+[ -n "$LIBRARIES" ] && [ "$LDFLAGS" != "${LDFLAGS/-static/}" ] &&
+ LIBRARIES="-Wl,--start-group $LIBRARIES -Wl,--end-group"
[ -z "$VERSION" ] && [ -d ".git" ] && [ -n "$(which git 2>/dev/null)" ] &&
VERSION="$(git describe --tags --abbrev=12 2>/dev/null)"