2
0

003-no_copy.patch 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. --- a/src/mklibs
  2. +++ b/src/mklibs
  3. @@ -463,7 +463,7 @@ while 1:
  4. passnr = passnr + 1
  5. # Gather all already reduced libraries and treat them as objects as well
  6. small_libs = []
  7. - for lib in regexpfilter(os.listdir(dest_path), "(.*-so-stripped)$"):
  8. + for lib in regexpfilter(os.listdir(dest_path), "(.*-so)$"):
  9. obj = dest_path + "/" + lib
  10. small_libs.append(obj)
  11. inode = os.stat(obj)[ST_INO]
  12. @@ -579,12 +579,7 @@ while 1:
  13. if not so_file:
  14. sys.exit("File not found:" + library)
  15. pic_file = find_pic(library)
  16. - if not pic_file:
  17. - # No pic file, so we have to use the .so file, no reduction
  18. - debug(DEBUG_VERBOSE, "No pic file found for", so_file, "; copying")
  19. - command(target + "objcopy", "--strip-unneeded -R .note -R .comment",
  20. - so_file, dest_path + "/" + so_file_name + "-so-stripped")
  21. - else:
  22. + if pic_file:
  23. # we have a pic file, recompile
  24. debug(DEBUG_SPAM, "extracting from:", pic_file, "so_file:", so_file)
  25. soname = extract_soname(so_file)
  26. @@ -627,22 +622,14 @@ while 1:
  27. cmd.append(library_depends_gcc_libnames(so_file))
  28. command(target + "gcc", *cmd)
  29. - # strip result
  30. - command(target + "objcopy", "--strip-unneeded -R .note -R .comment",
  31. - dest_path + "/" + so_file_name + "-so",
  32. - dest_path + "/" + so_file_name + "-so-stripped")
  33. ## DEBUG
  34. debug(DEBUG_VERBOSE, so_file, "\t", `os.stat(so_file)[ST_SIZE]`)
  35. debug(DEBUG_VERBOSE, dest_path + "/" + so_file_name + "-so", "\t",
  36. `os.stat(dest_path + "/" + so_file_name + "-so")[ST_SIZE]`)
  37. - debug(DEBUG_VERBOSE, dest_path + "/" + so_file_name + "-so-stripped",
  38. - "\t", `os.stat(dest_path + "/" + so_file_name + "-so-stripped")[ST_SIZE]`)
  39. # Finalising libs and cleaning up
  40. -for lib in regexpfilter(os.listdir(dest_path), "(.*)-so-stripped$"):
  41. - os.rename(dest_path + "/" + lib + "-so-stripped", dest_path + "/" + lib)
  42. -for lib in regexpfilter(os.listdir(dest_path), "(.*-so)$"):
  43. - os.remove(dest_path + "/" + lib)
  44. +for lib in regexpfilter(os.listdir(dest_path), "(.*)-so$"):
  45. + os.rename(dest_path + "/" + lib + "-so", dest_path + "/" + lib)
  46. # Canonicalize library names.
  47. for lib in regexpfilter(os.listdir(dest_path), "(.*so[.\d]*)$"):