blob: b4c413494a27c0e2355edb2d4151ef7833da8c97 [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001def get_musl_loader(d):
2 import re
3 dynamic_loader = None
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05004
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08005 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
Brad Bishopd7bf8c12018-02-25 22:55:05 -050023
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080024def get_glibc_loader(d):
25 import re
Brad Bishopd7bf8c12018-02-25 22:55:05 -050026
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080027 dynamic_loader = None
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):
48 overrides = d.getVar("OVERRIDES").split(":")
49
50 if "libc-baremetal" in overrides:
51 return None
52
53 if "libc-musl" in overrides:
54 dynamic_loader = get_musl_loader(d)
55 else:
56 dynamic_loader = get_glibc_loader(d)
57 return dynamic_loader
58
59get_linuxloader[vardepvalue] = "${@get_linuxloader(d)}"
60get_musl_loader[vardepvalue] = "${@get_musl_loader(d)}"
61get_glibc_loader[vardepvalue] = "${@get_glibc_loader(d)}"