b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | --- a/src/mklibs |
| 2 | +++ b/src/mklibs |
| 3 | @@ -106,14 +106,14 @@ def library_depends(obj): |
| 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 | @@ -628,7 +628,7 @@ while 1: |
| 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 |