Skip to contentSkip to conversation

package/gcc: fix libgcc build for xtensa

PATCH New Max Filippov 2 participants 2 messages Jul 24, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/gcc: fix libgcc build for xtensa

xtensa libgcc can't be built with -mtext-section-literals flag, now coming from TARGET_CFLAGS, because it needs to emit literals to .init/.fini sections, which is not currently supported.

Filter -mtext-section-literals flag out of GCC_COMMON_TARGET_CFLAGS.

---
 package/gcc/gcc.mk |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
package/gcc/gcc.mk +7 -0
index aaeba7f..77866e2 100644
@@ -112,6 +112,13 @@ GCC_COMMON_TARGET_CXXFLAGS = $(filter-out -Os,$(GCC_COMMON_TARGET_CXXFLAGS))
 endif
 endif
 
+# Xtensa libgcc can't be built with -mtext-section-literals
+# because of the trick used to generate .init/.fini sections.
+ifeq ($(BR2_xtensa),y)
+GCC_COMMON_TARGET_CFLAGS = $(filter-out -mtext-section-literals,$(TARGET_CFLAGS))
+GCC_COMMON_TARGET_CXXFLAGS = $(filter-out -mtext-section-literals,$(TARGET_CXXFLAGS))
+endif
+
 # Propagate options used for target software building to GCC target libs
 HOST_GCC_COMMON_CONF_ENV += CFLAGS_FOR_TARGET="$(GCC_COMMON_TARGET_CXXFLAGS)"
 HOST_GCC_COMMON_CONF_ENV += CXXFLAGS_FOR_TARGET="$(GCC_COMMON_TARGET_CXXFLAGS)"
Signature · 1 line
1.7.7.6
#1 lore raw

PATCH 1/1 package/gcc: fix libgcc build for xtensa

Dear Max Filippov,

Quoted 11 lines · Max Filippov

xtensa libgcc can't be built with -mtext-section-literals flag, now coming from TARGET_CFLAGS, because it needs to emit literals to .init/.fini sections, which is not currently supported.

Filter -mtext-section-literals flag out of GCC_COMMON_TARGET_CFLAGS.

---
 package/gcc/gcc.mk |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

Applied, thanks.

Thomas

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