summaryrefslogtreecommitdiff
path: root/meta/recipes-core/eglibc/eglibc-ld.inc
blob: b3eb46e160362278b58964e755f31550190a4831 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
def ld_append_if_tune_exists(d, infos, dict):
	tune = d.getVar("DEFAULTTUNE", True) or ""
	libdir = d.getVar("base_libdir", True) or ""
	if dict.has_key(tune):
		infos['ldconfig'].add('{"' + libdir + '/' + dict[tune][0] + '",' + dict[tune][1] + ' }')
		infos['lddrewrite'].add(libdir+'/'+dict[tune][0])

def eglibc_dl_info(d):
	ld_info_all = {
		"mips": ["ld.so.1", "FLAG_ELF_LIBC6"],
		"mips64-n32": ["ld.so.1", "FLAG_ELF_LIBC6"],
		"mips64": ["ld.so.1", "FLAG_ELF_LIBC6"],
		"mipsel": ["ld.so.1", "FLAG_ELF_LIBC6"],
		"mips64el-n32": ["ld.so.1", "FLAG_ELF_LIBC6"],
		"mips64el": ["ld.so.1", "FLAG_ELF_LIBC6"],
		"mips-nf": ["ld.so.1", "FLAG_ELF_LIBC6"],
		"mips64-nf-n32": ["ld.so.1", "FLAG_ELF_LIBC6"],
		"mips64-nf": ["ld.so.1", "FLAG_ELF_LIBC6"],
		"mips64el-nf-n32": ["ld.so.1", "FLAG_ELF_LIBC6"],
		"mips64el-nf": ["ld.so.1", "FLAG_ELF_LIBC6"],
		"powerpc": ["ld.so.1", "FLAG_ELF_LIBC6"],
		"powerpc-nf": ["ld.so.1", "FLAG_ELF_LIBC6"],
		"powerpc64": ["ld64.so.1", "FLAG_ELF_LIBC6"],
		"powerpc64-nf": ["ld64.so.1", "FLAG_ELF_LIBC6"],
		"core2": ["ld-linux.so.2", "FLAG_ELF_LIBC6"],
		"core2-64": ["ld-linux-x86-64.so.2", "FLAG_ELF_LIBC6"],
		"x86": ["ld-linux.so.2", "FLAG_ELF_LIBC6"],
		"x86-64": ["ld-linux-x86-64.so.2", "FLAG_ELF_LIBC6"],
		"i586": ["ld-linux.so.2", "FLAG_ELF_LIBC6"],
	}

	infos = {'ldconfig':set(), 'lddrewrite':set()}
	ld_append_if_tune_exists(d, infos, ld_info_all)

	#DEFAULTTUNE_MULTILIB_ORIGINAL
	original_tune=d.getVar("DEFAULTTUNE_MULTILIB_ORIGINAL",True)
	if original_tune:
		localdata = bb.data.createCopy(d)
		localdata.setVar("DEFAULTTUNE", original_tune)
		ld_append_if_tune_exists(localdata, infos, ld_info_all)

	variants = d.getVar("MULTILIB_VARIANTS", True) or ""
	for item in variants.split():
		localdata = bb.data.createCopy(d)
		overrides = localdata.getVar("OVERRIDES", False) + ":virtclass-multilib-" + item
		localdata.setVar("OVERRIDES", overrides)
		bb.data.update_data(localdata)
		ld_append_if_tune_exists(localdata, infos, ld_info_all)
	infos['ldconfig'] = ','.join(infos['ldconfig'])
	infos['lddrewrite'] = ' '.join(infos['lddrewrite'])
	return infos

EGLIBC_KNOWN_INTERPRETER_NAMES = "${@eglibc_dl_info(d)['ldconfig']}"
RTLDLIST = "${@eglibc_dl_info(d)['lddrewrite']}"