]> Cypherpunks repositories - keks.git/commitdiff
Try to make deterministic .a
authorSergey Matveev <stargrave@stargrave.org>
Tue, 8 Jul 2025 09:32:39 +0000 (12:32 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Tue, 8 Jul 2025 10:17:22 +0000 (13:17 +0300)
c/clean
c/conf/.gitignore
c/conf/clean [new file with mode: 0755]
c/conf/objcopy.do [new file with mode: 0644]
c/lib/cm/libkekscm.a.do
c/lib/libkeks.a.do

diff --git a/c/clean b/c/clean
index 65b03d10eada06cf3c130d4f182022b25a068d1fba84374de29856a174aaae4b..9a27508be41f328dfee903a8f5b8bfb5c90d4186f22d16d0e15db9bc2afe90ef 100755 (executable)
--- a/c/clean
+++ b/c/clean
@@ -2,6 +2,7 @@
 
 cd "$(dirname "$(realpath -- "$0")")"
 cmd/clean
+conf/clean
 doc/clean
 lib/clean
 exec rm -f compile_flags.txt
index ffcde751e0523fca581b4fe8432b626991586e08a2702678ce62f0f089a334d6..7b6198f6e4647a47ce536916f53594c796c6198c7fe90d6b658517543c04a0ec 100644 (file)
@@ -1 +1,2 @@
+/objcopy
 /version
diff --git a/c/conf/clean b/c/conf/clean
new file mode 100755 (executable)
index 0000000..b58141a
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh -e
+
+rm -f objcopy version
diff --git a/c/conf/objcopy.do b/c/conf/objcopy.do
new file mode 100644 (file)
index 0000000..46791cd
--- /dev/null
@@ -0,0 +1,3 @@
+command -v llvm-objcopy 2>/dev/null ||
+command -v objcopy 2>/dev/null ||
+echo :
index 437e92a6f5c16f294213f9ce39db5102a3a46fb3f5561c455d8a6bb18a222495..f0ffecb466da3ad7307c98fa1276e68ffb9720b3bff99b0efa1b6aa97c90435d 100644 (file)
@@ -1,6 +1,8 @@
 redo-ifchange o.list
 objs=$(cat o.list)
-redo-ifchange $objs ../../conf/ar
+redo-ifchange $objs ../../conf/ar ../../conf/objcopy
 read AR <../../conf/ar
 $AR -rcs $3.a $objs
+read OBJCOPY <../../conf/objcopy
+$OBJCOPY --enable-deterministic-archives $3.a
 mv $3.a $3
index 0d627bd4a1f5732f036a07222046f71be6c54bd5045cdbaa6b2323a1a2769851..8d1012c31476d69b9f879ff8350640ebef65871b5d851a478d3bcc69de3d35fc 100644 (file)
@@ -1,6 +1,8 @@
 redo-ifchange o.list
 objs=$(cat o.list)
-redo-ifchange $objs ../conf/ar
+redo-ifchange $objs ../conf/ar ../conf/objcopy
 read AR <../conf/ar
 $AR -rcs $3.a $objs
+read OBJCOPY <../conf/objcopy
+$OBJCOPY --enable-deterministic-archives $3.a
 mv $3.a $3