[Xen-devel] [PATCH 3/3] mini-os: sort objects in binary archives

2015-02-03 Thread Olaf Hering
When building stubdom the mini-os 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 stubdom binary
differs when it was built from identical sources but on different
build hosts. To help with creating a reproducible binary the elements
in an archive must simply be sorted before passing them to $(AR).

Signed-off-by: Olaf Hering 
Cc: Stefano Stabellini 
Cc: Samuel Thibault 
---
 extras/mini-os/Makefile  | 4 ++--
 extras/mini-os/arch/x86/Makefile | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/extras/mini-os/Makefile b/extras/mini-os/Makefile
index 6d6537e..fad016c 100644
--- a/extras/mini-os/Makefile
+++ b/extras/mini-os/Makefile
@@ -148,9 +148,9 @@ arch_lib:
 
 ifeq ($(CONFIG_LWIP),y)
 # lwIP library
-LWC:= $(shell find $(LWIPDIR)/src -type f -name '*.c')
+LWC:= $(sort $(shell find $(LWIPDIR)/src -type f -name '*.c'))
 LWC:= $(filter-out %6.c %ip6_addr.c %ethernetif.c, $(LWC))
-LWO:= $(patsubst %.c,%.o,$(LWC))
+LWO:= $(patsubst %.c,%.o,$(LWC)
 LWO+= $(OBJ_DIR)/lwip-arch.o
 ifeq ($(CONFIG_NETFRONT),y)
 LWO += $(OBJ_DIR)/lwip-net.o
diff --git a/extras/mini-os/arch/x86/Makefile b/extras/mini-os/arch/x86/Makefile
index 1073e36..dc55291 100644
--- a/extras/mini-os/arch/x86/Makefile
+++ b/extras/mini-os/arch/x86/Makefile
@@ -14,7 +14,7 @@ include ../../minios.mk
 
 # Sources here are all *.c *.S without $(XEN_TARGET_ARCH).S
 # This is handled in $(HEAD_ARCH_OBJ)
-ARCH_SRCS := $(wildcard *.c)
+ARCH_SRCS := $(sort $(wildcard *.c))
 
 # The objects built from the sources.
 ARCH_OBJS := $(patsubst %.c,$(OBJ_DIR)/%.o,$(ARCH_SRCS))

___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH 3/3] mini-os: sort objects in binary archives

2015-02-03 Thread Olaf Hering
On Tue, Feb 03, Olaf Hering wrote:

> +++ b/extras/mini-os/Makefile

> -LWO  := $(patsubst %.c,%.o,$(LWC))
> +LWO  := $(patsubst %.c,%.o,$(LWC)

Somehow this brace disappeared. Should I resend or can this be adjusted
when the patch gets merged?

Olaf

___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH 3/3] mini-os: sort objects in binary archives

2015-02-03 Thread Jan Beulich
>>> On 03.02.15 at 12:45,  wrote:
> --- a/extras/mini-os/Makefile
> +++ b/extras/mini-os/Makefile
> @@ -148,9 +148,9 @@ arch_lib:
>  
>  ifeq ($(CONFIG_LWIP),y)
>  # lwIP library
> -LWC  := $(shell find $(LWIPDIR)/src -type f -name '*.c')
> +LWC  := $(sort $(shell find $(LWIPDIR)/src -type f -name '*.c'))
>  LWC  := $(filter-out %6.c %ip6_addr.c %ethernetif.c, $(LWC))
> -LWO  := $(patsubst %.c,%.o,$(LWC))
> +LWO  := $(patsubst %.c,%.o,$(LWC)

This looks broken.

Jan


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH 3/3] mini-os: sort objects in binary archives

2015-02-04 Thread Samuel Thibault
Olaf Hering, le Tue 03 Feb 2015 12:45:37 +0100, a écrit :
> When building stubdom the mini-os 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 stubdom binary
> differs when it was built from identical sources but on different
> build hosts. To help with creating a reproducible binary the elements
> in an archive must simply be sorted before passing them to $(AR).
> 
> Signed-off-by: Olaf Hering 
> Cc: Stefano Stabellini 
> Cc: Samuel Thibault 

Provided that the missing parenthesis gets fixed,

Acked-by: Samuel Thibault 

> ---
>  extras/mini-os/Makefile  | 4 ++--
>  extras/mini-os/arch/x86/Makefile | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/extras/mini-os/Makefile b/extras/mini-os/Makefile
> index 6d6537e..fad016c 100644
> --- a/extras/mini-os/Makefile
> +++ b/extras/mini-os/Makefile
> @@ -148,9 +148,9 @@ arch_lib:
>  
>  ifeq ($(CONFIG_LWIP),y)
>  # lwIP library
> -LWC  := $(shell find $(LWIPDIR)/src -type f -name '*.c')
> +LWC  := $(sort $(shell find $(LWIPDIR)/src -type f -name '*.c'))
>  LWC  := $(filter-out %6.c %ip6_addr.c %ethernetif.c, $(LWC))
> -LWO  := $(patsubst %.c,%.o,$(LWC))
> +LWO  := $(patsubst %.c,%.o,$(LWC)
>  LWO  += $(OBJ_DIR)/lwip-arch.o
>  ifeq ($(CONFIG_NETFRONT),y)
>  LWO += $(OBJ_DIR)/lwip-net.o
> diff --git a/extras/mini-os/arch/x86/Makefile 
> b/extras/mini-os/arch/x86/Makefile
> index 1073e36..dc55291 100644
> --- a/extras/mini-os/arch/x86/Makefile
> +++ b/extras/mini-os/arch/x86/Makefile
> @@ -14,7 +14,7 @@ include ../../minios.mk
>  
>  # Sources here are all *.c *.S without $(XEN_TARGET_ARCH).S
>  # This is handled in $(HEAD_ARCH_OBJ)
> -ARCH_SRCS := $(wildcard *.c)
> +ARCH_SRCS := $(sort $(wildcard *.c))
>  
>  # The objects built from the sources.
>  ARCH_OBJS := $(patsubst %.c,$(OBJ_DIR)/%.o,$(ARCH_SRCS))
> 

-- 
Samuel
 > Subject: pb fvwm95-2 comment l'installer le compiler???
 > Merci d'avance
 je te conseille d'être un peu plus précis dans l'exposé de ton pb...
 -+- EJ in guide du linuxien pervers :"Les modéros sont sympas !" -+-

___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH 3/3] mini-os: sort objects in binary archives

