diff options
author | Yuanjie Huang <yuanjie.huang@windriver.com> | 2015-07-03 13:42:31 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-07-08 00:01:23 +0100 |
commit | 389d010b9a0a158299045befb0259b5131d5666f (patch) | |
tree | 510d96c6c9cee809cec4fe4587ea5c0b880eb161 /meta/recipes-devtools/mklibs | |
parent | abe6459c28a8e30ab6a9da76f27370c24c4746ee (diff) | |
download | poky-389d010b9a0a158299045befb0259b5131d5666f.tar.gz |
mklibs-native: two fixes
1. Show GNU unique symbols as provided symbols
2. Remove dependency on dpkg
Both have been submitted to mklibs maillist:
https://lists.debian.org/debian-boot/2015/07/msg00018.html
https://lists.debian.org/debian-boot/2015/07/msg00004.html
(From OE-Core rev: b18618a85e3e1483832d525115dafcd7d9be4b65)
Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com>
Signed-off-by: Roy Li <rongqing.li@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/mklibs')
3 files changed, 117 insertions, 0 deletions
diff --git a/meta/recipes-devtools/mklibs/files/fix_cross_compile.patch b/meta/recipes-devtools/mklibs/files/fix_cross_compile.patch new file mode 100644 index 0000000000..7eb86590cc --- /dev/null +++ b/meta/recipes-devtools/mklibs/files/fix_cross_compile.patch | |||
@@ -0,0 +1,81 @@ | |||
1 | Remove dependency on dpkg | ||
2 | |||
3 | Upstream-Status Submitted | ||
4 | |||
5 | Asking the host OS whether it supports multiarch is not useful | ||
6 | in a cross-compilation environment, or if the user has specified | ||
7 | a libdir explicitly. So this patch, based on the work of Mentor | ||
8 | Graphics, removes mklibs's dependency on dpkg package. | ||
9 | |||
10 | Signed-off-by: Yuanjie Huang <Yuanjie.Huang@windriver.com> | ||
11 | src/mklibs | 30 +++++++++++++++++++----------- | ||
12 | 1 file changed, 19 insertions(+), 11 deletions(-) | ||
13 | |||
14 | diff --git a/src/mklibs b/src/mklibs | ||
15 | index d9b784b..c5614ea 100755 | ||
16 | --- a/src/mklibs | ||
17 | +++ b/src/mklibs | ||
18 | @@ -261,6 +261,11 @@ def extract_soname(so_file): | ||
19 | return "" | ||
20 | |||
21 | def multiarch(paths): | ||
22 | + # Asking the host OS whether it supports multiarch is not useful | ||
23 | + # in a cross-compilation environment, or if the user has specified | ||
24 | + # a libdir explicitly. | ||
25 | + if sysroot != "" or libdir != "": | ||
26 | + return paths | ||
27 | devnull = open('/dev/null', 'w') | ||
28 | dpkg_architecture = subprocess.Popen( | ||
29 | ['dpkg-architecture', '-qDEB_HOST_MULTIARCH'], | ||
30 | @@ -340,7 +345,7 @@ lib_path = [] | ||
31 | dest_path = "DEST" | ||
32 | ldlib = "LDLIB" | ||
33 | include_default_lib_path = "yes" | ||
34 | -default_lib_path = multiarch(["/lib/", "/usr/lib/", "/usr/X11R6/lib/"]) | ||
35 | +default_lib_path = ["/lib/", "/usr/lib/", "/usr/X11R6/lib/"] | ||
36 | libc_extras_dir = "/usr/lib/libc_pic" | ||
37 | libc_extras_dir_default = True | ||
38 | libdir = "lib" | ||
39 | @@ -386,7 +391,7 @@ for opt, arg in optlist: | ||
40 | elif opt == "--libdir": | ||
41 | libdir = arg | ||
42 | elif opt in ("--help", "-h"): | ||
43 | - usage(0) | ||
44 | + usage(0) | ||
45 | sys.exit(0) | ||
46 | elif opt in ("--version", "-V"): | ||
47 | version(vers) | ||
48 | @@ -395,6 +400,7 @@ for opt, arg in optlist: | ||
49 | print "WARNING: unknown option: " + opt + "\targ: " + arg | ||
50 | |||
51 | if include_default_lib_path == "yes": | ||
52 | + default_lib_path = multiarch(default_lib_path) | ||
53 | lib_path.extend([a.replace("/lib/", "/" + libdir + "/") for a in default_lib_path]) | ||
54 | |||
55 | if libc_extras_dir_default: | ||
56 | @@ -661,16 +669,16 @@ ld_path_name = os.path.dirname(ldlib) | ||
57 | ld_full_path = "../" + ldlib | ||
58 | ld_file = find_lib(ld_file_name) | ||
59 | |||
60 | -if ld_path_name != "/lib": | ||
61 | - if os.access(dest_path + "/" + ld_file_name, os.F_OK): | ||
62 | - os.remove(dest_path + "/" + ld_file_name) | ||
63 | +#if ld_path_name != "/lib": | ||
64 | +# if os.access(dest_path + "/" + ld_file_name, os.F_OK): | ||
65 | +# os.remove(dest_path + "/" + ld_file_name) | ||
66 | |||
67 | -if not os.path.exists(dest_path + "/../" + ld_path_name): | ||
68 | - os.mkdir(dest_path + "/../" + ld_path_name) | ||
69 | +#if not os.path.exists(dest_path + "/../" + ld_path_name): | ||
70 | +# os.mkdir(dest_path + "/../" + ld_path_name) | ||
71 | |||
72 | -if not os.access(dest_path + "/" + ld_full_path, os.F_OK): | ||
73 | - debug(DEBUG_NORMAL, "I: stripping and copying dynamic linker to " + ld_full_path) | ||
74 | +if not os.access(dest_path + "/" + ld_file_name, os.F_OK): | ||
75 | + debug(DEBUG_NORMAL, "I: stripping and copying dynamic linker to " + ld_file_name) | ||
76 | command(target + "objcopy", "--strip-unneeded -R .note -R .comment", | ||
77 | - ld_file, dest_path + "/" + ld_full_path) | ||
78 | + ld_file, dest_path + "/" + ld_file_name) | ||
79 | |||
80 | -os.chmod(dest_path + "/" + ld_full_path, 0755) | ||
81 | +os.chmod(dest_path + "/" + ld_file_name, 0755) | ||
diff --git a/meta/recipes-devtools/mklibs/files/show-GNU-unique-symbols-as-provided-symbols.patch b/meta/recipes-devtools/mklibs/files/show-GNU-unique-symbols-as-provided-symbols.patch new file mode 100644 index 0000000000..3f14ca1e75 --- /dev/null +++ b/meta/recipes-devtools/mklibs/files/show-GNU-unique-symbols-as-provided-symbols.patch | |||
@@ -0,0 +1,34 @@ | |||
1 | From eddf04c7f8312e9c29cdb24e431b7e4fb2cc70ed Mon Sep 17 00:00:00 2001 | ||
2 | From: Yuanjie Huang <yuanjie.huang@windriver.com> | ||
3 | Date: Wed, 15 Apr 2015 14:00:06 +0800 | ||
4 | Subject: [PATCH] Show GNU unique symbols as provided symbols | ||
5 | |||
6 | Upstream-Status Submitted | ||
7 | |||
8 | GNU Unique symbol is a GNU extension employed by new version of GCC | ||
9 | by default. Even Standard C++ library in GCC 4.9 provides some symbols, | ||
10 | such as _ZNSs4_Rep20_S_empty_rep_storageE in this binding type instead | ||
11 | of ELF standard weak binding. | ||
12 | This patch adds support of this new binding type to mklibs-readelf. | ||
13 | |||
14 | Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com> | ||
15 | --- | ||
16 | src/mklibs-readelf/main.cpp | 2 +- | ||
17 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
18 | |||
19 | diff --git a/src/mklibs-readelf/main.cpp b/src/mklibs-readelf/main.cpp | ||
20 | index 56d93f8..0134530 100644 | ||
21 | --- a/src/mklibs-readelf/main.cpp | ||
22 | +++ b/src/mklibs-readelf/main.cpp | ||
23 | @@ -88,7 +88,7 @@ static void process_symbols_provided (const Elf::section_type<Elf::section_type_ | ||
24 | uint8_t type = symbol->get_type (); | ||
25 | const std::string &name = symbol->get_name_string (); | ||
26 | |||
27 | - if (bind != STB_GLOBAL && bind != STB_WEAK) | ||
28 | + if (bind != STB_GLOBAL && bind != STB_WEAK && bind != STB_GNU_UNIQUE) | ||
29 | continue; | ||
30 | if (shndx == SHN_UNDEF || shndx == SHN_ABS) | ||
31 | continue; | ||
32 | -- | ||
33 | 1.8.5.2.233.g932f7e4 | ||
34 | |||
diff --git a/meta/recipes-devtools/mklibs/mklibs-native_0.1.40.bb b/meta/recipes-devtools/mklibs/mklibs-native_0.1.40.bb index 0bb5f2191c..d6905ac782 100644 --- a/meta/recipes-devtools/mklibs/mklibs-native_0.1.40.bb +++ b/meta/recipes-devtools/mklibs/mklibs-native_0.1.40.bb | |||
@@ -11,6 +11,8 @@ SRC_URI = "http://ftp.de.debian.org/debian/pool/main/m/mklibs/${BPN}_${PV}.tar.x | |||
11 | file://fix_STT_GNU_IFUNC.patch\ | 11 | file://fix_STT_GNU_IFUNC.patch\ |
12 | file://sysrooted-ldso.patch \ | 12 | file://sysrooted-ldso.patch \ |
13 | file://avoid-failure-on-symbol-provided-by-application.patch \ | 13 | file://avoid-failure-on-symbol-provided-by-application.patch \ |
14 | file://show-GNU-unique-symbols-as-provided-symbols.patch \ | ||
15 | file://fix_cross_compile.patch \ | ||
14 | " | 16 | " |
15 | 17 | ||
16 | SRC_URI[md5sum] = "e1dafe5f962caa9dc5f2651c0723812a" | 18 | SRC_URI[md5sum] = "e1dafe5f962caa9dc5f2651c0723812a" |