004-libpthread_link.patch 1.2 KB

12345678910111213141516171819202122232425262728
  1. --- a/src/mklibs
  2. +++ b/src/mklibs
  3. @@ -106,14 +106,14 @@ def library_depends(obj):
  4. # Return a list of libraries the passed objects depend on. The
  5. # libraries are in "-lfoo" format suitable for passing to gcc.
  6. -def library_depends_gcc_libnames(obj):
  7. +def library_depends_gcc_libnames(obj, soname):
  8. if not os.access(obj, os.F_OK):
  9. raise Exception("Cannot find lib: " + obj)
  10. libs = library_depends(obj)
  11. ret = []
  12. for i in libs:
  13. match = re.match("^(((?P<ld>ld\S*)|(lib(?P<lib>\S+))))\.so.*$", i)
  14. - if match:
  15. + if match and not soname in ("libpthread.so.0"):
  16. if match.group('ld'):
  17. ret.append(find_lib(match.group(0)))
  18. elif match.group('lib'):
  19. @@ -628,7 +628,7 @@ while 1:
  20. cmd.extend(extra_flags)
  21. cmd.append("-lgcc")
  22. 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 + "/")]])
  23. - cmd.append(library_depends_gcc_libnames(so_file))
  24. + cmd.append(library_depends_gcc_libnames(so_file, soname))
  25. command(target + "gcc", *cmd)
  26. ## DEBUG