[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    [PATCH] build system: Specify '-nostldlib' when linking to .o files.
From:       Drew Moseley <drew_moseley () mentor ! com>
Date:       2014-03-29 20:02:01
Message-ID: 1396123321-23646-1-git-send-email-drew_moseley () mentor ! com
[Download RAW message or body]

For certain cross build scenarios the LD variable is overridden
to use the gcc executive to ensure all the target tuning parameters
are used.  In these cases, the executive errors out as shown below
but since this step is only linking to a .o file the standard libs
are not needed.

    $ make LD=gcc applets/built-in.o
      LD      applets/built-in.o
    /usr/bin/ld: cannot find -lgcc_s
    /usr/bin/ld: cannot find -lgcc_s
    collect2: ld returned 1 exit status
    make[1]: *** [applets/built-in.o] Error 1
    make: *** [applets_dir] Error 2

Signed-off-by: Drew Moseley <drew_moseley@mentor.com>
---
 scripts/Makefile.build |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 5685b5b..eba69f6 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -256,7 +256,7 @@ ifdef builtin-target
 quiet_cmd_link_o_target = LD      $@
 # If the list of objects to link is empty, just create an empty built-in.o
 cmd_link_o_target = $(if $(strip $(obj-y)),\
-		$(LD) $(ld_flags) -r -o $@ $(filter $(obj-y), $^),\
+		$(LD) -nostdlib $(ld_flags) -r -o $@ $(filter $(obj-y), $^),\
 		rm -f $@; $(AR) rcs $@)
 
 $(builtin-target): $(obj-y) FORCE
-- 
1.7.9.5

_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic