llvmPackages.bintuils: Hack ranlib to ignore -t
Old versions of libtool for OpenBSD insist on adding the `-t` flag to
ranlib, which updates the timestamp. llvm-ranlib does not support `-t`
and as no plans to do so [1], since it makes builds less reproducable.
OpenBSD upstream deals with this by patching ranlib to ignore the `-t`
flag [2].
Instead of writing patches for all LLVM versions or re-running `autoreconf`
on all packages that use libtool, we can wrap ranlib to ignore the flag.
[1]: https://github.com/llvm/llvm-project/issues/57129
[2]: d00990cc11
This commit is contained in:
parent
09913b8023
commit
70c2f444e3
@ -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
|
||||
##
|
||||
|
16
pkgs/build-support/bintools-wrapper/llvm-ranlib-wrapper.sh
Normal file
16
pkgs/build-support/bintools-wrapper/llvm-ranlib-wrapper.sh
Normal 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[@]}"
|
Loading…
x
Reference in New Issue
Block a user