summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/musl/musl/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/musl/musl/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch')
-rw-r--r--meta/recipes-core/musl/musl/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch76
1 files changed, 76 insertions, 0 deletions
diff --git a/meta/recipes-core/musl/musl/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch b/meta/recipes-core/musl/musl/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch
new file mode 100644
index 0000000000..462d338b96
--- /dev/null
+++ b/meta/recipes-core/musl/musl/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch
@@ -0,0 +1,76 @@
1From 0ec74744a4cba7c5fdfaa2685995119a4fca0260 Mon Sep 17 00:00:00 2001
2From: Amarnath Valluri <amarnath.valluri@intel.com>
3Date: Wed, 18 Jan 2017 16:14:37 +0200
4Subject: [PATCH] Make dynamic linker a relative symlink to libc
5
6absolute symlink into $(libdir) fails to load in a cross build
7environment, especially when executing qemu in usermode to run target
8applications, which cross build systems often do, since not everything
9can be computed during cross builds, qemu in usermode often comes to aid
10in such situations to feed into cross builds.
11
12V2:
13 Make use of 'ln -r' to create relative symlinks, as most fo the distros
14 shipping coreutils 8.16+
15
16Signed-off-by: Khem Raj <raj.khem@gmail.com>
17Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
18---
19Upstream-Status: Pending
20---
21 Makefile | 2 +-
22 tools/install.sh | 8 +++++---
23 2 files changed, 6 insertions(+), 4 deletions(-)
24
25diff --git a/Makefile b/Makefile
26index 8246b78..d1dbe39 100644
27--- a/Makefile
28+++ b/Makefile
29@@ -215,7 +215,7 @@ $(DESTDIR)$(includedir)/%: $(srcdir)/include/%
30 $(INSTALL) -D -m 644 $< $@
31
32 $(DESTDIR)$(LDSO_PATHNAME): $(DESTDIR)$(libdir)/libc.so
33- $(INSTALL) -D -l $(libdir)/libc.so $@ || true
34+ $(INSTALL) -D -r $(DESTDIR)$(libdir)/libc.so $@ || true
35
36 install-libs: $(ALL_LIBS:lib/%=$(DESTDIR)$(libdir)/%) $(if $(SHARED_LIBS),$(DESTDIR)$(LDSO_PATHNAME),)
37
38diff --git a/tools/install.sh b/tools/install.sh
39index d913b60..b6a7f79 100755
40--- a/tools/install.sh
41+++ b/tools/install.sh
42@@ -6,18 +6,20 @@
43 #
44
45 usage() {
46-printf "usage: %s [-D] [-l] [-m mode] src dest\n" "$0" 1>&2
47+printf "usage: %s [-D] [-l] [-r] [-m mode] src dest\n" "$0" 1>&2
48 exit 1
49 }
50
51 mkdirp=
52 symlink=
53+symlinkflags="-s"
54 mode=755
55
56-while getopts Dlm: name ; do
57+while getopts Dlrm: name ; do
58 case "$name" in
59 D) mkdirp=yes ;;
60 l) symlink=yes ;;
61+r) symlink=yes; symlinkflags="$symlinkflags -r" ;;
62 m) mode=$OPTARG ;;
63 ?) usage ;;
64 esac
65@@ -48,7 +50,7 @@ trap 'rm -f "$tmp"' EXIT INT QUIT TERM HUP
66 umask 077
67
68 if test "$symlink" ; then
69-ln -s "$1" "$tmp"
70+ln $symlinkflags "$1" "$tmp"
71 else
72 cat < "$1" > "$tmp"
73 chmod "$mode" "$tmp"
74--
752.7.4
76