* [MINIOS PATCH] build: prepend OBJ_DIR to linker script
@ 2016-12-13 15:02 Wei Liu
2016-12-13 15:17 ` Wei Liu
2016-12-13 15:18 ` Juergen Gross
0 siblings, 2 replies; 5+ messages in thread
From: Wei Liu @ 2016-12-13 15:02 UTC (permalink / raw)
To: Minios-devel; +Cc: Juergen Gross, Xen-devel, Wei Liu, Samuel Thibault
After 5623e2d2 ("x86: use unified linker script") the linker script for
x86 build is generated. But the special rule to generate linker script
doesn't have OBJ_DIR prepended so in parallel build the same file is
written multiple times. This is racy and would cause parallel build to
fail.
Fix this by prepending OBJ_DIR to the path of linker script. Change
other variables where necessary.
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
Makefile | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index 1d2324c..74f2c31 100644
--- a/Makefile
+++ b/Makefile
@@ -24,7 +24,7 @@ include minios.mk
LDLIBS :=
APP_LDLIBS :=
LDARCHLIB := -L$(OBJ_DIR)/$(TARGET_ARCH_DIR) -l$(ARCH_LIB_NAME)
-LDFLAGS_FINAL := -T $(TARGET_ARCH_DIR)/minios-$(MINIOS_TARGET_ARCH).lds $(ARCH_LDFLAGS_FINAL)
+LDFLAGS_FINAL := -T $(OBJ_DIR)/$(TARGET_ARCH_DIR)/minios-$(MINIOS_TARGET_ARCH).lds $(ARCH_LDFLAGS_FINAL)
# Prefix for global API names. All other symbols are localised before
# linking with EXTRA_OBJS.
@@ -156,10 +156,10 @@ APP_O=$(OBJ_DIR)/$(TARGET)_app.o
endif
# Special rule for x86 for now
-arch/x86/minios-x86%.lds: arch/x86/minios-x86.lds.S
+$(OBJ_DIR)/arch/x86/minios-x86%.lds: arch/x86/minios-x86.lds.S
$(CPP) $(ASFLAGS) -P $< -o $@
-$(OBJ_DIR)/$(TARGET): $(OBJS) $(APP_O) arch_lib $(TARGET_ARCH_DIR)/minios-$(MINIOS_TARGET_ARCH).lds
+$(OBJ_DIR)/$(TARGET): $(OBJS) $(APP_O) arch_lib $(OBJ_DIR)/$(TARGET_ARCH_DIR)/minios-$(MINIOS_TARGET_ARCH).lds
$(LD) -r $(LDFLAGS) $(HEAD_OBJ) $(APP_O) $(OBJS) $(LDARCHLIB) $(LDLIBS) -o $@.o
$(OBJCOPY) -w -G $(GLOBAL_PREFIX)* -G _start $@.o $@.o
$(LD) $(LDFLAGS) $(LDFLAGS_FINAL) $@.o $(EXTRA_OBJS) -o $@
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [MINIOS PATCH] build: prepend OBJ_DIR to linker script
2016-12-13 15:02 [MINIOS PATCH] build: prepend OBJ_DIR to linker script Wei Liu
@ 2016-12-13 15:17 ` Wei Liu
2016-12-13 15:18 ` Juergen Gross
1 sibling, 0 replies; 5+ messages in thread
From: Wei Liu @ 2016-12-13 15:17 UTC (permalink / raw)
To: Minios-devel; +Cc: Juergen Gross, Xen-devel, Wei Liu, Samuel Thibault
On Tue, Dec 13, 2016 at 03:02:02PM +0000, Wei Liu wrote:
> After 5623e2d2 ("x86: use unified linker script") the linker script for
> x86 build is generated. But the special rule to generate linker script
> doesn't have OBJ_DIR prepended so in parallel build the same file is
> written multiple times. This is racy and would cause parallel build to
> fail.
>
> Fix this by prepending OBJ_DIR to the path of linker script. Change
> other variables where necessary.
>
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
This also needs to be backported to 4.8.
> ---
> Makefile | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 1d2324c..74f2c31 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -24,7 +24,7 @@ include minios.mk
> LDLIBS :=
> APP_LDLIBS :=
> LDARCHLIB := -L$(OBJ_DIR)/$(TARGET_ARCH_DIR) -l$(ARCH_LIB_NAME)
> -LDFLAGS_FINAL := -T $(TARGET_ARCH_DIR)/minios-$(MINIOS_TARGET_ARCH).lds $(ARCH_LDFLAGS_FINAL)
> +LDFLAGS_FINAL := -T $(OBJ_DIR)/$(TARGET_ARCH_DIR)/minios-$(MINIOS_TARGET_ARCH).lds $(ARCH_LDFLAGS_FINAL)
>
> # Prefix for global API names. All other symbols are localised before
> # linking with EXTRA_OBJS.
> @@ -156,10 +156,10 @@ APP_O=$(OBJ_DIR)/$(TARGET)_app.o
> endif
>
> # Special rule for x86 for now
> -arch/x86/minios-x86%.lds: arch/x86/minios-x86.lds.S
> +$(OBJ_DIR)/arch/x86/minios-x86%.lds: arch/x86/minios-x86.lds.S
> $(CPP) $(ASFLAGS) -P $< -o $@
>
> -$(OBJ_DIR)/$(TARGET): $(OBJS) $(APP_O) arch_lib $(TARGET_ARCH_DIR)/minios-$(MINIOS_TARGET_ARCH).lds
> +$(OBJ_DIR)/$(TARGET): $(OBJS) $(APP_O) arch_lib $(OBJ_DIR)/$(TARGET_ARCH_DIR)/minios-$(MINIOS_TARGET_ARCH).lds
> $(LD) -r $(LDFLAGS) $(HEAD_OBJ) $(APP_O) $(OBJS) $(LDARCHLIB) $(LDLIBS) -o $@.o
> $(OBJCOPY) -w -G $(GLOBAL_PREFIX)* -G _start $@.o $@.o
> $(LD) $(LDFLAGS) $(LDFLAGS_FINAL) $@.o $(EXTRA_OBJS) -o $@
> --
> 2.1.4
>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [MINIOS PATCH] build: prepend OBJ_DIR to linker script
2016-12-13 15:02 [MINIOS PATCH] build: prepend OBJ_DIR to linker script Wei Liu
2016-12-13 15:17 ` Wei Liu
@ 2016-12-13 15:18 ` Juergen Gross
2016-12-13 21:49 ` Samuel Thibault
1 sibling, 1 reply; 5+ messages in thread
From: Juergen Gross @ 2016-12-13 15:18 UTC (permalink / raw)
To: Wei Liu, Minios-devel; +Cc: Xen-devel, Samuel Thibault
On 13/12/16 16:02, Wei Liu wrote:
> After 5623e2d2 ("x86: use unified linker script") the linker script for
> x86 build is generated. But the special rule to generate linker script
> doesn't have OBJ_DIR prepended so in parallel build the same file is
> written multiple times. This is racy and would cause parallel build to
> fail.
>
> Fix this by prepending OBJ_DIR to the path of linker script. Change
> other variables where necessary.
>
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Juergen
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [MINIOS PATCH] build: prepend OBJ_DIR to linker script
2016-12-13 15:18 ` Juergen Gross
@ 2016-12-13 21:49 ` Samuel Thibault
2016-12-14 14:40 ` Wei Liu
0 siblings, 1 reply; 5+ messages in thread
From: Samuel Thibault @ 2016-12-13 21:49 UTC (permalink / raw)
To: Juergen Gross; +Cc: Minios-devel, Xen-devel, Wei Liu
Juergen Gross, on Tue 13 Dec 2016 16:18:07 +0100, wrote:
> On 13/12/16 16:02, Wei Liu wrote:
> > After 5623e2d2 ("x86: use unified linker script") the linker script for
> > x86 build is generated. But the special rule to generate linker script
> > doesn't have OBJ_DIR prepended so in parallel build the same file is
> > written multiple times. This is racy and would cause parallel build to
> > fail.
> >
> > Fix this by prepending OBJ_DIR to the path of linker script. Change
> > other variables where necessary.
> >
> > Signed-off-by: Wei Liu <wei.liu2@citrix.com>
>
> Reviewed-by: Juergen Gross <jgross@suse.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [MINIOS PATCH] build: prepend OBJ_DIR to linker script
2016-12-13 21:49 ` Samuel Thibault
@ 2016-12-14 14:40 ` Wei Liu
0 siblings, 0 replies; 5+ messages in thread
From: Wei Liu @ 2016-12-14 14:40 UTC (permalink / raw)
To: Samuel Thibault, Juergen Gross, Wei Liu, Minios-devel, Xen-devel
On Tue, Dec 13, 2016 at 10:49:09PM +0100, Samuel Thibault wrote:
> Juergen Gross, on Tue 13 Dec 2016 16:18:07 +0100, wrote:
> > On 13/12/16 16:02, Wei Liu wrote:
> > > After 5623e2d2 ("x86: use unified linker script") the linker script for
> > > x86 build is generated. But the special rule to generate linker script
> > > doesn't have OBJ_DIR prepended so in parallel build the same file is
> > > written multiple times. This is racy and would cause parallel build to
> > > fail.
> > >
> > > Fix this by prepending OBJ_DIR to the path of linker script. Change
> > > other variables where necessary.
> > >
> > > Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> >
> > Reviewed-by: Juergen Gross <jgross@suse.com>
>
> Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Thanks. Pushed.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-12-14 14:40 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-13 15:02 [MINIOS PATCH] build: prepend OBJ_DIR to linker script Wei Liu
2016-12-13 15:17 ` Wei Liu
2016-12-13 15:18 ` Juergen Gross
2016-12-13 21:49 ` Samuel Thibault
2016-12-14 14:40 ` Wei Liu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.