mirror of
https://git.yoctoproject.org/poky
synced 2026-05-31 12:49:46 +00:00
gcc-runtime, libgcc: Symlink c++ header and startup files in target_triplet for SDK use
We build SDKs such that gcc-cross-candian is built for only one
target *-*-linux and then use -muclibc or -mmusl to let it compile
code for other libc variants. This works fine when libc = glibc
however it does not work for c++ programs when libc != glibc since
there are c++ headers installed under ${includedir}/c++/${BINV}/${TARGET_SYS}
which is fine when gcc-runtime and gcc-cross-candian uses same --target options
gxx includedir searches in right triplet, but it fails with musl/uclibc
since gcc will look for glibc based triplet but gcc-runtime will install
them under musl/uclibc triplet.
This patch symlinks the musl/uclibc triplet to glibc triplet when libc != glibc
This fixes SDKs for musl/uclibc
(From OE-Core rev: fcaaabb401fffcda4db9a7d1f927a2a404e4776d)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -68,6 +68,7 @@ python () {
|
|||||||
elif tarch == "mips64":
|
elif tarch == "mips64":
|
||||||
d.appendVar("CANADIANEXTRAOS", " linux-gnun32 linux-uclibcn32 linux-musln32")
|
d.appendVar("CANADIANEXTRAOS", " linux-gnun32 linux-uclibcn32 linux-musln32")
|
||||||
if tarch == "arm" or tarch == "armeb":
|
if tarch == "arm" or tarch == "armeb":
|
||||||
|
d.appendVar("CANADIANEXTRAOS", " linux-musleabi linux-uclibceabi")
|
||||||
d.setVar("TARGET_OS", "linux-gnueabi")
|
d.setVar("TARGET_OS", "linux-gnueabi")
|
||||||
else:
|
else:
|
||||||
d.setVar("TARGET_OS", "linux")
|
d.setVar("TARGET_OS", "linux")
|
||||||
|
|||||||
@@ -73,9 +73,21 @@ do_install () {
|
|||||||
if [ "${TARGET_VENDOR_MULTILIB_ORIGINAL}" != "" -a "${TARGET_VENDOR}" != "${TARGET_VENDOR_MULTILIB_ORIGINAL}" ]; then
|
if [ "${TARGET_VENDOR_MULTILIB_ORIGINAL}" != "" -a "${TARGET_VENDOR}" != "${TARGET_VENDOR_MULTILIB_ORIGINAL}" ]; then
|
||||||
ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-${TARGET_OS}
|
ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-${TARGET_OS}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
do_install_append_class-target () {
|
||||||
if [ "${TARGET_OS}" = "linux-gnuspe" ]; then
|
if [ "${TARGET_OS}" = "linux-gnuspe" ]; then
|
||||||
ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
|
ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
|
||||||
fi
|
fi
|
||||||
|
if [ "${TCLIBC}" != "glibc" ]; then
|
||||||
|
case "${TARGET_OS}" in
|
||||||
|
"linux-musl" | "linux-uclibc" | "linux-*spe") extra_target_os="linux";;
|
||||||
|
"linux-musleabi" | "linux-uclibceabi") extra_target_os="linux-gnueabi";;
|
||||||
|
*) extra_target_os="linux";;
|
||||||
|
esac
|
||||||
|
ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-$extra_target_os
|
||||||
|
fi
|
||||||
chown -R root:root ${D}
|
chown -R root:root ${D}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,17 @@ require libgcc-common.inc
|
|||||||
|
|
||||||
DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++"
|
DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++"
|
||||||
|
|
||||||
|
do_install_append_class-target () {
|
||||||
|
if [ "${TCLIBC}" != "glibc" ]; then
|
||||||
|
case "${TARGET_OS}" in
|
||||||
|
"linux-musl" | "linux-uclibc" | "linux-*spe") extra_target_os="linux";;
|
||||||
|
"linux-musleabi" | "linux-uclibceabi") extra_target_os="linux-gnueabi";;
|
||||||
|
*) extra_target_os="linux";;
|
||||||
|
esac
|
||||||
|
ln -s ${TARGET_SYS} ${D}${libdir}/${TARGET_ARCH}${TARGET_VENDOR}-$extra_target_os
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
PACKAGES = "\
|
PACKAGES = "\
|
||||||
${PN} \
|
${PN} \
|
||||||
${PN}-dev \
|
${PN}-dev \
|
||||||
@@ -19,6 +30,7 @@ FILES_${PN}-dev = "\
|
|||||||
${base_libdir}/libgcc*.so \
|
${base_libdir}/libgcc*.so \
|
||||||
${@base_conditional('BASETARGET_SYS', '${TARGET_SYS}', '', '${libdir}/${BASETARGET_SYS}', d)} \
|
${@base_conditional('BASETARGET_SYS', '${TARGET_SYS}', '', '${libdir}/${BASETARGET_SYS}', d)} \
|
||||||
${libdir}/${TARGET_SYS}/${BINV}* \
|
${libdir}/${TARGET_SYS}/${BINV}* \
|
||||||
|
${libdir}/${TARGET_ARCH}${TARGET_VENDOR}* \
|
||||||
"
|
"
|
||||||
|
|
||||||
LIBGCCBUILDTREENAME = "gcc-build-internal-"
|
LIBGCCBUILDTREENAME = "gcc-build-internal-"
|
||||||
|
|||||||
Reference in New Issue
Block a user