2 # Copyright (C) 2006-2016 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
7 include $(TOPDIR
)/rules.mk
12 PKG_SOURCE_URL
:=@GNU
/libc
13 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.xz
14 PKG_HASH
:=e54e0a934cd2bc94429be79da5e9385898d2306b9eaf3c92d5a77af96190f6bd
16 PKG_SOURCE_SUBDIR
:=$(PKG_NAME
)-$(PKG_VERSION
)
17 HOST_BUILD_DIR
:=$(BUILD_DIR_TOOLCHAIN
)/$(PKG_SOURCE_SUBDIR
)
18 CUR_BUILD_DIR
:=$(HOST_BUILD_DIR
)-$(VARIANT
)
19 PATCH_DIR
:=$(PATH_PREFIX
)/patches
21 include $(INCLUDE_DIR
)/toolchain-build.mk
23 HOST_STAMP_PREPARED
:=$(HOST_BUILD_DIR
)/.prepared
24 HOST_STAMP_CONFIGURED
:=$(CUR_BUILD_DIR
)/.configured
25 HOST_STAMP_BUILT
:=$(CUR_BUILD_DIR
)/.built
26 HOST_STAMP_INSTALLED
:=$(TOOLCHAIN_DIR
)/stamp
/.glibc_
$(VARIANT
)_installed
29 ifdef CONFIG_MIPS64_ABI_N64
30 TARGET_CFLAGS
+= -mabi
=64
32 ifdef CONFIG_MIPS64_ABI_N32
33 TARGET_CFLAGS
+= -mabi
=n32
35 ifdef CONFIG_MIPS64_ABI_O32
36 TARGET_CFLAGS
+= -mabi
=32
41 # -Os miscompiles w. 2.24 gcc5/gcc6
42 # only -O2 tested by upstream changeset
43 # "Optimize i386 syscall inlining for GCC 5"
45 BUILD_CC
="$(HOSTCC)" \
46 $(TARGET_CONFIGURE_OPTS
) \
47 CFLAGS
="-O2 $(filter-out -Os,$(call qstrip,$(TARGET_CFLAGS)))" \
48 libc_cv_slibdir
="/lib" \
50 $(HOST_BUILD_DIR
)/$(GLIBC_PATH
)configure \
52 --build
=$(GNU_HOST_NAME
) \
53 --host
=$(REAL_GNU_TARGET_NAME
) \
54 --with-headers
=$(TOOLCHAIN_DIR
)/include \
60 --$(if
$(CONFIG_SOFT_FLOAT
),without
,with
)-fp
63 export libc_cv_ssp_strong
=no
64 export ac_cv_header_cpuid_h
=yes
65 export HOST_CFLAGS
:= $(HOST_CFLAGS
) -idirafter
$(CURDIR
)/$(PATH_PREFIX
)/include
67 define Host
/SetToolchainInfo
68 $(SED
) 's,^\(LIBC_TYPE\)=.*,\1=$(PKG_NAME),' $(TOOLCHAIN_DIR
)/info.mk
69 $(SED
) 's,^\(LIBC_URL\)=.*,\1=http://www.gnu.org/software/libc/,' $(TOOLCHAIN_DIR
)/info.mk
70 $(SED
) 's,^\(LIBC_VERSION\)=.*,\1=$(PKG_VERSION),' $(TOOLCHAIN_DIR
)/info.mk
71 $(SED
) 's,^\(LIBC_SO_VERSION\)=.*,\1=$(PKG_VERSION),' $(TOOLCHAIN_DIR
)/info.mk
75 [ -f
$(HOST_BUILD_DIR
)/.autoconf
] ||
{ \
76 cd
$(HOST_BUILD_DIR
)/; \
78 touch
$(HOST_BUILD_DIR
)/.autoconf
; \
80 mkdir
-p
$(CUR_BUILD_DIR
)
81 ( cd
$(CUR_BUILD_DIR
); rm -f config.cache
; \
87 $(call Host
/Prepare
/Default
)
88 ln
-snf
$(PKG_SOURCE_SUBDIR
) $(BUILD_DIR_TOOLCHAIN
)/$(PKG_NAME
)
92 rm -rf
$(CUR_BUILD_DIR
)* \
93 $(BUILD_DIR_TOOLCHAIN
)/$(LIBC
)-dev \
94 $(BUILD_DIR_TOOLCHAIN
)/$(PKG_NAME
)