1 # This file is part of the OpenADK project. OpenADK is copyrighted
2 # material, please see the LICENCE file in the top-level directory.
4 include $(ADK_TOPDIR
)/rules.mk
7 include ${ADK_TOPDIR}/mk
/buildhlp.mk
9 # glibc does not boot with Os and CPU specific FLAGS for nios2
10 ifeq ($(ADK_TARGET_ARCH_NIOS2
),y
)
15 # glibc does not compile with NEON suggested CFLAGS/CXXFLAGS
16 TARGET_CFLAGS
:= $(filter-out -ffast-math
,$(TARGET_CFLAGS
))
17 TARGET_CXXFLAGS
:= $(filter-out -ffast-math
,$(TARGET_CXXFLAGS
))
19 GLIBC_CONFOPTS
:= --build
=$(GNU_HOST_NAME
) \
20 --host
=$(GNU_TARGET_NAME
) \
21 --with-headers
=$(STAGING_TARGET_DIR
)/usr
/include \
22 --disable-sanity-checks \
27 ifeq ($(ADK_TARGET_LINUX_ARCH_SPARC64
),y
)
28 GLIBC_CONFOPTS
+= --disable-default-pie
30 GLIBC_CONFOPTS
+= --enable-default-pie
33 ifeq ($(ADK_TARGET_USE_STATIC_LIBS_ONLY
),y
)
34 GLIBC_CONFOPTS
+= --enable-static-nss
37 GLIBC_ENV
:= PATH
='${HOST_PATH}:${TARGET_PATH}' \
38 BUILD_CC
='${CC_FOR_BUILD}' \
39 CFLAGS
="$(TARGET_CFLAGS)" \
40 CXXFLAGS
="$(TARGET_CXXFLAGS)" \
44 RANLIB
="${TARGET_RANLIB}" \
45 libc_cv_gnu99_inline
=yes \
46 libc_cv_initfini_array
=yes
48 ifeq ($(ADK_TARGET_ARCH_RISCV64
),y
)
49 GLIBC_ENV
+= libc_cv_slibdir
=/lib libc_cv_rtlddir
=/lib
51 ifeq ($(ADK_TARGET_ARCH_RISCV32
),y
)
52 GLIBC_ENV
+= libc_cv_slibdir
=/lib libc_cv_rtlddir
=/lib
55 GLIBC_MAKEOPTS
+= cross-compiling
=yes
56 ifeq (${ADK_MAKE_PARALLEL},y
)
57 GLIBC_MAKEOPTS
+= PARALLELMFLAGS
="-j$(ADK_MAKE_JOBS)"
61 GLIBC_BUILD_DIR_FINAL
:= ${WRKDIR}/$(PKG_NAME
)-$(PKG_VERSION
)-final
63 $(WRKBUILD
)/.configured
:
64 mkdir
-p
$(GLIBC_BUILD_DIR_FINAL
)
65 (cd
$(GLIBC_BUILD_DIR_FINAL
); \
67 $(WRKBUILD
)/configure \
73 $(WRKBUILD
)/.compiled
:
74 ${GLIBC_ENV} $(MAKE
) ${GLIBC_MAKEOPTS} -C
$(GLIBC_BUILD_DIR_FINAL
) all
77 $(WRKBUILD
)/.installed
:
78 ${GLIBC_ENV} $(MAKE
) -C
$(GLIBC_BUILD_DIR_FINAL
) install_root
=$(STAGING_TARGET_DIR
) install
79 touch
$(STAGING_TARGET_DIR
)/usr
/include/gnu
/stubs.h
80 touch
$(STAGING_TARGET_DIR
)/usr
/include/gnu
/stubs-
{32,x32
,64,lp64
,soft
,hard
}.h
81 mkdir
-p
${STAGING_TARGET_DIR}/etc
82 ${INSTALL_DATA} ${WRKBUILD}/posix
/gai.conf
${STAGING_TARGET_DIR}/etc
83 ${INSTALL_DATA} ${WRKBUILD}/nss
/nsswitch.conf
${STAGING_TARGET_DIR}/etc
86 include ${ADK_TOPDIR}/mk
/toolchain.mk