Skip to content

Commit

Permalink
llvmPackages.bintuils: Hack ranlib to ignore -t (#359387)
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfgangwalther authored Dec 15, 2024
2 parents a27ac57 + 70c2f44 commit 046d26e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkgs/build-support/bintools-wrapper/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
##
Expand Down
16 changes: 16 additions & 0 deletions pkgs/build-support/bintools-wrapper/llvm-ranlib-wrapper.sh
Original file line number Diff line number Diff line change
@@ -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[@]}"

0 comments on commit 046d26e

Please sign in to comment.