kmod: disable --gc-sections ld option when building for xtensa
authorMax Filippov <jcmvbkbc@gmail.com>
Tue, 4 Mar 2014 20:30:31 +0000 (00:30 +0400)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tue, 4 Mar 2014 22:18:21 +0000 (23:18 +0100)
This is a workaround for the following ld issue exhibited by --gc-sections
option, until a proper fix for binutils is ready:

ld: BFD (GNU Binutils) 2.22 internal error, aborting at elf32-xtensa.c line 3374 in elf_xtensa_finish_dynamic_sections

Fixes:

  http://autobuild.buildroot.org/results/97d/97d4c96d6f6cdc1ed4007456f4ab70be9dfa41b5/

Suggested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/kmod/kmod.mk

index f79a492847cee30cdf807ff0877746131994dbdf..46c8ea9357187412eea6ad03286085720aff11f9 100644 (file)
@@ -32,6 +32,11 @@ KMOD_DEPENDENCIES += xz
 KMOD_CONF_OPT += --with-xz
 endif
 
+# --gc-sections triggers a bug in the current Xtensa binutils
+ifeq ($(BR2_xtensa),y)
+KMOD_CONF_ENV += cc_cv_LDFLAGS__Wl___gc_sections=no
+endif
+
 ifeq ($(BR2_PACKAGE_KMOD_TOOLS),y)
 
 # add license info for kmod tools