]> xenbits.xensource.com Git - xen.git/commitdiff
etherboot: [build] sort objects in blib.a
authorOlaf Hering <olaf@aepfle.de>
Tue, 3 Feb 2015 11:45:36 +0000 (12:45 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Tue, 24 Feb 2015 16:19:19 +0000 (16:19 +0000)
When building hvmloader for Xen tools the ipxe objects are also linked
into the binary. Unfortunately the linker will place them in the order
found in the archive. Since this order is random the resulting hvmloader
binary differs when it was built from identical sources but on different
build hosts. To help with creating a reproducible binary the elements in
blib.a must simply be sorted before passing them to $(AR).

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/firmware/etherboot/patches/build-compare.patch [new file with mode: 0644]
tools/firmware/etherboot/patches/series

diff --git a/tools/firmware/etherboot/patches/build-compare.patch b/tools/firmware/etherboot/patches/build-compare.patch
new file mode 100644 (file)
index 0000000..d41f68b
--- /dev/null
@@ -0,0 +1,19 @@
+The result of $(wildcard *) is random.
+Sort input files to reduce build-compare noise.
+---
+ ipxe/src/Makefile.housekeeping |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: ipxe/src/Makefile.housekeeping
+===================================================================
+--- ipxe/src/Makefile.housekeeping
++++ ipxe/src/Makefile.housekeeping
+@@ -773,7 +773,7 @@ BLIB               = $(BIN)/blib.a
+ $(BLIB) : $(BLIB_OBJS) $(BLIB_LIST) $(MAKEDEPS)
+       $(Q)$(RM) $(BLIB)
+       $(QM)$(ECHO) "  [AR] $@"
+-      $(Q)$(AR) r $@ $(BLIB_OBJS)
++      $(Q)$(AR) r $@ $(sort $(BLIB_OBJS))
+       $(Q)$(RANLIB) $@
+ blib : $(BLIB)
index 5bd7df8090db2ea8c9d09eb3c3eebb03c85accb5..7512c14652c3ae239a730c4a89521f798af5ed9b 100644 (file)
@@ -2,3 +2,4 @@ boot_prompt_option.patch
 build_fix_1.patch
 build_fix_2.patch
 build_fix_3.patch
+build-compare.patch