[PATCH] Enable deterministic archives

Sebastian Huber sebastian.huber at embedded-brains.de
Tue Feb 5 08:00:08 UTC 2013


The GNU AR program as a 'D' option
(http://sourceware.org/binutils/docs/binutils/ar-cmdline.html#ar-cmdline):

[...]
`D'
    Operate in deterministic mode. When adding files and the archive
index use zero for UIDs, GIDs, timestamps, and use consistent file modes
for all files. When this option is used, if ar is used with identical
options and identical input files, multiple runs will create identical
output files regardless of the input files' owners, groups, file modes,
or modification times.

    If binutils was configured with --enable-deterministic-archives,
then this mode is on by default. It can be disabled with the `U'
modifier, below.
[...]

This helps to avoid artificial differences in archives and thus makes it
easier to use version control for archives (e.g. static libraries).
---
 binutils/build.add                                 |    3 +++
 .../arm/rtems-4.11-arm-rtemseabi4.11-binutils.spec |    3 +++
 .../avr/rtems-4.11-avr-rtems4.11-binutils.spec     |    3 +++
 .../bfin/rtems-4.11-bfin-rtems4.11-binutils.spec   |    3 +++
 .../h8300/rtems-4.11-h8300-rtems4.11-binutils.spec |    3 +++
 .../i386/rtems-4.11-i386-rtems4.11-binutils.spec   |    3 +++
 .../lm32/rtems-4.11-lm32-rtems4.11-binutils.spec   |    3 +++
 .../m32c/rtems-4.11-m32c-rtems4.11-binutils.spec   |    3 +++
 .../m32r/rtems-4.11-m32r-rtems4.11-binutils.spec   |    3 +++
 .../m68k/rtems-4.11-m68k-rtems4.11-binutils.spec   |    3 +++
 .../rtems-4.11-microblaze-rtems4.11-binutils.spec  |    3 +++
 .../mips/rtems-4.11-mips-rtems4.11-binutils.spec   |    3 +++
 .../rtems-4.11-powerpc-rtems4.11-binutils.spec     |    3 +++
 rtems4.11/sh/rtems-4.11-sh-rtems4.11-binutils.spec |    3 +++
 .../sparc/rtems-4.11-sparc-rtems4.11-binutils.spec |    3 +++
 .../rtems-4.11-sparc64-rtems4.11-binutils.spec     |    3 +++
 .../v850/rtems-4.11-v850-rtems4.11-binutils.spec   |    3 +++
 17 files changed, 51 insertions(+), 0 deletions(-)

diff --git a/binutils/build.add b/binutils/build.add
index 16cb5bb..0b841e0 100644
--- a/binutils/build.add
+++ b/binutils/build.add
@@ -15,6 +15,9 @@
     --without-included-gettext \
     --disable-win32-registry \
     --disable-werror \
+%if "%{binutils_version}" >= "2.23"
+    --enable-deterministic-archives \
+%endif
     --with-sysroot=%{_prefix}/@tool_target@/sys-root \
     --prefix=%{_prefix} --bindir=%{_bindir} \
     --exec-prefix=%{_exec_prefix} \
diff --git a/rtems4.11/arm/rtems-4.11-arm-rtemseabi4.11-binutils.spec b/rtems4.11/arm/rtems-4.11-arm-rtemseabi4.11-binutils.spec
index cfbc6ba..55cd8bd 100644
--- a/rtems4.11/arm/rtems-4.11-arm-rtemseabi4.11-binutils.spec
+++ b/rtems4.11/arm/rtems-4.11-arm-rtemseabi4.11-binutils.spec
@@ -107,6 +107,9 @@ cd ..
     --without-included-gettext \
     --disable-win32-registry \
     --disable-werror \
+%if "%{binutils_version}" >= "2.23"
+    --enable-deterministic-archives \
+%endif
     --prefix=%{_prefix} --bindir=%{_bindir} \
     --exec-prefix=%{_exec_prefix} \
     --includedir=%{_includedir} --libdir=%{_libdir} \
diff --git a/rtems4.11/avr/rtems-4.11-avr-rtems4.11-binutils.spec b/rtems4.11/avr/rtems-4.11-avr-rtems4.11-binutils.spec
index 51ee5ee..ac5ea3b 100644
--- a/rtems4.11/avr/rtems-4.11-avr-rtems4.11-binutils.spec
+++ b/rtems4.11/avr/rtems-4.11-avr-rtems4.11-binutils.spec
@@ -107,6 +107,9 @@ cd ..
     --without-included-gettext \
     --disable-win32-registry \
     --disable-werror \
+%if "%{binutils_version}" >= "2.23"
+    --enable-deterministic-archives \
+%endif
     --prefix=%{_prefix} --bindir=%{_bindir} \
     --exec-prefix=%{_exec_prefix} \
     --includedir=%{_includedir} --libdir=%{_libdir} \
diff --git a/rtems4.11/bfin/rtems-4.11-bfin-rtems4.11-binutils.spec b/rtems4.11/bfin/rtems-4.11-bfin-rtems4.11-binutils.spec
index 171d2d3..210a8d3 100644
--- a/rtems4.11/bfin/rtems-4.11-bfin-rtems4.11-binutils.spec
+++ b/rtems4.11/bfin/rtems-4.11-bfin-rtems4.11-binutils.spec
@@ -107,6 +107,9 @@ cd ..
     --without-included-gettext \
     --disable-win32-registry \
     --disable-werror \
+%if "%{binutils_version}" >= "2.23"
+    --enable-deterministic-archives \
+%endif
     --prefix=%{_prefix} --bindir=%{_bindir} \
     --exec-prefix=%{_exec_prefix} \
     --includedir=%{_includedir} --libdir=%{_libdir} \
diff --git a/rtems4.11/h8300/rtems-4.11-h8300-rtems4.11-binutils.spec b/rtems4.11/h8300/rtems-4.11-h8300-rtems4.11-binutils.spec
index 494f18e..196bfc2 100644
--- a/rtems4.11/h8300/rtems-4.11-h8300-rtems4.11-binutils.spec
+++ b/rtems4.11/h8300/rtems-4.11-h8300-rtems4.11-binutils.spec
@@ -107,6 +107,9 @@ cd ..
     --without-included-gettext \
     --disable-win32-registry \
     --disable-werror \
+%if "%{binutils_version}" >= "2.23"
+    --enable-deterministic-archives \
+%endif
     --prefix=%{_prefix} --bindir=%{_bindir} \
     --exec-prefix=%{_exec_prefix} \
     --includedir=%{_includedir} --libdir=%{_libdir} \
diff --git a/rtems4.11/i386/rtems-4.11-i386-rtems4.11-binutils.spec b/rtems4.11/i386/rtems-4.11-i386-rtems4.11-binutils.spec
index c6c3b24..c0bfbbb 100644
--- a/rtems4.11/i386/rtems-4.11-i386-rtems4.11-binutils.spec
+++ b/rtems4.11/i386/rtems-4.11-i386-rtems4.11-binutils.spec
@@ -107,6 +107,9 @@ cd ..
     --without-included-gettext \
     --disable-win32-registry \
     --disable-werror \
+%if "%{binutils_version}" >= "2.23"
+    --enable-deterministic-archives \
+%endif
     --prefix=%{_prefix} --bindir=%{_bindir} \
     --exec-prefix=%{_exec_prefix} \
     --includedir=%{_includedir} --libdir=%{_libdir} \
diff --git a/rtems4.11/lm32/rtems-4.11-lm32-rtems4.11-binutils.spec b/rtems4.11/lm32/rtems-4.11-lm32-rtems4.11-binutils.spec
index 5295447..5caf039 100644
--- a/rtems4.11/lm32/rtems-4.11-lm32-rtems4.11-binutils.spec
+++ b/rtems4.11/lm32/rtems-4.11-lm32-rtems4.11-binutils.spec
@@ -107,6 +107,9 @@ cd ..
     --without-included-gettext \
     --disable-win32-registry \
     --disable-werror \
+%if "%{binutils_version}" >= "2.23"
+    --enable-deterministic-archives \
+%endif
     --prefix=%{_prefix} --bindir=%{_bindir} \
     --exec-prefix=%{_exec_prefix} \
     --includedir=%{_includedir} --libdir=%{_libdir} \
diff --git a/rtems4.11/m32c/rtems-4.11-m32c-rtems4.11-binutils.spec b/rtems4.11/m32c/rtems-4.11-m32c-rtems4.11-binutils.spec
index 8847618..7995046 100644
--- a/rtems4.11/m32c/rtems-4.11-m32c-rtems4.11-binutils.spec
+++ b/rtems4.11/m32c/rtems-4.11-m32c-rtems4.11-binutils.spec
@@ -107,6 +107,9 @@ cd ..
     --without-included-gettext \
     --disable-win32-registry \
     --disable-werror \
+%if "%{binutils_version}" >= "2.23"
+    --enable-deterministic-archives \
+%endif
     --prefix=%{_prefix} --bindir=%{_bindir} \
     --exec-prefix=%{_exec_prefix} \
     --includedir=%{_includedir} --libdir=%{_libdir} \
diff --git a/rtems4.11/m32r/rtems-4.11-m32r-rtems4.11-binutils.spec b/rtems4.11/m32r/rtems-4.11-m32r-rtems4.11-binutils.spec
index 4262f70..3b87c6d 100644
--- a/rtems4.11/m32r/rtems-4.11-m32r-rtems4.11-binutils.spec
+++ b/rtems4.11/m32r/rtems-4.11-m32r-rtems4.11-binutils.spec
@@ -107,6 +107,9 @@ cd ..
     --without-included-gettext \
     --disable-win32-registry \
     --disable-werror \
+%if "%{binutils_version}" >= "2.23"
+    --enable-deterministic-archives \
+%endif
     --prefix=%{_prefix} --bindir=%{_bindir} \
     --exec-prefix=%{_exec_prefix} \
     --includedir=%{_includedir} --libdir=%{_libdir} \
diff --git a/rtems4.11/m68k/rtems-4.11-m68k-rtems4.11-binutils.spec b/rtems4.11/m68k/rtems-4.11-m68k-rtems4.11-binutils.spec
index 68098a8..05674a3 100644
--- a/rtems4.11/m68k/rtems-4.11-m68k-rtems4.11-binutils.spec
+++ b/rtems4.11/m68k/rtems-4.11-m68k-rtems4.11-binutils.spec
@@ -107,6 +107,9 @@ cd ..
     --without-included-gettext \
     --disable-win32-registry \
     --disable-werror \
+%if "%{binutils_version}" >= "2.23"
+    --enable-deterministic-archives \
+%endif
     --prefix=%{_prefix} --bindir=%{_bindir} \
     --exec-prefix=%{_exec_prefix} \
     --includedir=%{_includedir} --libdir=%{_libdir} \
diff --git a/rtems4.11/microblaze/rtems-4.11-microblaze-rtems4.11-binutils.spec b/rtems4.11/microblaze/rtems-4.11-microblaze-rtems4.11-binutils.spec
index 28e4897..9d499b6 100644
--- a/rtems4.11/microblaze/rtems-4.11-microblaze-rtems4.11-binutils.spec
+++ b/rtems4.11/microblaze/rtems-4.11-microblaze-rtems4.11-binutils.spec
@@ -107,6 +107,9 @@ cd ..
     --without-included-gettext \
     --disable-win32-registry \
     --disable-werror \
+%if "%{binutils_version}" >= "2.23"
+    --enable-deterministic-archives \
+%endif
     --prefix=%{_prefix} --bindir=%{_bindir} \
     --exec-prefix=%{_exec_prefix} \
     --includedir=%{_includedir} --libdir=%{_libdir} \
diff --git a/rtems4.11/mips/rtems-4.11-mips-rtems4.11-binutils.spec b/rtems4.11/mips/rtems-4.11-mips-rtems4.11-binutils.spec
index d9725ee..127a1af 100644
--- a/rtems4.11/mips/rtems-4.11-mips-rtems4.11-binutils.spec
+++ b/rtems4.11/mips/rtems-4.11-mips-rtems4.11-binutils.spec
@@ -107,6 +107,9 @@ cd ..
     --without-included-gettext \
     --disable-win32-registry \
     --disable-werror \
+%if "%{binutils_version}" >= "2.23"
+    --enable-deterministic-archives \
+%endif
     --prefix=%{_prefix} --bindir=%{_bindir} \
     --exec-prefix=%{_exec_prefix} \
     --includedir=%{_includedir} --libdir=%{_libdir} \
diff --git a/rtems4.11/powerpc/rtems-4.11-powerpc-rtems4.11-binutils.spec b/rtems4.11/powerpc/rtems-4.11-powerpc-rtems4.11-binutils.spec
index 9c1dba7..f4150f1 100644
--- a/rtems4.11/powerpc/rtems-4.11-powerpc-rtems4.11-binutils.spec
+++ b/rtems4.11/powerpc/rtems-4.11-powerpc-rtems4.11-binutils.spec
@@ -107,6 +107,9 @@ cd ..
     --without-included-gettext \
     --disable-win32-registry \
     --disable-werror \
+%if "%{binutils_version}" >= "2.23"
+    --enable-deterministic-archives \
+%endif
     --prefix=%{_prefix} --bindir=%{_bindir} \
     --exec-prefix=%{_exec_prefix} \
     --includedir=%{_includedir} --libdir=%{_libdir} \
diff --git a/rtems4.11/sh/rtems-4.11-sh-rtems4.11-binutils.spec b/rtems4.11/sh/rtems-4.11-sh-rtems4.11-binutils.spec
index f53e873..7d0e96f 100644
--- a/rtems4.11/sh/rtems-4.11-sh-rtems4.11-binutils.spec
+++ b/rtems4.11/sh/rtems-4.11-sh-rtems4.11-binutils.spec
@@ -107,6 +107,9 @@ cd ..
     --without-included-gettext \
     --disable-win32-registry \
     --disable-werror \
+%if "%{binutils_version}" >= "2.23"
+    --enable-deterministic-archives \
+%endif
     --prefix=%{_prefix} --bindir=%{_bindir} \
     --exec-prefix=%{_exec_prefix} \
     --includedir=%{_includedir} --libdir=%{_libdir} \
diff --git a/rtems4.11/sparc/rtems-4.11-sparc-rtems4.11-binutils.spec b/rtems4.11/sparc/rtems-4.11-sparc-rtems4.11-binutils.spec
index 07911b4..dd516d0 100644
--- a/rtems4.11/sparc/rtems-4.11-sparc-rtems4.11-binutils.spec
+++ b/rtems4.11/sparc/rtems-4.11-sparc-rtems4.11-binutils.spec
@@ -107,6 +107,9 @@ cd ..
     --without-included-gettext \
     --disable-win32-registry \
     --disable-werror \
+%if "%{binutils_version}" >= "2.23"
+    --enable-deterministic-archives \
+%endif
     --prefix=%{_prefix} --bindir=%{_bindir} \
     --exec-prefix=%{_exec_prefix} \
     --includedir=%{_includedir} --libdir=%{_libdir} \
diff --git a/rtems4.11/sparc64/rtems-4.11-sparc64-rtems4.11-binutils.spec b/rtems4.11/sparc64/rtems-4.11-sparc64-rtems4.11-binutils.spec
index 58534cd..72ead40 100644
--- a/rtems4.11/sparc64/rtems-4.11-sparc64-rtems4.11-binutils.spec
+++ b/rtems4.11/sparc64/rtems-4.11-sparc64-rtems4.11-binutils.spec
@@ -107,6 +107,9 @@ cd ..
     --without-included-gettext \
     --disable-win32-registry \
     --disable-werror \
+%if "%{binutils_version}" >= "2.23"
+    --enable-deterministic-archives \
+%endif
     --prefix=%{_prefix} --bindir=%{_bindir} \
     --exec-prefix=%{_exec_prefix} \
     --includedir=%{_includedir} --libdir=%{_libdir} \
diff --git a/rtems4.11/v850/rtems-4.11-v850-rtems4.11-binutils.spec b/rtems4.11/v850/rtems-4.11-v850-rtems4.11-binutils.spec
index ca2add8..685fe10 100644
--- a/rtems4.11/v850/rtems-4.11-v850-rtems4.11-binutils.spec
+++ b/rtems4.11/v850/rtems-4.11-v850-rtems4.11-binutils.spec
@@ -107,6 +107,9 @@ cd ..
     --without-included-gettext \
     --disable-win32-registry \
     --disable-werror \
+%if "%{binutils_version}" >= "2.23"
+    --enable-deterministic-archives \
+%endif
     --prefix=%{_prefix} --bindir=%{_bindir} \
     --exec-prefix=%{_exec_prefix} \
     --includedir=%{_includedir} --libdir=%{_libdir} \
-- 
1.7.7




More information about the devel mailing list