Explorar o código

toolchain: add user defined target LDFLAGS options

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.

[Peter: fixup, use qstrip]
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Baruch Siach %!s(int64=14) %!d(string=hai) anos
pai
achega
ec8eda419a
Modificáronse 2 ficheiros con 6 adicións e 0 borrados
  1. 1 0
      package/Makefile.in
  2. 5 0
      toolchain/toolchain-common.in

+ 1 - 0
package/Makefile.in

@@ -77,6 +77,7 @@ TARGET_CFLAGS+=-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
 endif
 
 TARGET_CXXFLAGS=$(TARGET_CFLAGS)
+TARGET_LDFLAGS=$(call qstrip,$(BR2_TARGET_LDFLAGS))
 
 ifeq ($(BR2_TOOLCHAIN_BUILDROOT)$(BR2_TOOLCHAIN_CTNG),y)
 TARGET_CROSS=$(HOST_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-

+ 5 - 0
toolchain/toolchain-common.in

@@ -96,3 +96,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
+	  Extra options to pass to the linker when buiding for the target.