3 @@ -161,9 +161,10 @@ def undefined_symbols(obj):
6 class ProvidedSymbol(Symbol):
7 - def __init__(self, name, version, library, default_version):
8 + def __init__(self, name, version, library, default_version, weak):
9 super(ProvidedSymbol, self).__init__(name, version, library)
10 self.default_version = default_version
15 @@ -204,11 +205,15 @@ def provided_symbols(obj):
16 if version_string.lower() not in ('base', 'none'):
17 version = version_string
20 + if weak_string.lower() == 'true':
23 default_version = False
24 if default_version_string.lower() == 'true':
25 default_version = True
27 - result.append(ProvidedSymbol(name, version, library, default_version))
28 + result.append(ProvidedSymbol(name, version, library, default_version, weak))
32 @@ -476,6 +481,9 @@ while 1:
33 debug(DEBUG_SPAM, "present_symbols adding %s" % symbol)
34 names = symbol.base_names()
36 + if name in present_symbols:
37 + if symbol.library != present_symbols[name].library:
38 + needed_symbols[name] = UndefinedSymbol(name, True, symbol.version, symbol.library)
39 present_symbols[name] = symbol
42 @@ -567,12 +575,16 @@ while 1:
43 # may segfault in ptmalloc_init due to undefined weak reference
44 extra_pre_obj.append(sysroot + libc_extras_dir + "/soinit.o")
45 extra_post_obj.append(sysroot + libc_extras_dir + "/sofini.o")
46 - symbols.add(ProvidedSymbol('__dso_handle', None, None, True))
47 + symbols.add(ProvidedSymbol('__dso_handle', None, None, True, True))
49 - if soname in ("libc.so.0"):
50 - symbols.add(ProvidedSymbol('__uClibc_init', None, None, True))
51 - symbols.add(ProvidedSymbol('__uClibc_fini', None, None, True))
52 - extra_flags.append("-Wl,-init,__uClibc_init")
53 + if soname == "libc.so.0":
54 + symbols.add(ProvidedSymbol('__uClibc_init', None, None, True, True))
55 + symbols.add(ProvidedSymbol('__uClibc_fini', None, None, True, True))
56 + extra_pre_obj.append("-Wl,-init,__uClibc_init")
58 + if soname == "libpthread.so.0":
59 + symbols.add(ProvidedSymbol('__pthread_initialize_minimal_internal', None, None, True, True))
60 + extra_flags.append("-Wl,-z,nodelete,-z,initfirst,-init=__pthread_initialize_minimal_internal")
62 map_file = find_pic_map(library)