All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] toolchain: add user defined target LDFLAGS options
@ 2011-06-23  9:21 Baruch Siach
  2011-07-25  6:34 ` Peter Korsgaard
  0 siblings, 1 reply; 9+ messages in thread
From: Baruch Siach @ 2011-06-23  9:21 UTC (permalink / raw)
  To: buildroot

Allow the user to specify additional options for the target LDFLAGS.

I use this to pass the -te500v2 option to the linker, when using the
CodeSourcery toolchain for PowerPC. This chooses the correct CRT for e500 hard
float. Otherwise I get errors like

undefined reference to `_save32gpr_31'
undefined reference to `_rest32gpr_31_x'

at final link time.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
 package/Makefile.in           |    2 +-
 toolchain/toolchain-common.in |    5 +++++
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/package/Makefile.in b/package/Makefile.in
index 2ca8c31..a6cee06 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -81,7 +81,7 @@ ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
 TARGET_CFLAGS+=-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include
 endif
 
-TARGET_LDFLAGS+=-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib
+TARGET_LDFLAGS+=-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib $(BR2_TARGET_LDFLAGS)
 TARGET_CXXFLAGS=$(TARGET_CFLAGS)
 TARGET_SYSROOT_OPT=--sysroot=$(STAGING_DIR)
 
diff --git a/toolchain/toolchain-common.in b/toolchain/toolchain-common.in
index f67c30a..8a87493 100644
--- a/toolchain/toolchain-common.in
+++ b/toolchain/toolchain-common.in
@@ -173,3 +173,8 @@ config BR2_TARGET_OPTIMIZATION
 	help
 	  Optimizations to use when building for the target host.
 	  NOTE: gcc optimization level is defined in build options.
+
+config BR2_TARGET_LDFLAGS
+	string "Target linker options"
+	help
+	  Options to pass to the linker when buiding for the target host.
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-07-26 15:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-23  9:21 [Buildroot] [PATCH] toolchain: add user defined target LDFLAGS options Baruch Siach
2011-07-25  6:34 ` Peter Korsgaard
2011-07-25  7:10   ` Baruch Siach
2011-07-25  7:16     ` Peter Korsgaard
2011-07-25  7:24       ` Baruch Siach
2011-07-25  7:28         ` Peter Korsgaard
2011-07-25 21:19       ` Matias Garcia
2011-07-26 13:10         ` Baruch Siach
2011-07-26 15:00           ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.