musl: fix build on sh3
[openwrt/staging/chunkeey.git] / toolchain / musl / common.mk
index 82c15430a1bd62a7664782176655f9a6e6b826c2..3045c634bc545581cb186d7c64e728ab62188c9b 100644 (file)
@@ -23,6 +23,12 @@ HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)-$(PKG_VERSION)
 include $(INCLUDE_DIR)/toolchain-build.mk
 include $(INCLUDE_DIR)/hardening.mk
 
+# Please see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67260
+ifeq ($(CONFIG_sh3),y)
+TARGET_CFLAGS+= \
+       -fno-optimize-sibling-calls
+endif
+
 MUSL_CONFIGURE:= \
        $(TARGET_CONFIGURE_OPTS) \
        CFLAGS="$(TARGET_CFLAGS)" \