summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMing Liu <peter.x.liu@external.atlascopco.com>2017-07-06 13:50:31 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-07-08 13:34:00 +0100
commit5d4acaed81a811912e60d85c507bee819623369e (patch)
tree30162b956077772e0f70d06338ed1cc331ecf38d
parent0fc904749f45bd7d679233cced9d5a155afac421 (diff)
downloadopenembedded-core-contrib-5d4acaed81a811912e60d85c507bee819623369e.tar.gz
openembedded-core-contrib-5d4acaed81a811912e60d85c507bee819623369e.tar.bz2
openembedded-core-contrib-5d4acaed81a811912e60d85c507bee819623369e.zip
linuxloader.bbclass: add musl libc support
Current linuxloader.bbclass does not support musl libc ldso, so add it in. After changing, now the linuxloader function will call a subfunction according to which virtual/libc is being used, glibc or musl, the linuxloader_musl function is made on top of the LDSO macro defined in musl source, by mapping related OE variables to it. Change tested on following machines: "genericx86" "genericx86-64" "beaglebone" "qemumips64" "qemuarm64" "mpc8315e-rdb" "edgerouter" "qemumips" "kc705-microblazeel" - meta-xilinx "qemuppc" Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
-rw-r--r--meta/classes/linuxloader.bbclass42
1 files changed, 41 insertions, 1 deletions
diff --git a/meta/classes/linuxloader.bbclass b/meta/classes/linuxloader.bbclass
index 117b030746..8f30eb32e7 100644
--- a/meta/classes/linuxloader.bbclass
+++ b/meta/classes/linuxloader.bbclass
@@ -1,5 +1,8 @@
+LDSO_TCLIBC = "glibc"
+LDSO_TCLIBC_libc-musl = "musl"
+LDSO_TCLIBC_libc-baremetal = "musl"
-linuxloader () {
+linuxloader_glibc () {
case ${TARGET_ARCH} in
powerpc | microblaze )
dynamic_loader="${base_libdir}/ld.so.1"
@@ -28,3 +31,40 @@ linuxloader () {
esac
echo $dynamic_loader
}
+
+linuxloader_musl () {
+ case ${TARGET_ARCH} in
+ microblaze* )
+ dynamic_loader="${base_libdir}/ld-musl-microblaze${@bb.utils.contains('TUNE_FEATURES', 'bigendian', '', 'el' ,d)}.so.1"
+ ;;
+ mips* )
+ dynamic_loader="${base_libdir}/ld-musl-mips${ABIEXTENSION}${MIPSPKGSFX_BYTE}${MIPSPKGSFX_R6}${MIPSPKGSFX_ENDIAN}${@['', '-sf'][d.getVar('TARGET_FPU') == 'soft']}.so.1"
+ ;;
+ powerpc )
+ dynamic_loader="${base_libdir}/ld-musl-powerpc${@['', '-sf'][d.getVar('TARGET_FPU') == 'soft']}.so.1"
+ ;;
+ powerpc64 )
+ dynamic_loader="${base_libdir}/ld-musl-powerpc64.so.1"
+ ;;
+ x86_64 )
+ dynamic_loader="${base_libdir}/ld-musl-x86_64.so.1"
+ ;;
+ i*86 )
+ dynamic_loader="${base_libdir}/ld-musl-i386.so.1"
+ ;;
+ arm* )
+ dynamic_loader="${base_libdir}/ld-musl-arm${ARMPKGSFX_ENDIAN}${ARMPKGSFX_EABI}.so.1"
+ ;;
+ aarch64* )
+ dynamic_loader="${base_libdir}/ld-musl-aarch64${ARMPKGSFX_ENDIAN_64}.so.1"
+ ;;
+ * )
+ dynamic_loader="/unknown_dynamic_linker"
+ ;;
+ esac
+ echo $dynamic_loader
+}
+
+linuxloader () {
+ linuxloader_${LDSO_TCLIBC}
+}