2015-02-05 Thread Ian Campbell
On Tue, 2015-02-03 at 12:45 +0100, Olaf Hering wrote:
> When building stubdom the mini-os 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 stubdom binary
> differs when it was built from identical sources but on different
> build hosts. To help with creating a reproducible binary the elements
> in an archive must simply be sorted before passing them to $(AR).

OOI why does this problem not also apply the to the regular .a and .so
files we build?



___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH 3/3] mini-os: sort objects in binary archives

2015-02-11 Thread Wei Liu
On Tue, Feb 03, 2015 at 01:28:54PM +0100, Olaf Hering wrote:
> On Tue, Feb 03, Olaf Hering wrote:
> 
> > +++ b/extras/mini-os/Makefile
> 
> > -LWO:= $(patsubst %.c,%.o,$(LWC))
> > +LWO:= $(patsubst %.c,%.o,$(LWC)
> 
> Somehow this brace disappeared. Should I resend or can this be adjusted
> when the patch gets merged?
> 

FWIW I can carry this patch in my series to split off mini-os if
necessary. I need to rerun the extraction process anyway to include
this patch. I would rather commence the splitting off sooner rather than
later.

Or we can commit this patch as soon as possible. It looks OK to
me apart from the minor error.

Otherwise we can commence splitting off and then apply this patch to the
split-off mini-os tree.

Wei.

> Olaf
> 
> ___
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH 3/3] mini-os: sort objects in binary archives

2015-02-16 Thread Olaf Hering
On Thu, Feb 05, Ian Campbell wrote:

> On Tue, 2015-02-03 at 12:45 +0100, Olaf Hering wrote:
> > When building stubdom the mini-os 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 stubdom binary
> > differs when it was built from identical sources but on different
> > build hosts. To help with creating a reproducible binary the elements
> > in an archive must simply be sorted before passing them to $(AR).
> 
> OOI why does this problem not also apply the to the regular .a and .so
> files we build?

Either because they are built from a fixed list of input files, or the
linker places the individual object files in a fixed order into shared objects.

Olaf

___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH 3/3] mini-os: sort objects in binary archives

2015-02-27 Thread Ian Campbell
On Wed, 2015-02-11 at 11:37 +, Wei Liu wrote:
> Otherwise we can commence splitting off and then apply this patch to the
> split-off mini-os tree.

mini-os has just been split off, minus this patch.

I intend to let the push gate process that split (hopefully the gate
will pass over the w/e) and then apply this patch as the first fresh
commit in the new tree, which will help check all the bits are in place
etc.

I can adjust the paths and fix missing bracket as I go. I'll also update
MINIOS_UPSTREAM_REVISION in xen.git to the new thing.

Ian.



___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH 3/3] mini-os: sort objects in binary archives

2015-03-11 Thread Ian Campbell
On Thu, 2015-02-05 at 01:22 +0100, Samuel Thibault wrote:
> Olaf Hering, le Tue 03 Feb 2015 12:45:37 +0100, a écrit :
> > When building stubdom the mini-os 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 stubdom binary
> > differs when it was built from identical sources but on different
> > build hosts. To help with creating a reproducible binary the elements
> > in an archive must simply be sorted before passing them to $(AR).
> > 
> > Signed-off-by: Olaf Hering 
> > Cc: Stefano Stabellini 
> > Cc: Samuel Thibault 
> 
> Provided that the missing parenthesis gets fixed,
> 
> Acked-by: Samuel Thibault 

I did s,extras/mini-os/,, on the paths and applied to mini-os.git.

I also pushed to xen.git (which includes Wei's build fix too):

commit 00f1fc5fd2bb9c7cf7f0e8a841ee741e547a4145
Author: Ian Campbell 
Date:   Wed Mar 11 10:47:33 2015 +

MINIOS_UPSTREAM_REVISION Update

Signed-off-by: Ian Campbell 

diff --git a/Config.mk b/Config.mk
index c0c0775..f457b5d 100644
--- a/Config.mk
+++ b/Config.mk
@@ -255,9 +255,9 @@ MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 endif
 OVMF_UPSTREAM_REVISION ?= a065efc7c7ce8bb3e5cb3e463099d023d4a92927
 QEMU_UPSTREAM_REVISION ?= master
-MINIOS_UPSTREAM_REVISION ?= 55f7cd7427ef3e7fe3563a3da46d8664a2ed0d6d
-# Thu Jan 29 19:10:04 2015 +
-# Mini-OS: standalone build
+MINIOS_UPSTREAM_REVISION ?= d0b7f0f62fd0e1154d29849b9f2e6de3783742ce
+# Tue Mar 10 13:14:38 2015 +
+# mini-os: replace XEN_TARGET_ARCH with MINIOS_TARGET_ARCH
 
 SEABIOS_UPSTREAM_REVISION ?= rel-1.8.0
 # Wed Feb 18 12:49:59 2015 -0500



___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel