mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-23 15:32:33 +00:00
8f57c55993
musl fails to build when compiled with gcc on sh3 (GCC target/#67260). Work it around. Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu> SVN-Revision: 47012
70 lines
1.6 KiB
Makefile
70 lines
1.6 KiB
Makefile
#
|
|
# Copyright (C) 2012-2013 OpenWrt.org
|
|
#
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
# See /LICENSE for more information.
|
|
#
|
|
include $(TOPDIR)/rules.mk
|
|
include $(INCLUDE_DIR)/target.mk
|
|
|
|
PKG_NAME:=musl
|
|
PKG_VERSION:=$(call qstrip,$(CONFIG_MUSL_VERSION))
|
|
PKG_RELEASE=1
|
|
|
|
PKG_MD5SUM:=48be0777e32f374d387e9cf85e36ec4d
|
|
|
|
PKG_SOURCE_URL:=http://www.musl-libc.org/releases
|
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
|
LIBC_SO_VERSION:=$(PKG_VERSION)
|
|
PATCH_DIR:=$(PATH_PREFIX)/patches
|
|
|
|
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)" \
|
|
CROSS_COMPILE="$(TARGET_CROSS)" \
|
|
$(HOST_BUILD_DIR)/configure \
|
|
--prefix=/ \
|
|
--host=$(GNU_HOST_NAME) \
|
|
--target=$(REAL_GNU_TARGET_NAME) \
|
|
--disable-gcc-wrapper
|
|
|
|
ifeq ($(CONFIG_MUSL_ENABLE_DEBUG),y)
|
|
MUSL_CONFIGURE+= \
|
|
--enable-debug
|
|
endif
|
|
|
|
define Host/Prepare
|
|
$(call Host/Prepare/Default)
|
|
$(if $(strip $(QUILT)), \
|
|
cd $(HOST_BUILD_DIR); \
|
|
if $(QUILT_CMD) next >/dev/null 2>&1; then \
|
|
$(QUILT_CMD) push -a; \
|
|
fi
|
|
)
|
|
ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
|
|
endef
|
|
|
|
define Host/Configure
|
|
( cd $(HOST_BUILD_DIR); rm -f config.cache; \
|
|
$(MUSL_CONFIGURE) \
|
|
);
|
|
endef
|
|
|
|
define Host/Clean
|
|
rm -rf \
|
|
$(HOST_BUILD_DIR) \
|
|
$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) \
|
|
$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev
|
|
endef
|