mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-08-31 20:54:56 +00:00
… and refresh the patch, which didn’t apply anymore: Upstream has begun supporting an env var named $CROSS as a mechanism for cross-compiling. We now piggy-back on those points of the code the check for the Nixpkgs stdenv environment vars relevant here ($NM, $OBJDUMP). $CC handling is left as it was, save for an offset adjustment. The patch now applies cleanly. Also: - Add capstone as a nativeBuildInput, which the project now requires - Enable strictDeps, and registered valgrind also as a buildInput - Enable __structuredAttrs - Restore build on aarch64-darwin: - valgrind is currently broken there, so gate its use - drop ELF-only assembly annotations - exclude python script from being processed by install_name_tool Ref: https://github.com/ngi-nix/projects/issues/102 This work is done as part of Summer of Nix 2026.
62 lines
1.9 KiB
Diff
62 lines
1.9 KiB
Diff
diff --git a/configure b/configure
|
|
index 86b7e88..33c126f 100755
|
|
--- a/configure
|
|
+++ b/configure
|
|
@@ -255,6 +255,17 @@ for arch in sorted(os.listdir('compilers')):
|
|
with open('compilers/%s' % arch) as f:
|
|
for c in f.readlines():
|
|
c = c.strip()
|
|
+ if env_cc := os.getenv('CC'):
|
|
+ c_as_list= c.split()
|
|
+ # check if the compiler we're testing has the name inside the last
|
|
+ # part of the CC env var
|
|
+ # i.e. gcc == x86_64-linux-unknown-gnu-gcc
|
|
+ # or gcc == gcc
|
|
+ if c_as_list[0] == env_cc.split("-")[-1]:
|
|
+ c_as_list[0] = env_cc
|
|
+ c = ' '.join(c_as_list)
|
|
+ log('patched command as %s' % c)
|
|
+
|
|
cv = compilerversion(c)
|
|
if cv == None:
|
|
log('skipping %s compiler %s' % (arch,c))
|
|
diff --git a/scripts-build/checkinsns b/scripts-build/checkinsns
|
|
index 039a0c5..4e64c96 100755
|
|
--- a/scripts-build/checkinsns
|
|
+++ b/scripts-build/checkinsns
|
|
@@ -5,7 +5,7 @@ import sys
|
|
import subprocess
|
|
import traceback
|
|
|
|
-objdump = os.getenv('CROSS','')+'objdump'
|
|
+objdump = os.getenv('OBJDUMP', os.getenv('CROSS','')+'objdump')
|
|
|
|
host = sys.argv[1]
|
|
|
|
diff --git a/scripts-build/checknamespace b/scripts-build/checknamespace
|
|
index 2a599e4..d0ae563 100755
|
|
--- a/scripts-build/checknamespace
|
|
+++ b/scripts-build/checknamespace
|
|
@@ -4,7 +4,7 @@ import os
|
|
import sys
|
|
import subprocess
|
|
|
|
-nm = os.getenv('CROSS','')+'nm'
|
|
+nm = os.getenv('NM', os.getenv('CROSS','')+'nm')
|
|
|
|
topnamespace = sys.argv[1]
|
|
|
|
diff --git a/scripts-build/staticlib b/scripts-build/staticlib
|
|
index 7683233..0445bc3 100755
|
|
--- a/scripts-build/staticlib
|
|
+++ b/scripts-build/staticlib
|
|
@@ -3,6 +3,6 @@
|
|
lib="$1"
|
|
|
|
rm -f package/lib/"$lib".a
|
|
-ar cr package/lib/"$lib".a ofiles/*.o
|
|
-ranlib package/lib/"$lib".a || :
|
|
+${AR:-ar} cr package/lib/"$lib".a ofiles/*.o
|
|
+${RANLIB:-ranlib} package/lib/"$lib".a || :
|
|
chmod 644 package/lib/"$lib".a
|