summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2015-07-31 11:28:22 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-08-01 07:34:05 +0100
commitc1148330a141e05a522d6ebffd5ef91086b9400b (patch)
treea8fa8c134c386dd0f9ab8149011996cd184e1354 /meta/recipes-devtools
parent6c4b21d7af209a2c6b9f365857a8fb395c83c58d (diff)
downloadpoky-c1148330a141e05a522d6ebffd5ef91086b9400b.tar.gz
libgcc: Fix symlink handling in cross-arch multilib cases
The symlink being generated needs to match both the current arch (e.g. mips or mips64) but also use the underlying TARGET_SYS without multilib extensions to TARGET_VENDOR or extensions to TARGET_OS. The way multilib changes TARGET_VENDOR meant this code did not have a way of removing that change. The method of removing some TARGET_OS suffixes was also not working. By using immediate expansion to run this code, we can run before the multilib code changes it and get the original values. We then use the *current* TARGET_ARCH value in case this does get changed by the multilib since we need to point at the right compiler (32 bit one for 32 bit code). (From OE-Core rev: 89cd6c244b6bc0a8cb52ec84d378d5b305df030f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r--meta/recipes-devtools/gcc/libgcc-common.inc26
-rw-r--r--meta/recipes-devtools/gcc/libgcc.inc2
2 files changed, 14 insertions, 14 deletions
diff --git a/meta/recipes-devtools/gcc/libgcc-common.inc b/meta/recipes-devtools/gcc/libgcc-common.inc
index 3101762b02..22da03b4c0 100644
--- a/meta/recipes-devtools/gcc/libgcc-common.inc
+++ b/meta/recipes-devtools/gcc/libgcc-common.inc
@@ -116,23 +116,23 @@ fakeroot python do_multilib_install() {
116 os.symlink(src, dest) 116 os.symlink(src, dest)
117} 117}
118 118
119def get_original_vendoros(d):
120 vendoros = d.expand('${TARGET_VENDOR}-${TARGET_OS}')
121 for suffix in [d.getVar('ABIEXTENSION', True), d.getVar('LIBCEXTENSION', True)]:
122 if suffix and vendoros.endswith(suffix):
123 vendoros = vendoros[:-len(suffix)]
124 return vendoros
125
126ORIG_TARGET_VENDOROS := "${@get_original_vendoros(d)}"
127BASETARGET_SYS = "${TARGET_ARCH}${ORIG_TARGET_VENDOROS}"
128
119addtask extra_symlinks after do_multilib_install before do_package do_populate_sysroot 129addtask extra_symlinks after do_multilib_install before do_package do_populate_sysroot
120fakeroot python do_extra_symlinks() { 130fakeroot python do_extra_symlinks() {
121 targetsysnoext = d.getVar('TARGET_SYS_NO_EXTENSION', True) 131 targetsys = d.getVar('BASETARGET_SYS', True)
122 132
123 if targetsysnoext != d.getVar('TARGET_SYS', True): 133 if targetsys != d.getVar('TARGET_SYS', True):
124 dest = d.getVar('D', True) + d.getVar('libdir', True) + '/' + targetsysnoext 134 dest = d.getVar('D', True) + d.getVar('libdir', True) + '/' + targetsys
125 src = d.getVar('TARGET_SYS', True) 135 src = d.getVar('TARGET_SYS', True)
126 if not os.path.lexists(dest) and os.path.lexists(d.getVar('D', True) + d.getVar('libdir', True)): 136 if not os.path.lexists(dest) and os.path.lexists(d.getVar('D', True) + d.getVar('libdir', True)):
127 os.symlink(src, dest) 137 os.symlink(src, dest)
128} 138}
129
130python () {
131 targetsysnoext = d.getVar('TARGET_SYS', True)
132
133 for suffix in [d.getVar('ABIEXTENSION', True), d.getVar('LIBCEXTENSION', True)]:
134 if suffix and targetsysnoext.endswith(suffix):
135 targetsysnoext = targetsysnoext[:-len(suffix)]
136
137 d.setVar('TARGET_SYS_NO_EXTENSION', targetsysnoext)
138}
diff --git a/meta/recipes-devtools/gcc/libgcc.inc b/meta/recipes-devtools/gcc/libgcc.inc
index 35432c793e..739adbd968 100644
--- a/meta/recipes-devtools/gcc/libgcc.inc
+++ b/meta/recipes-devtools/gcc/libgcc.inc
@@ -24,7 +24,7 @@ FILES_${PN}-dev = "\
24 ${libdir}/${TARGET_SYS}/${BINV}/x32 \ 24 ${libdir}/${TARGET_SYS}/${BINV}/x32 \
25 ${libdir}/${TARGET_SYS}/${BINV}/n32 \ 25 ${libdir}/${TARGET_SYS}/${BINV}/n32 \
26 ${libdir}/${TARGET_SYS}/${BINV}/libgcc* \ 26 ${libdir}/${TARGET_SYS}/${BINV}/libgcc* \
27 ${@base_conditional('TARGET_SYS_NO_EXTENSION', '${TARGET_SYS}', '', '${libdir}/${TARGET_SYS_NO_EXTENSION}', d)} \ 27 ${@base_conditional('BASETARGET_SYS', '${TARGET_SYS}', '', '${libdir}/${BASETARGET_SYS}', d)} \
28 ${libdir}/${TARGET_SYS}/${BINV}/libgcov.a \ 28 ${libdir}/${TARGET_SYS}/${BINV}/libgcov.a \
29" 29"
30 30