2012-06-10 17:07:46 +00:00
|
|
|
--- a/src/mklibs
|
|
|
|
+++ b/src/mklibs
|
2019-07-26 21:45:47 +00:00
|
|
|
@@ -472,7 +472,7 @@ while 1:
|
2009-08-08 02:24:59 +00:00
|
|
|
passnr = passnr + 1
|
|
|
|
# Gather all already reduced libraries and treat them as objects as well
|
|
|
|
small_libs = []
|
|
|
|
- for lib in regexpfilter(os.listdir(dest_path), "(.*-so-stripped)$"):
|
|
|
|
+ for lib in regexpfilter(os.listdir(dest_path), "(.*-so)$"):
|
|
|
|
obj = dest_path + "/" + lib
|
|
|
|
small_libs.append(obj)
|
|
|
|
inode = os.stat(obj)[ST_INO]
|
2019-07-26 21:45:47 +00:00
|
|
|
@@ -588,12 +588,7 @@ while 1:
|
2009-08-08 02:24:59 +00:00
|
|
|
if not so_file:
|
|
|
|
sys.exit("File not found:" + library)
|
|
|
|
pic_file = find_pic(library)
|
|
|
|
- if not pic_file:
|
|
|
|
- # No pic file, so we have to use the .so file, no reduction
|
|
|
|
- debug(DEBUG_VERBOSE, "No pic file found for", so_file, "; copying")
|
|
|
|
- command(target + "objcopy", "--strip-unneeded -R .note -R .comment",
|
|
|
|
- so_file, dest_path + "/" + so_file_name + "-so-stripped")
|
|
|
|
- else:
|
|
|
|
+ if pic_file:
|
|
|
|
# we have a pic file, recompile
|
|
|
|
debug(DEBUG_SPAM, "extracting from:", pic_file, "so_file:", so_file)
|
|
|
|
soname = extract_soname(so_file)
|
2019-07-26 21:45:47 +00:00
|
|
|
@@ -636,22 +631,14 @@ while 1:
|
2009-08-08 02:24:59 +00:00
|
|
|
cmd.append(library_depends_gcc_libnames(so_file))
|
|
|
|
command(target + "gcc", *cmd)
|
|
|
|
|
|
|
|
- # strip result
|
|
|
|
- command(target + "objcopy", "--strip-unneeded -R .note -R .comment",
|
|
|
|
- dest_path + "/" + so_file_name + "-so",
|
|
|
|
- dest_path + "/" + so_file_name + "-so-stripped")
|
|
|
|
## DEBUG
|
2022-02-25 04:27:34 +00:00
|
|
|
debug(DEBUG_VERBOSE, so_file, "\t", str(os.stat(so_file)[ST_SIZE]))
|
2009-08-08 02:24:59 +00:00
|
|
|
debug(DEBUG_VERBOSE, dest_path + "/" + so_file_name + "-so", "\t",
|
2022-02-25 04:27:34 +00:00
|
|
|
str(os.stat(dest_path + "/" + so_file_name + "-so")[ST_SIZE]))
|
2009-08-08 02:24:59 +00:00
|
|
|
- debug(DEBUG_VERBOSE, dest_path + "/" + so_file_name + "-so-stripped",
|
2022-02-25 04:27:34 +00:00
|
|
|
- "\t", str(os.stat(dest_path + "/" + so_file_name + "-so-stripped")[ST_SIZE]))
|
2009-08-08 02:24:59 +00:00
|
|
|
|
|
|
|
# Finalising libs and cleaning up
|
|
|
|
-for lib in regexpfilter(os.listdir(dest_path), "(.*)-so-stripped$"):
|
|
|
|
- os.rename(dest_path + "/" + lib + "-so-stripped", dest_path + "/" + lib)
|
|
|
|
-for lib in regexpfilter(os.listdir(dest_path), "(.*-so)$"):
|
|
|
|
- os.remove(dest_path + "/" + lib)
|
|
|
|
+for lib in regexpfilter(os.listdir(dest_path), "(.*)-so$"):
|
|
|
|
+ os.rename(dest_path + "/" + lib + "-so", dest_path + "/" + lib)
|
|
|
|
|
|
|
|
# Canonicalize library names.
|
2019-07-26 21:45:47 +00:00
|
|
|
for lib in sorted(regexpfilter(os.listdir(dest_path), "(.*so[.\d]*)$")):
|