llvmPackages.bintuils: Hack ranlib to ignore -t (#359387)

This commit is contained in:
Wolfgang Walther 2024-12-15 20:34:48 +01:00 committed by GitHub
commit 046d26e578
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 28 additions and 0 deletions

View File

@ -382,6 +382,18 @@ stdenvNoCC.mkDerivation {
substituteAll ${./add-darwin-ldflags-before.sh} $out/nix-support/add-local-ldflags-before.sh
''
##
## LLVM ranlab lacks -t option that libtool expects. We can just
## skip it
##
+ optionalString (isLLVM && targetPlatform.isOpenBSD) ''
rm $out/bin/${targetPrefix}ranlib
wrap \
${targetPrefix}ranlib ${./llvm-ranlib-wrapper.sh} \
"${bintools_bin}/bin/${targetPrefix}ranlib"
''
##
## Extra custom steps
##

View File

@ -0,0 +1,16 @@
#! @shell@
# shellcheck shell=bash
args=()
for p in "$@"; do
case "$p" in
-t)
# Skip, LLVM ranlib doesn't support
;;
*)
args+=("$p")
;;
esac
done
@prog@ "${args[@]}"