1
0

008-uclibc_libgcc_link.patch 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. --- a/src/mklibs
  2. +++ b/src/mklibs
  3. @@ -113,11 +113,8 @@ def library_depends_gcc_libnames(obj, so
  4. ret = []
  5. for i in libs:
  6. match = re.match("^(((?P<ld>ld\S*)|(lib(?P<lib>\S+))))\.so.*$", i)
  7. - if match and not soname in ("libpthread.so.0"):
  8. - if match.group('ld'):
  9. - ret.append(find_lib(match.group(0)))
  10. - elif match.group('lib'):
  11. - ret.append('-l%s' % match.group('lib'))
  12. + if match:
  13. + ret.append(find_lib(match.group(0)))
  14. return ' '.join(ret)
  15. class Symbol(object):
  16. @@ -584,6 +581,7 @@ while 1:
  17. extra_flags = []
  18. extra_pre_obj = []
  19. extra_post_obj = []
  20. + libgcc_link = find_lib("libgcc_s.so.1")
  21. symbols.update(library_symbols_used[library])
  22. @@ -614,9 +612,10 @@ while 1:
  23. cmd.append(pic_file)
  24. cmd.extend(extra_post_obj)
  25. cmd.extend(extra_flags)
  26. - cmd.append("-lgcc")
  27. 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 + "/")]])
  28. - cmd.append(library_depends_gcc_libnames(so_file, soname))
  29. + if soname != "libgcc_s.so.1":
  30. + cmd.append(library_depends_gcc_libnames(so_file, soname))
  31. + cmd.append(libgcc_link)
  32. command(target + "gcc", *cmd)
  33. ## DEBUG