summaryrefslogtreecommitdiffstats
path: root/import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/fix_cross_compile.patch
diff options
context:
space:
mode:
authorPatrick Williams <patrick@stwcx.xyz>2016-08-17 14:31:25 -0500
committerPatrick Williams <patrick@stwcx.xyz>2016-08-22 16:43:26 +0000
commit60f9d69e016b11c468c98ea75ba0a60c44afbbc4 (patch)
treeecb49581a9e41a37943c22cd9ef3f63451b20ee7 /import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/fix_cross_compile.patch
parente18c61205e0234b03697129c20cc69c9b3940efc (diff)
downloadtalos-openbmc-60f9d69e016b11c468c98ea75ba0a60c44afbbc4.tar.gz
talos-openbmc-60f9d69e016b11c468c98ea75ba0a60c44afbbc4.zip
yocto-poky: Move to import-layers subdir
We are going to import additional layers, so create a subdir to hold all of the layers that we import with git-subtree. Change-Id: I6f732153a22be8ca663035c518837e3cc5ec0799 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Diffstat (limited to 'import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/fix_cross_compile.patch')
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/fix_cross_compile.patch81
1 files changed, 81 insertions, 0 deletions
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/fix_cross_compile.patch b/import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/fix_cross_compile.patch
new file mode 100644
index 000000000..13e4606b8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/fix_cross_compile.patch
@@ -0,0 +1,81 @@
+Remove dependency on dpkg
+
+Upstream-Status: Submitted
+
+Asking the host OS whether it supports multiarch is not useful
+in a cross-compilation environment, or if the user has specified
+a libdir explicitly. So this patch, based on the work of Mentor
+Graphics, removes mklibs's dependency on dpkg package.
+
+Signed-off-by: Yuanjie Huang <Yuanjie.Huang@windriver.com>
+ src/mklibs | 30 +++++++++++++++++++-----------
+ 1 file changed, 19 insertions(+), 11 deletions(-)
+
+diff --git a/src/mklibs b/src/mklibs
+index d9b784b..c5614ea 100755
+--- a/src/mklibs
++++ b/src/mklibs
+@@ -261,6 +261,11 @@ def extract_soname(so_file):
+ return ""
+
+ def multiarch(paths):
++ # Asking the host OS whether it supports multiarch is not useful
++ # in a cross-compilation environment, or if the user has specified
++ # a libdir explicitly.
++ if sysroot != "" or libdir != "":
++ return paths
+ devnull = open('/dev/null', 'w')
+ dpkg_architecture = subprocess.Popen(
+ ['dpkg-architecture', '-qDEB_HOST_MULTIARCH'],
+@@ -340,7 +345,7 @@ lib_path = []
+ dest_path = "DEST"
+ ldlib = "LDLIB"
+ include_default_lib_path = "yes"
+-default_lib_path = multiarch(["/lib/", "/usr/lib/", "/usr/X11R6/lib/"])
++default_lib_path = ["/lib/", "/usr/lib/", "/usr/X11R6/lib/"]
+ libc_extras_dir = "/usr/lib/libc_pic"
+ libc_extras_dir_default = True
+ libdir = "lib"
+@@ -386,7 +391,7 @@ for opt, arg in optlist:
+ elif opt == "--libdir":
+ libdir = arg
+ elif opt in ("--help", "-h"):
+- usage(0)
++ usage(0)
+ sys.exit(0)
+ elif opt in ("--version", "-V"):
+ version(vers)
+@@ -395,6 +400,7 @@ for opt, arg in optlist:
+ print "WARNING: unknown option: " + opt + "\targ: " + arg
+
+ if include_default_lib_path == "yes":
++ default_lib_path = multiarch(default_lib_path)
+ lib_path.extend([a.replace("/lib/", "/" + libdir + "/") for a in default_lib_path])
+
+ if libc_extras_dir_default:
+@@ -661,16 +669,16 @@ ld_path_name = os.path.dirname(ldlib)
+ ld_full_path = "../" + ldlib
+ ld_file = find_lib(ld_file_name)
+
+-if ld_path_name != "/lib":
+- if os.access(dest_path + "/" + ld_file_name, os.F_OK):
+- os.remove(dest_path + "/" + ld_file_name)
++#if ld_path_name != "/lib":
++# if os.access(dest_path + "/" + ld_file_name, os.F_OK):
++# os.remove(dest_path + "/" + ld_file_name)
+
+-if not os.path.exists(dest_path + "/../" + ld_path_name):
+- os.mkdir(dest_path + "/../" + ld_path_name)
++#if not os.path.exists(dest_path + "/../" + ld_path_name):
++# os.mkdir(dest_path + "/../" + ld_path_name)
+
+-if not os.access(dest_path + "/" + ld_full_path, os.F_OK):
+- debug(DEBUG_NORMAL, "I: stripping and copying dynamic linker to " + ld_full_path)
++if not os.access(dest_path + "/" + ld_file_name, os.F_OK):
++ debug(DEBUG_NORMAL, "I: stripping and copying dynamic linker to " + ld_file_name)
+ command(target + "objcopy", "--strip-unneeded -R .note -R .comment",
+- ld_file, dest_path + "/" + ld_full_path)
++ ld_file, dest_path + "/" + ld_file_name)
+
+-os.chmod(dest_path + "/" + ld_full_path, 0755)
++os.chmod(dest_path + "/" + ld_file_name, 0755)
OpenPOWER on IntegriCloud