[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [mini-os master] build: prepend OBJ_DIR to linker script



commit 1e8e464febb32428c7651b0b585866e5ee5f786e
Author:     Wei Liu <wei.liu2@xxxxxxxxxx>
AuthorDate: Tue Dec 13 15:02:02 2016 +0000
Commit:     Wei Liu <wei.liu2@xxxxxxxxxx>
CommitDate: Wed Dec 14 14:38:35 2016 +0000

    build: prepend OBJ_DIR to linker script
    
    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@xxxxxxxxxx>
    Reviewed-by: Juergen Gross <jgross@xxxxxxxx>
    Acked-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>
---
 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 $@
--
generated by git-patchbot for /home/xen/git/mini-os.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.