* [Buildroot] [PATCH] busybox: fix link with tirpc
@ 2012-11-21 8:15 Arnout Vandecappelle
2012-11-21 10:07 ` Peter Korsgaard
0 siblings, 1 reply; 2+ messages in thread
From: Arnout Vandecappelle @ 2012-11-21 8:15 UTC (permalink / raw)
To: buildroot
Busybox does partial linking of its modules before linking everything
together into the binary. Those partial links are done without the
standard libraries, but that also means -ltirpc can't be found. In
addition, this probably fails horribly with static linking (untested).
The problem is that the LDFLAGS are also used in the partial links.
So instead, use CFLAGS_busybox, which is only used for the busybox
link step. Also make sure that this is passed through the environment,
not on the command line, so the busybox Makefile can still append to
it.
Fixes e.g.
http://autobuild.buildroot.net/results/e8351e3ba86fdcdb2999548658271a6fde0526a9
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
package/busybox/busybox.mk | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/package/busybox/busybox.mk b/package/busybox/busybox.mk
index 549e150..9154c08 100644
--- a/package/busybox/busybox.mk
+++ b/package/busybox/busybox.mk
@@ -27,12 +27,17 @@ BUSYBOX_LDFLAGS = \
ifeq ($(BR2_PACKAGE_LIBTIRPC),y)
BUSYBOX_DEPENDENCIES += libtirpc
BUSYBOX_CFLAGS += -I$(STAGING_DIR)/usr/include/tirpc/
-BUSYBOX_LDFLAGS += -ltirpc
+# Don't use LDFLAGS for -ltirpc, because LDFLAGS is used for
+# the non-final link of modules as well.
+BUSYBOX_CFLAGS_busybox += -ltirpc
endif
BUSYBOX_BUILD_CONFIG = $(BUSYBOX_DIR)/.config
# Allows the build system to tweak CFLAGS
-BUSYBOX_MAKE_ENV = $(TARGET_MAKE_ENV) CFLAGS="$(BUSYBOX_CFLAGS)"
+BUSYBOX_MAKE_ENV = \
+ $(TARGET_MAKE_ENV) \
+ CFLAGS="$(BUSYBOX_CFLAGS)" \
+ CFLAGS_busybox="$(BUSYBOX_CFLAGS_busybox)"
BUSYBOX_MAKE_OPTS = \
CC="$(TARGET_CC)" \
ARCH=$(KERNEL_ARCH) \
--
tg: (47ee305..) t/busybox-tirpc (depends on: master)
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Buildroot] [PATCH] busybox: fix link with tirpc
2012-11-21 8:15 [Buildroot] [PATCH] busybox: fix link with tirpc Arnout Vandecappelle
@ 2012-11-21 10:07 ` Peter Korsgaard
0 siblings, 0 replies; 2+ messages in thread
From: Peter Korsgaard @ 2012-11-21 10:07 UTC (permalink / raw)
To: buildroot
>>>>> "Arnout" == Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> writes:
Arnout> Busybox does partial linking of its modules before linking everything
Arnout> together into the binary. Those partial links are done without the
Arnout> standard libraries, but that also means -ltirpc can't be found. In
Arnout> addition, this probably fails horribly with static linking (untested).
Arnout> The problem is that the LDFLAGS are also used in the partial links.
Arnout> So instead, use CFLAGS_busybox, which is only used for the busybox
Arnout> link step. Also make sure that this is passed through the environment,
Arnout> not on the command line, so the busybox Makefile can still append to
Arnout> it.
Arnout> Fixes e.g.
Arnout> http://autobuild.buildroot.net/results/e8351e3ba86fdcdb2999548658271a6fde0526a9
Committed, thanks.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-11-21 10:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-21 8:15 [Buildroot] [PATCH] busybox: fix link with tirpc Arnout Vandecappelle
2012-11-21 10:07 ` Peter Korsgaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox