Skip to contentSkip to conversation

kmod: disable --gc-sections ld option when building for xtensa

PATCH New Max Filippov 2 participants 2 messages Mar 4, 2014

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 kmod: disable --gc-sections ld option when building for xtensa

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

---
Changes v1->v2:
- instead of patching configure specify that -Wl,--gc-sections is not supported by ld at configure time

 package/kmod/kmod.mk | 5 +++++
 1 file changed, 5 insertions(+)
package/kmod/kmod.mk +5 -0
index f79a492..46c8ea9 100644
@@ -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
Signature · 1 line
1.8.1.4
#1 lore raw

PATCH v2 1/1 kmod: disable --gc-sections ld option when building for xtensa

Dear Max Filippov,

Quoted 11 lines · Max Filippov

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

---
Changes v1->v2:
- instead of patching configure specify that -Wl,--gc-sections is not supported by ld at configure time

Applied, thanks.

I have added in the commit log a link to the autobuilder result which this commit is fixing, for reference.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com