diff options
Diffstat (limited to '')
-rw-r--r-- | scripts/Makefile.build | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 5eac45f91..cd5592b34 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build | |||
@@ -254,11 +254,28 @@ $(sort $(subdir-obj-y)): $(subdir-ym) ; | |||
254 | # | 254 | # |
255 | ifdef builtin-target | 255 | ifdef builtin-target |
256 | quiet_cmd_link_o_target = LD $@ | 256 | quiet_cmd_link_o_target = LD $@ |
257 | ifeq ($(CONFIG_PLATFORM_POSIX),y) | ||
257 | # If the list of objects to link is empty, just create an empty built-in.o | 258 | # If the list of objects to link is empty, just create an empty built-in.o |
258 | # -nostdlib is added to make "make LD=gcc ..." work (some people use that) | 259 | # -nostdlib is added to make "make LD=gcc ..." work (some people use that) |
259 | cmd_link_o_target = $(if $(strip $(obj-y)),\ | 260 | cmd_link_o_target = $(if $(strip $(obj-y)),\ |
260 | $(LD) -nostdlib $(ld_flags) -r -o $@ $(filter $(obj-y), $^),\ | 261 | $(LD) -nostdlib $(ld_flags) -r -o $@ $(filter $(obj-y), $^),\ |
261 | rm -f $@; $(AR) rcs $@) | 262 | rm -f $@; $(AR) rcs $@) |
263 | else | ||
264 | # In default builds of busybox-w32 all builtin targets have either | ||
265 | # zero or one object files. In the latter case copy the object to | ||
266 | # the target. This avoids the need to use the linker: the llvm | ||
267 | # linker doesn't support the -r option. | ||
268 | ifeq ($(words $(obj-y)),0) | ||
269 | cmd_link_o_target = rm -f $@; $(AR) rcs $@ | ||
270 | else | ||
271 | ifeq ($(words $(obj-y)),1) | ||
272 | cmd_link_o_target = cp $(obj-y) $@ | ||
273 | else | ||
274 | cmd_link_o_target = \ | ||
275 | $(LD) -nostdlib $(ld_flags) -r -o $@ $(filter $(obj-y), $^)) | ||
276 | endif | ||
277 | endif | ||
278 | endif | ||
262 | 279 | ||
263 | $(builtin-target): $(obj-y) FORCE | 280 | $(builtin-target): $(obj-y) FORCE |
264 | $(call if_changed,link_o_target) | 281 | $(call if_changed,link_o_target) |