diff options
author | Khem Raj <raj.khem@gmail.com> | 2016-05-11 10:35:45 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-05-13 13:41:32 +0100 |
commit | 9a309684cfff5e1de3dbcc9690fc73d344e63ecd (patch) | |
tree | 5776a42f1cdd7c05c0cf5fb07e7dad705d99e03f /meta/recipes-devtools/gcc/libgcc.inc | |
parent | 7cabc9ec11385b1f7595a0536c6f88318162adbd (diff) | |
download | poky-9a309684cfff5e1de3dbcc9690fc73d344e63ecd.tar.gz |
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>
Diffstat (limited to 'meta/recipes-devtools/gcc/libgcc.inc')
-rw-r--r-- | meta/recipes-devtools/gcc/libgcc.inc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/libgcc.inc b/meta/recipes-devtools/gcc/libgcc.inc index 68377869ca..4770394c42 100644 --- a/meta/recipes-devtools/gcc/libgcc.inc +++ b/meta/recipes-devtools/gcc/libgcc.inc | |||
@@ -2,6 +2,17 @@ require libgcc-common.inc | |||
2 | 2 | ||
3 | DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++" | 3 | DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++" |
4 | 4 | ||
5 | do_install_append_class-target () { | ||
6 | if [ "${TCLIBC}" != "glibc" ]; then | ||
7 | case "${TARGET_OS}" in | ||
8 | "linux-musl" | "linux-uclibc" | "linux-*spe") extra_target_os="linux";; | ||
9 | "linux-musleabi" | "linux-uclibceabi") extra_target_os="linux-gnueabi";; | ||
10 | *) extra_target_os="linux";; | ||
11 | esac | ||
12 | ln -s ${TARGET_SYS} ${D}${libdir}/${TARGET_ARCH}${TARGET_VENDOR}-$extra_target_os | ||
13 | fi | ||
14 | } | ||
15 | |||
5 | PACKAGES = "\ | 16 | PACKAGES = "\ |
6 | ${PN} \ | 17 | ${PN} \ |
7 | ${PN}-dev \ | 18 | ${PN}-dev \ |
@@ -19,6 +30,7 @@ FILES_${PN}-dev = "\ | |||
19 | ${base_libdir}/libgcc*.so \ | 30 | ${base_libdir}/libgcc*.so \ |
20 | ${@base_conditional('BASETARGET_SYS', '${TARGET_SYS}', '', '${libdir}/${BASETARGET_SYS}', d)} \ | 31 | ${@base_conditional('BASETARGET_SYS', '${TARGET_SYS}', '', '${libdir}/${BASETARGET_SYS}', d)} \ |
21 | ${libdir}/${TARGET_SYS}/${BINV}* \ | 32 | ${libdir}/${TARGET_SYS}/${BINV}* \ |
33 | ${libdir}/${TARGET_ARCH}${TARGET_VENDOR}* \ | ||
22 | " | 34 | " |
23 | 35 | ||
24 | LIBGCCBUILDTREENAME = "gcc-build-internal-" | 36 | LIBGCCBUILDTREENAME = "gcc-build-internal-" |