summaryrefslogtreecommitdiffstats
path: root/meta/classes/linuxloader.bbclass
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2018-09-19 20:52:41 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-09-21 18:45:46 -0700
commit244caa1dbf9dbfe67f1ea342be9fd0a296d116f9 (patch)
treed34c94abf906b0dbe98d6c69f43e3b0473aa2dbf /meta/classes/linuxloader.bbclass
parent18b90a0fd9bdc00d82140fbd55761e9cea308fb1 (diff)
downloadpoky-244caa1dbf9dbfe67f1ea342be9fd0a296d116f9.tar.gz
linuxloader.bbclass: Refactor to have seprate functions for musl/glibc loader
this makes it possible to use this for musl where we are trying to create a glibc compat package Add missing aarch64 loader definition for glibc function (From OE-Core rev: 0a02ea79ec522582b46138a027eb166819e5647d) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/linuxloader.bbclass')
-rw-r--r--meta/classes/linuxloader.bbclass85
1 files changed, 49 insertions, 36 deletions
diff --git a/meta/classes/linuxloader.bbclass b/meta/classes/linuxloader.bbclass
index e1364a4e55..b4c413494a 100644
--- a/meta/classes/linuxloader.bbclass
+++ b/meta/classes/linuxloader.bbclass
@@ -1,48 +1,61 @@
1def get_linuxloader(d): 1def get_musl_loader(d):
2 import re
3 dynamic_loader = None
4
5 targetarch = d.getVar("TARGET_ARCH")
6 if targetarch.startswith("microblaze"):
7 dynamic_loader = "${base_libdir}/ld-musl-microblaze${@bb.utils.contains('TUNE_FEATURES', 'bigendian', '', 'el' ,d)}.so.1"
8 elif targetarch.startswith("mips"):
9 dynamic_loader = "${base_libdir}/ld-musl-mips${ABIEXTENSION}${MIPSPKGSFX_BYTE}${MIPSPKGSFX_R6}${MIPSPKGSFX_ENDIAN}${@['', '-sf'][d.getVar('TARGET_FPU') == 'soft']}.so.1"
10 elif targetarch == "powerpc":
11 dynamic_loader = "${base_libdir}/ld-musl-powerpc${@['', '-sf'][d.getVar('TARGET_FPU') == 'soft']}.so.1"
12 elif targetarch == "powerpc64":
13 dynamic_loader = "${base_libdir}/ld-musl-powerpc64.so.1"
14 elif targetarch == "x86_64":
15 dynamic_loader = "${base_libdir}/ld-musl-x86_64.so.1"
16 elif re.search("i.86", targetarch):
17 dynamic_loader = "${base_libdir}/ld-musl-i386.so.1"
18 elif targetarch.startswith("arm"):
19 dynamic_loader = "${base_libdir}/ld-musl-arm${ARMPKGSFX_ENDIAN}${ARMPKGSFX_EABI}.so.1"
20 elif targetarch.startswith("aarch64"):
21 dynamic_loader = "${base_libdir}/ld-musl-aarch64${ARMPKGSFX_ENDIAN_64}.so.1"
22 return dynamic_loader
23
24def get_glibc_loader(d):
2 import re 25 import re
3 26
27 dynamic_loader = None
4 targetarch = d.getVar("TARGET_ARCH") 28 targetarch = d.getVar("TARGET_ARCH")
29 if targetarch in ["powerpc", "microblaze"]:
30 dynamic_loader = "${base_libdir}/ld.so.1"
31 elif targetarch in ["mipsisa32r6el", "mipsisa32r6", "mipsisa64r6el", "mipsisa64r6"]:
32 dynamic_loader = "${base_libdir}/ld-linux-mipsn8.so.1"
33 elif targetarch.startswith("mips"):
34 dynamic_loader = "${base_libdir}/ld.so.1"
35 elif targetarch == "powerpc64":
36 dynamic_loader = "${base_libdir}/ld64.so.1"
37 elif targetarch == "x86_64":
38 dynamic_loader = "${base_libdir}/ld-linux-x86-64.so.2"
39 elif re.search("i.86", targetarch):
40 dynamic_loader = "${base_libdir}/ld-linux.so.2"
41 elif targetarch == "arm":
42 dynamic_loader = "${base_libdir}/ld-linux.so.3"
43 elif targetarch.startswith("aarch64"):
44 dynamic_loader = "${base_libdir}/ld-linux-aarch64${ARMPKGSFX_ENDIAN_64}.so.1"
45 return dynamic_loader
46
47def get_linuxloader(d):
5 overrides = d.getVar("OVERRIDES").split(":") 48 overrides = d.getVar("OVERRIDES").split(":")
6 49
7 # No loader for baremetal
8 if "libc-baremetal" in overrides: 50 if "libc-baremetal" in overrides:
9 return None 51 return None
10 52
11 dynamic_loader = None
12 if "libc-musl" in overrides: 53 if "libc-musl" in overrides:
13 if targetarch.startswith("microblaze"): 54 dynamic_loader = get_musl_loader(d)
14 dynamic_loader = "${base_libdir}/ld-musl-microblaze${@bb.utils.contains('TUNE_FEATURES', 'bigendian', '', 'el' ,d)}.so.1"
15 elif targetarch.startswith("mips"):
16 dynamic_loader = "${base_libdir}/ld-musl-mips${ABIEXTENSION}${MIPSPKGSFX_BYTE}${MIPSPKGSFX_R6}${MIPSPKGSFX_ENDIAN}${@['', '-sf'][d.getVar('TARGET_FPU') == 'soft']}.so.1"
17 elif targetarch == "powerpc":
18 dynamic_loader = "${base_libdir}/ld-musl-powerpc${@['', '-sf'][d.getVar('TARGET_FPU') == 'soft']}.so.1"
19 elif targetarch == "powerpc64":
20 dynamic_loader = "${base_libdir}/ld-musl-powerpc64.so.1"
21 elif targetarch == "x86_64":
22 dynamic_loader = "${base_libdir}/ld-musl-x86_64.so.1"
23 elif re.search("i.86", targetarch):
24 dynamic_loader = "${base_libdir}/ld-musl-i386.so.1"
25 elif targetarch.startswith("arm"):
26 dynamic_loader = "${base_libdir}/ld-musl-arm${ARMPKGSFX_ENDIAN}${ARMPKGSFX_EABI}.so.1"
27 elif targetarch.startswith("aarch64"):
28 dynamic_loader = "${base_libdir}/ld-musl-aarch64${ARMPKGSFX_ENDIAN_64}.so.1"
29 else: 55 else:
30 # glibc 56 dynamic_loader = get_glibc_loader(d)
31 if targetarch in ["powerpc", "microblaze"]:
32 dynamic_loader = "${base_libdir}/ld.so.1"
33 elif targetarch in ["mipsisa32r6el", "mipsisa32r6", "mipsisa64r6el", "mipsisa64r6"]:
34 dynamic_loader = "${base_libdir}/ld-linux-mipsn8.so.1"
35 elif targetarch.startswith("mips"):
36 dynamic_loader = "${base_libdir}/ld.so.1"
37 elif targetarch == "powerpc64":
38 dynamic_loader = "${base_libdir}/ld64.so.1"
39 elif targetarch == "x86_64":
40 dynamic_loader = "${base_libdir}/ld-linux-x86-64.so.2"
41 elif re.search("i.86", targetarch):
42 dynamic_loader = "${base_libdir}/ld-linux.so.2"
43 elif targetarch == "arm":
44 dynamic_loader = "${base_libdir}/ld-linux.so.3"
45
46 return dynamic_loader 57 return dynamic_loader
47get_linuxloader[vardepvalue] = "${@get_linuxloader(d)}"
48 58
59get_linuxloader[vardepvalue] = "${@get_linuxloader(d)}"
60get_musl_loader[vardepvalue] = "${@get_musl_loader(d)}"
61get_glibc_loader[vardepvalue] = "${@get_glibc_loader(d)}"