aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/Makefile.build11
-rwxr-xr-xscripts/trylink2
-rw-r--r--win32/resources/Kbuild.src1
-rw-r--r--win32/resources/dummy.c2
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#
255ifdef builtin-target 255ifdef builtin-target
256quiet_cmd_link_o_target = LD $@ 256quiet_cmd_link_o_target = LD $@
257ifeq ($(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)
259cmd_link_o_target = $(if $(strip $(obj-y)),\ 260cmd_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 $@)
263else
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.
268cmd_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), $^))
272endif
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
96START_GROUP="-Wl,--start-group" 96START_GROUP="-Wl,--start-group"
97END_GROUP="-Wl,--end-group" 97END_GROUP="-Wl,--end-group"
98INFO_OPTS() { 98INFO_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 @@
7obj-y := 7obj-y :=
8 8
9obj-$(CONFIG_FEATURE_RESOURCES) += resources.o 9obj-$(CONFIG_FEATURE_RESOURCES) += resources.o
10obj-$(CONFIG_FEATURE_RESOURCES) += dummy.o
11 10
12# return commit level if available or 0 11# return commit level if available or 0
13bb_level = $(or $(word 2,$(subst -, ,$1)),0) 12bb_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 @@
1extern void wibble(void);
2void wibble(void) {}