diff options
-rw-r--r-- | scripts/Makefile.build | 11 | ||||
-rwxr-xr-x | scripts/trylink | 2 | ||||
-rw-r--r-- | win32/resources/Kbuild.src | 1 | ||||
-rw-r--r-- | win32/resources/dummy.c | 2 |
4 files changed, 12 insertions, 4 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 5eac45f91..2a9f451f3 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build | |||
@@ -254,11 +254,22 @@ $(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 | cmd_link_o_target = $(intcmp $(words $(obj-y)),1,\ | ||
269 | rm -f $@; $(AR) rcs $@,\ | ||
270 | cp $(obj-y) $@,\ | ||
271 | $(LD) -nostdlib $(ld_flags) -r -o $@ $(filter $(obj-y), $^)) | ||
272 | endif | ||
262 | 273 | ||
263 | $(builtin-target): $(obj-y) FORCE | 274 | $(builtin-target): $(obj-y) FORCE |
264 | $(call if_changed,link_o_target) | 275 | $(call if_changed,link_o_target) |
diff --git a/scripts/trylink b/scripts/trylink index 2255deee7..776fd484a 100755 --- a/scripts/trylink +++ b/scripts/trylink | |||
@@ -96,7 +96,7 @@ fi | |||
96 | START_GROUP="-Wl,--start-group" | 96 | START_GROUP="-Wl,--start-group" |
97 | END_GROUP="-Wl,--end-group" | 97 | END_GROUP="-Wl,--end-group" |
98 | INFO_OPTS() { | 98 | INFO_OPTS() { |
99 | echo "-Wl,--warn-common -Wl,-Map,$EXE.map -Wl,--verbose" | 99 | echo "$SORT_COMMON -Wl,-Map,$EXE.map -Wl,--verbose" |
100 | } | 100 | } |
101 | 101 | ||
102 | # gold may not support --sort-common (yet) | 102 | # gold may not support --sort-common (yet) |
diff --git a/win32/resources/Kbuild.src b/win32/resources/Kbuild.src index e2d884e98..d056a5964 100644 --- a/win32/resources/Kbuild.src +++ b/win32/resources/Kbuild.src | |||
@@ -7,7 +7,6 @@ | |||
7 | obj-y := | 7 | obj-y := |
8 | 8 | ||
9 | obj-$(CONFIG_FEATURE_RESOURCES) += resources.o | 9 | obj-$(CONFIG_FEATURE_RESOURCES) += resources.o |
10 | obj-$(CONFIG_FEATURE_RESOURCES) += dummy.o | ||
11 | 10 | ||
12 | # return commit level if available or 0 | 11 | # return commit level if available or 0 |
13 | bb_level = $(or $(word 2,$(subst -, ,$1)),0) | 12 | bb_level = $(or $(word 2,$(subst -, ,$1)),0) |
diff --git a/win32/resources/dummy.c b/win32/resources/dummy.c index 2d4b87680..e69de29bb 100644 --- a/win32/resources/dummy.c +++ b/win32/resources/dummy.c | |||
@@ -1,2 +0,0 @@ | |||
1 | extern void wibble(void); | ||
2 | void wibble(void) {} | ||