[tools] mklibs: upgrade to 0.1.37
[openwrt/svn-archive/archive.git] / tools / mklibs / patches / 004-libpthread_link.patch
1 --- a/src/mklibs
2 +++ b/src/mklibs
3 @@ -106,14 +106,14 @@
4
5 # Return a list of libraries the passed objects depend on. The
6 # libraries are in "-lfoo" format suitable for passing to gcc.
7 -def library_depends_gcc_libnames(obj):
8 +def library_depends_gcc_libnames(obj, soname):
9 if not os.access(obj, os.F_OK):
10 raise Exception("Cannot find lib: " + obj)
11 libs = library_depends(obj)
12 ret = []
13 for i in libs:
14 match = re.match("^(((?P<ld>ld\S*)|(lib(?P<lib>\S+))))\.so.*$", i)
15 - if match:
16 + if match and not soname in ("libpthread.so.0"):
17 if match.group('ld'):
18 ret.append(find_lib(match.group(0)))
19 elif match.group('lib'):
20 @@ -617,7 +617,7 @@
21 cmd.extend(extra_flags)
22 cmd.append("-lgcc")
23 cmd.extend(["-L%s" % a for a in [dest_path] + [sysroot + b for b in lib_path if sysroot == "" or b not in ("/" + libdir + "/", "/usr/" + libdir + "/")]])
24 - cmd.append(library_depends_gcc_libnames(so_file))
25 + cmd.append(library_depends_gcc_libnames(so_file, soname))
26 command(target + "gcc", *cmd)
27
28 ## DEBUG