diff options
-rw-r--r-- | meta/recipes-core/musl/files/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch | 62 | ||||
-rw-r--r-- | meta/recipes-core/musl/musl_git.bb | 2 |
2 files changed, 53 insertions, 11 deletions
diff --git a/meta/recipes-core/musl/files/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch b/meta/recipes-core/musl/files/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch index 5490b1cba6..462d338b96 100644 --- a/meta/recipes-core/musl/files/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch +++ b/meta/recipes-core/musl/files/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch | |||
@@ -1,6 +1,6 @@ | |||
1 | From 94c0b97b62125d8bbc92dce0694e387d5b2ad181 Mon Sep 17 00:00:00 2001 | 1 | From 0ec74744a4cba7c5fdfaa2685995119a4fca0260 Mon Sep 17 00:00:00 2001 |
2 | From: Khem Raj <raj.khem@gmail.com> | 2 | From: Amarnath Valluri <amarnath.valluri@intel.com> |
3 | Date: Sun, 10 Jan 2016 12:14:02 -0800 | 3 | Date: Wed, 18 Jan 2017 16:14:37 +0200 |
4 | Subject: [PATCH] Make dynamic linker a relative symlink to libc | 4 | Subject: [PATCH] Make dynamic linker a relative symlink to libc |
5 | 5 | ||
6 | absolute symlink into $(libdir) fails to load in a cross build | 6 | absolute symlink into $(libdir) fails to load in a cross build |
@@ -9,26 +9,68 @@ applications, which cross build systems often do, since not everything | |||
9 | can be computed during cross builds, qemu in usermode often comes to aid | 9 | can be computed during cross builds, qemu in usermode often comes to aid |
10 | in such situations to feed into cross builds. | 10 | in such situations to feed into cross builds. |
11 | 11 | ||
12 | V2: | ||
13 | Make use of 'ln -r' to create relative symlinks, as most fo the distros | ||
14 | shipping coreutils 8.16+ | ||
15 | |||
12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | 16 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
17 | Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com> | ||
13 | --- | 18 | --- |
14 | Upstream-Status: Pending | 19 | Upstream-Status: Pending |
15 | 20 | --- | |
16 | Makefile | 2 +- | 21 | Makefile | 2 +- |
17 | 1 file changed, 1 insertion(+), 1 deletion(-) | 22 | tools/install.sh | 8 +++++--- |
23 | 2 files changed, 6 insertions(+), 4 deletions(-) | ||
18 | 24 | ||
19 | diff --git a/Makefile b/Makefile | 25 | diff --git a/Makefile b/Makefile |
20 | index b2226fa..0d71f7f 100644 | 26 | index 8246b78..d1dbe39 100644 |
21 | --- a/Makefile | 27 | --- a/Makefile |
22 | +++ b/Makefile | 28 | +++ b/Makefile |
23 | @@ -189,7 +189,7 @@ $(DESTDIR)$(includedir)/%: include/% | 29 | @@ -215,7 +215,7 @@ $(DESTDIR)$(includedir)/%: $(srcdir)/include/% |
24 | $(INSTALL) -D -m 644 $< $@ | 30 | $(INSTALL) -D -m 644 $< $@ |
25 | 31 | ||
26 | $(DESTDIR)$(LDSO_PATHNAME): $(DESTDIR)$(libdir)/libc.so | 32 | $(DESTDIR)$(LDSO_PATHNAME): $(DESTDIR)$(libdir)/libc.so |
27 | - $(INSTALL) -D -l $(libdir)/libc.so $@ || true | 33 | - $(INSTALL) -D -l $(libdir)/libc.so $@ || true |
28 | + $(INSTALL) -D -l ..$(libdir)/libc.so $@ || true | 34 | + $(INSTALL) -D -r $(DESTDIR)$(libdir)/libc.so $@ || true |
29 | 35 | ||
30 | install-libs: $(ALL_LIBS:lib/%=$(DESTDIR)$(libdir)/%) $(if $(SHARED_LIBS),$(DESTDIR)$(LDSO_PATHNAME),) | 36 | install-libs: $(ALL_LIBS:lib/%=$(DESTDIR)$(libdir)/%) $(if $(SHARED_LIBS),$(DESTDIR)$(LDSO_PATHNAME),) |
31 | 37 | ||
38 | diff --git a/tools/install.sh b/tools/install.sh | ||
39 | index 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" | ||
32 | -- | 74 | -- |
33 | 2.7.0 | 75 | 2.7.4 |
34 | 76 | ||
diff --git a/meta/recipes-core/musl/musl_git.bb b/meta/recipes-core/musl/musl_git.bb index fa87d7d3e3..39745f5bfb 100644 --- a/meta/recipes-core/musl/musl_git.bb +++ b/meta/recipes-core/musl/musl_git.bb | |||
@@ -49,7 +49,7 @@ do_install() { | |||
49 | oe_runmake install DESTDIR='${D}' | 49 | oe_runmake install DESTDIR='${D}' |
50 | 50 | ||
51 | install -d ${D}${bindir} | 51 | install -d ${D}${bindir} |
52 | ln -s ../../${libdir}/libc.so ${D}${bindir}/ldd | 52 | lnr ${D}${libdir}/libc.so ${D}${bindir}/ldd |
53 | for l in crypt dl m pthread resolv rt util xnet | 53 | for l in crypt dl m pthread resolv rt util xnet |
54 | do | 54 | do |
55 | ln -s libc.so ${D}${libdir}/lib$l.so | 55 | ln -s libc.so ${D}${libdir}/lib$l.so |