summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2021-05-18 08:24:46 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-05-18 23:52:53 +0100
commite897e02d21e5dc042ac3265d4ab2777c7688e1bb (patch)
tree72ade689e6a3a9d98e2463b41042d2d373da3c16
parentc879b0797b07572c85bc9d48053f601d6fcf3087 (diff)
downloadpoky-e897e02d21e5dc042ac3265d4ab2777c7688e1bb.tar.gz
mklibs: remove recipes and class
This is not enabled or tested by default, and has never been ported to python 3 upstream[1], which means it doesn't work at all with plain poky. If you need it, please put it in a separate layer and/or modernize to work with py3. https://salsa.debian.org/installer-team/mklibs/-/blob/master/src/mklibs (From OE-Core rev: 908df863b419d1cad7317153101fc827e7e3a354) Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Jacob Kroon <jacob.kroon@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/image-mklibs.bbclass56
-rw-r--r--meta/conf/distro/include/maintainers.inc1
-rw-r--r--meta/recipes-devtools/mklibs/files/ac_init_fix.patch19
-rw-r--r--meta/recipes-devtools/mklibs/files/avoid-failure-on-symbol-provided-by-application.patch103
-rw-r--r--meta/recipes-devtools/mklibs/files/fix_STT_GNU_IFUNC.patch26
-rw-r--r--meta/recipes-devtools/mklibs/files/fix_cross_compile.patch81
-rw-r--r--meta/recipes-devtools/mklibs/files/show-GNU-unique-symbols-as-provided-symbols.patch34
-rw-r--r--meta/recipes-devtools/mklibs/files/sysrooted-ldso.patch18
-rw-r--r--meta/recipes-devtools/mklibs/mklibs-native_0.1.44.bb22
9 files changed, 0 insertions, 360 deletions
diff --git a/meta/classes/image-mklibs.bbclass b/meta/classes/image-mklibs.bbclass
deleted file mode 100644
index 68e11d4365..0000000000
--- a/meta/classes/image-mklibs.bbclass
+++ /dev/null
@@ -1,56 +0,0 @@
1do_rootfs[depends] += "mklibs-native:do_populate_sysroot"
2
3IMAGE_PREPROCESS_COMMAND += "mklibs_optimize_image; "
4
5inherit linuxloader
6
7mklibs_optimize_image_doit() {
8 rm -rf ${WORKDIR}/mklibs
9 mkdir -p ${WORKDIR}/mklibs/dest
10 cd ${IMAGE_ROOTFS}
11 du -bs > ${WORKDIR}/mklibs/du.before.mklibs.txt
12
13 # Build a list of dynamically linked executable ELF files.
14 # Omit libc/libpthread as a special case because it has an interpreter
15 # but is primarily what we intend to strip down.
16 for i in `find . -type f -executable ! -name 'libc-*' ! -name 'libpthread-*'`; do
17 file $i | grep -q ELF || continue
18 ${HOST_PREFIX}readelf -l $i | grep -q INTERP || continue
19 echo $i
20 done > ${WORKDIR}/mklibs/executables.list
21
22 dynamic_loader=${@get_linuxloader(d)}
23
24 mklibs -v \
25 --ldlib ${dynamic_loader} \
26 --libdir ${baselib} \
27 --sysroot ${PKG_CONFIG_SYSROOT_DIR} \
28 --gcc-options "--sysroot=${PKG_CONFIG_SYSROOT_DIR}" \
29 --root ${IMAGE_ROOTFS} \
30 --target `echo ${TARGET_PREFIX} | sed 's/-$//' ` \
31 -d ${WORKDIR}/mklibs/dest \
32 `cat ${WORKDIR}/mklibs/executables.list`
33
34 cd ${WORKDIR}/mklibs/dest
35 for i in *
36 do
37 cp $i `find ${IMAGE_ROOTFS} -name $i`
38 done
39
40 cd ${IMAGE_ROOTFS}
41 du -bs > ${WORKDIR}/mklibs/du.after.mklibs.txt
42
43 echo rootfs size before mklibs optimization: `cat ${WORKDIR}/mklibs/du.before.mklibs.txt`
44 echo rootfs size after mklibs optimization: `cat ${WORKDIR}/mklibs/du.after.mklibs.txt`
45}
46
47mklibs_optimize_image() {
48 for img in ${MKLIBS_OPTIMIZED_IMAGES}
49 do
50 if [ "${img}" = "${PN}" ] || [ "${img}" = "all" ]
51 then
52 mklibs_optimize_image_doit
53 break
54 fi
55 done
56}
diff --git a/meta/conf/distro/include/maintainers.inc b/meta/conf/distro/include/maintainers.inc
index bfebd68acf..1467a10f8a 100644
--- a/meta/conf/distro/include/maintainers.inc
+++ b/meta/conf/distro/include/maintainers.inc
@@ -508,7 +508,6 @@ RECIPE_MAINTAINER_pn-mingetty = "Yi Zhao <yi.zhao@windriver.com>"
508RECIPE_MAINTAINER_pn-mini-x-session = "Armin Kuster <akuster808@gmail.com>" 508RECIPE_MAINTAINER_pn-mini-x-session = "Armin Kuster <akuster808@gmail.com>"
509RECIPE_MAINTAINER_pn-minicom = "Anuj Mittal <anuj.mittal@intel.com>" 509RECIPE_MAINTAINER_pn-minicom = "Anuj Mittal <anuj.mittal@intel.com>"
510RECIPE_MAINTAINER_pn-mkfontscale = "Armin Kuster <akuster808@gmail.com>" 510RECIPE_MAINTAINER_pn-mkfontscale = "Armin Kuster <akuster808@gmail.com>"
511RECIPE_MAINTAINER_pn-mklibs-native = "Robert Yang <liezhi.yang@windriver.com>"
512RECIPE_MAINTAINER_pn-mmc-utils = "Anuj Mittal <anuj.mittal@intel.com>" 511RECIPE_MAINTAINER_pn-mmc-utils = "Anuj Mittal <anuj.mittal@intel.com>"
513RECIPE_MAINTAINER_pn-mobile-broadband-provider-info = "Alexander Kanavin <alex.kanavin@gmail.com>" 512RECIPE_MAINTAINER_pn-mobile-broadband-provider-info = "Alexander Kanavin <alex.kanavin@gmail.com>"
514RECIPE_MAINTAINER_pn-modutils-initscripts = "Yi Zhao <yi.zhao@windriver.com>" 513RECIPE_MAINTAINER_pn-modutils-initscripts = "Yi Zhao <yi.zhao@windriver.com>"
diff --git a/meta/recipes-devtools/mklibs/files/ac_init_fix.patch b/meta/recipes-devtools/mklibs/files/ac_init_fix.patch
deleted file mode 100644
index 422af10420..0000000000
--- a/meta/recipes-devtools/mklibs/files/ac_init_fix.patch
+++ /dev/null
@@ -1,19 +0,0 @@
1Get the version of mklibs by simpler means. The MKLIBS_VERSION string in the
2configure.ac file is replaced with real version string by the
3do_configure_prepend() function from the recipe .bb file.
4
5Upstream-Status: Inappropriate [configuration]
6
7Nitin A Kamble <nitin.a.kamble@intel.com>
8Date: 2011/01/24
9
10Index: mklibs/configure.ac
11===================================================================
12--- mklibs.orig/configure.ac 2010-02-21 17:34:56.000000000 -0800
13+++ mklibs/configure.ac 2011-01-24 18:52:19.943242079 -0800
14@@ -1,4 +1,4 @@
15-AC_INIT([mklibs],m4_esyscmd(dpkg-parsechangelog | perl -ne 'print $1 if m/^Version: (.*)$/;'))
16+AC_INIT([mklibs], MKLIBS_VERSION)
17 AM_INIT_AUTOMAKE([foreign no-define])
18 AC_CONFIG_HEADERS([config.h])
19 AM_MAINTAINER_MODE
diff --git a/meta/recipes-devtools/mklibs/files/avoid-failure-on-symbol-provided-by-application.patch b/meta/recipes-devtools/mklibs/files/avoid-failure-on-symbol-provided-by-application.patch
deleted file mode 100644
index 17d9af4de4..0000000000
--- a/meta/recipes-devtools/mklibs/files/avoid-failure-on-symbol-provided-by-application.patch
+++ /dev/null
@@ -1,103 +0,0 @@
1From dcb45256970b15b672d0004533826c94083356e5 Mon Sep 17 00:00:00 2001
2From: Yuanjie Huang <yuanjie.huang@windriver.com>
3Date: Fri, 17 Apr 2015 14:48:20 +0800
4Subject: [PATCH 4/6] avoid failure on symbol provided by application
5
6Upstream-Status: Pending
7
8Undefined symbols in a library can be provided by the application
9that links to the library, such as `logsink' in libmultipath.so.0.
10This fix checks the type of object in which the symbol is needed
11and the existence of the symbol in application, when a symbol
12cannot be provided by libraries. It prevents false alarm on absence
13of symbols.
14
15Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com>
16
17---
18 src/mklibs | 28 ++++++++++++++++++++++++----
19 1 file changed, 24 insertions(+), 4 deletions(-)
20
21diff --git a/src/mklibs b/src/mklibs
22index a3533c0..66b7a09 100755
23--- a/src/mklibs
24+++ b/src/mklibs
25@@ -133,9 +133,9 @@ class Symbol(object):
26 return '@'.join(ret)
27
28 class UndefinedSymbol(Symbol):
29- def __init__(self, name, weak, version, library):
30+ def __init__(self, name, weak, version, library, object):
31 super(UndefinedSymbol, self).__init__(name, version, library)
32- self.weak, self.library = weak, library
33+ self.weak, self.library, self.object = weak, library, object
34
35 def symbol_is_blacklisted(name):
36 # The ARM Embedded ABI spec states symbols under this namespace as
37@@ -152,6 +152,11 @@ def undefined_symbols(obj):
38
39 output = command("mklibs-readelf", "--print-symbols-undefined", obj)
40
41+ if len(obj) > len(dest_path) and obj[:len(dest_path)] == dest_path:
42+ object = obj[len(dest_path) + 1:-len('-so-stripped')]
43+ else:
44+ object = obj
45+
46 result = []
47 for line in output:
48 name, weak_string, version_string, library_string = line.split()[:4]
49@@ -171,7 +176,7 @@ def undefined_symbols(obj):
50 if library_string.lower() != 'none':
51 library = library_string
52
53- result.append(UndefinedSymbol(name, weak, version, library))
54+ result.append(UndefinedSymbol(name, weak, version, library, object))
55
56 return result
57
58@@ -498,12 +503,13 @@ while 1:
59 and re.search("^ps_", str(symbol)))
60 and not (re.search("ld-linux.so.3$", str(symbol)))
61 and not (re.search("^__gnu_local_gp", str(symbol)))):
62- debug(DEBUG_SPAM, "needed_symbols adding %s, weak: %s" % (symbol, symbol.weak))
63+ debug(DEBUG_SPAM, "needed_symbols adding %s, weak: %s, for %s" % (symbol, symbol.weak, obj))
64 needed_symbols[str(symbol)] = symbol
65 libraries.update(library_depends(obj))
66
67 # calculate what symbols are present in small_libs and available_libs
68 present_symbols = {}
69+ present_symbol_progs = {}
70 checked_libs = small_libs
71 checked_libs.extend(available_libs)
72 checked_libs.append(sysroot + ldlib)
73@@ -513,6 +519,12 @@ while 1:
74 names = symbol.base_names()
75 for name in names:
76 present_symbols[name] = symbol
77+ if not so_pattern.match(lib):
78+ debug(DEBUG_SPAM, "present_symbol_progs adding %s, from executable %s" % (' '.join(names), lib))
79+ for name in names:
80+ progs = present_symbol_progs.get(name, set())
81+ progs.add(lib)
82+ present_symbol_progs[name] = progs
83
84 # are we finished?
85 num_unresolved = 0
86@@ -568,6 +580,14 @@ while 1:
87 for name in needed_symbols:
88 if not name in symbol_provider:
89 if not needed_symbols[name].weak:
90+ # WORKAROUND: Undefined symbols in a library can be provided by the application
91+ # that links to the library. So if the object which requires the symbol is a library
92+ # and some application can provide the symbol, the undefined symbol is skipped.
93+ symbol = needed_symbols[name]
94+ if so_pattern.match(symbol.object) and present_symbol_progs.get(name, None):
95+ debug(DEBUG_SPAM, "symbol %s in library %s is provided by executable %s" \
96+ % (name, symbol.object, ' '.join(present_symbol_progs[name])))
97+ continue
98 raise Exception("No library provides non-weak %s" % name)
99 else:
100 lib = symbol_provider[name]
101--
1022.16.1
103
diff --git a/meta/recipes-devtools/mklibs/files/fix_STT_GNU_IFUNC.patch b/meta/recipes-devtools/mklibs/files/fix_STT_GNU_IFUNC.patch
deleted file mode 100644
index d27a48916d..0000000000
--- a/meta/recipes-devtools/mklibs/files/fix_STT_GNU_IFUNC.patch
+++ /dev/null
@@ -1,26 +0,0 @@
1The libc6-dev in Ubuntu 9.04 is so old that the elf.h doesn't
2define STT_GNU_IFUNC, so we have to define it ourselves.
3
4Upstream-Status: Inappropriate [other] - old release specific, maybe removable
5
6-- Dexuan Cui (dexuan.cui@intel.com) Feb 16, 2011.
7
8diff --git a/src/mklibs-readelf/main.cpp b/src/mklibs-readelf/main.cpp
9index 2444c39..56d93f8 100644
10--- a/src/mklibs-readelf/main.cpp
11+++ b/src/mklibs-readelf/main.cpp
12@@ -6,6 +6,14 @@
13 #include <vector>
14
15 #include <elf.h>
16+/*
17+ * The /usr/include/elf.h in some distributions(like Ubuntu 9.04) doesn't
18+ * define the macro. We need to define it here.
19+ */
20+#ifndef STT_GNU_IFUNC
21+#define STT_GNU_IFUNC 10 /* Symbol is indirect code object */
22+#endif
23+
24 #include <getopt.h>
25
26 #include "elf.hpp"
diff --git a/meta/recipes-devtools/mklibs/files/fix_cross_compile.patch b/meta/recipes-devtools/mklibs/files/fix_cross_compile.patch
deleted file mode 100644
index 13e4606b80..0000000000
--- a/meta/recipes-devtools/mklibs/files/fix_cross_compile.patch
+++ /dev/null
@@ -1,81 +0,0 @@
1Remove dependency on dpkg
2
3Upstream-Status: Submitted
4
5Asking the host OS whether it supports multiarch is not useful
6in a cross-compilation environment, or if the user has specified
7a libdir explicitly. So this patch, based on the work of Mentor
8Graphics, removes mklibs's dependency on dpkg package.
9
10Signed-off-by: Yuanjie Huang <Yuanjie.Huang@windriver.com>
11 src/mklibs | 30 +++++++++++++++++++-----------
12 1 file changed, 19 insertions(+), 11 deletions(-)
13
14diff --git a/src/mklibs b/src/mklibs
15index 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
deleted file mode 100644
index bc56593e6a..0000000000
--- a/meta/recipes-devtools/mklibs/files/show-GNU-unique-symbols-as-provided-symbols.patch
+++ /dev/null
@@ -1,34 +0,0 @@
1From eddf04c7f8312e9c29cdb24e431b7e4fb2cc70ed Mon Sep 17 00:00:00 2001
2From: Yuanjie Huang <yuanjie.huang@windriver.com>
3Date: Wed, 15 Apr 2015 14:00:06 +0800
4Subject: [PATCH] Show GNU unique symbols as provided symbols
5
6Upstream-Status: Submitted
7
8GNU Unique symbol is a GNU extension employed by new version of GCC
9by default. Even Standard C++ library in GCC 4.9 provides some symbols,
10such as _ZNSs4_Rep20_S_empty_rep_storageE in this binding type instead
11of ELF standard weak binding.
12This patch adds support of this new binding type to mklibs-readelf.
13
14Signed-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
19diff --git a/src/mklibs-readelf/main.cpp b/src/mklibs-readelf/main.cpp
20index 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--
331.8.5.2.233.g932f7e4
34
diff --git a/meta/recipes-devtools/mklibs/files/sysrooted-ldso.patch b/meta/recipes-devtools/mklibs/files/sysrooted-ldso.patch
deleted file mode 100644
index 75500a029a..0000000000
--- a/meta/recipes-devtools/mklibs/files/sysrooted-ldso.patch
+++ /dev/null
@@ -1,18 +0,0 @@
1In cross builds we will have to respect sysroot
2
3Signed-off-by: Khem Raj <raj.khem@gmail.com>
4Upstream-Status: Pending
5
6Index: mklibs-0.1.39/src/mklibs
7===================================================================
8--- mklibs-0.1.39.orig/src/mklibs 2014-03-01 18:25:36.000000000 +0000
9+++ mklibs-0.1.39/src/mklibs 2014-10-19 00:51:46.813534596 +0000
10@@ -495,7 +495,7 @@
11 present_symbols = {}
12 checked_libs = small_libs
13 checked_libs.extend(available_libs)
14- checked_libs.append(ldlib)
15+ checked_libs.append(sysroot + ldlib)
16 for lib in checked_libs:
17 for symbol in provided_symbols(lib):
18 debug(DEBUG_SPAM, "present_symbols adding %s" % symbol)
diff --git a/meta/recipes-devtools/mklibs/mklibs-native_0.1.44.bb b/meta/recipes-devtools/mklibs/mklibs-native_0.1.44.bb
deleted file mode 100644
index 1784af1f4c..0000000000
--- a/meta/recipes-devtools/mklibs/mklibs-native_0.1.44.bb
+++ /dev/null
@@ -1,22 +0,0 @@
1SUMMARY = "Shared library optimisation tool"
2DESCRIPTION = "mklibs produces cut-down shared libraries that contain only the routines required by a particular set of executables."
3HOMEPAGE = "https://launchpad.net/mklibs"
4SECTION = "devel"
5LICENSE = "GPLv2+"
6LIC_FILES_CHKSUM = "file://debian/copyright;md5=98d31037b13d896e33890738ef01af64"
7
8SRC_URI = "http://snapshot.debian.org/archive/debian/20180828T214102Z/pool/main/m/mklibs/mklibs_${PV}.tar.xz \
9 file://ac_init_fix.patch\
10 file://fix_STT_GNU_IFUNC.patch\
11 file://sysrooted-ldso.patch \
12 file://avoid-failure-on-symbol-provided-by-application.patch \
13 file://show-GNU-unique-symbols-as-provided-symbols.patch \
14 file://fix_cross_compile.patch \
15"
16
17SRC_URI[md5sum] = "6b6eeb9b4016c6a7317acc28c89e32cc"
18SRC_URI[sha256sum] = "3af0b6bd35e5b6fc58d8b68827fbae2ff6b7e20dd2b238ccb9b49d84722066c2"
19
20UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/m/mklibs/"
21
22inherit autotools gettext native