diff options
author | Felix Fietkau <nbd@openwrt.org> | 2009-08-08 02:24:59 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2009-08-08 02:24:59 +0000 |
commit | 065b224a91a773709276be4f466f93dc2210ac01 (patch) | |
tree | 2eb37ef15b0a798a37319750583ee091eeff1ff4 /tools/mklibs/patches | |
parent | 3a0b1d7c4a520a837c80cdc4a3a37cdbc006d6b3 (diff) | |
download | upstream-065b224a91a773709276be4f466f93dc2210ac01.tar.gz upstream-065b224a91a773709276be4f466f93dc2210ac01.tar.bz2 upstream-065b224a91a773709276be4f466f93dc2210ac01.zip |
mklibs: do not touch libraries that cannot be rebuilt
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@17172 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'tools/mklibs/patches')
-rw-r--r-- | tools/mklibs/patches/003-no_copy.patch | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/tools/mklibs/patches/003-no_copy.patch b/tools/mklibs/patches/003-no_copy.patch new file mode 100644 index 0000000000..bd6505aff9 --- /dev/null +++ b/tools/mklibs/patches/003-no_copy.patch @@ -0,0 +1,50 @@ +--- a/src/mklibs.py ++++ b/src/mklibs.py +@@ -440,7 +440,7 @@ while 1: + 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] +@@ -552,12 +552,7 @@ while 1: + 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) +@@ -600,22 +595,14 @@ while 1: + 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 + debug(DEBUG_VERBOSE, so_file, "\t", `os.stat(so_file)[ST_SIZE]`) + debug(DEBUG_VERBOSE, dest_path + "/" + so_file_name + "-so", "\t", + `os.stat(dest_path + "/" + so_file_name + "-so")[ST_SIZE]`) +- debug(DEBUG_VERBOSE, dest_path + "/" + so_file_name + "-so-stripped", +- "\t", `os.stat(dest_path + "/" + so_file_name + "-so-stripped")[ST_SIZE]`) + + # 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. + for lib in regexpfilter(os.listdir(dest_path), "(.*so[.\d]*)$"): |