summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/go
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2017-11-17 13:58:18 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-11-21 13:06:13 +0000
commit92e9b56bbc9b36a9973b681dec17536a9d001e44 (patch)
tree59a6471ab264f47f6ea5e445db2ce1c99cabe404 /meta/recipes-devtools/go
parent3213bda073ea858cbc4e09b2ee9bb6662140837a (diff)
downloadpoky-92e9b56bbc9b36a9973b681dec17536a9d001e44.tar.gz
go: Use right dynamic linker on musl
(From OE-Core rev: 0d6e83757fc26d3e88bfe3c2437b5c7c9be09118) Signed-off-by: Khem Raj <raj.khem@gmail.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/go')
-rw-r--r--meta/recipes-devtools/go/go-1.9.inc2
-rw-r--r--meta/recipes-devtools/go/go-1.9/set-external-linker.patch111
2 files changed, 113 insertions, 0 deletions
diff --git a/meta/recipes-devtools/go/go-1.9.inc b/meta/recipes-devtools/go/go-1.9.inc
index 65adaa8d72..60292651df 100644
--- a/meta/recipes-devtools/go/go-1.9.inc
+++ b/meta/recipes-devtools/go/go-1.9.inc
@@ -16,5 +16,7 @@ SRC_URI += "\
16 file://0008-make.bash-add-GOHOSTxx-indirection-for-cross-canadia.patch \ 16 file://0008-make.bash-add-GOHOSTxx-indirection-for-cross-canadia.patch \
17 file://0009-cmd-go-buildmode-pie-forces-external-linking-mode-on.patch \ 17 file://0009-cmd-go-buildmode-pie-forces-external-linking-mode-on.patch \
18" 18"
19SRC_URI_append_libc-musl = " file://set-external-linker.patch"
20
19SRC_URI[main.md5sum] = "da2d44ea384076efec43ee1f8b7d45d2" 21SRC_URI[main.md5sum] = "da2d44ea384076efec43ee1f8b7d45d2"
20SRC_URI[main.sha256sum] = "a4ab229028ed167ba1986825751463605264e44868362ca8e7accc8be057e993" 22SRC_URI[main.sha256sum] = "a4ab229028ed167ba1986825751463605264e44868362ca8e7accc8be057e993"
diff --git a/meta/recipes-devtools/go/go-1.9/set-external-linker.patch b/meta/recipes-devtools/go/go-1.9/set-external-linker.patch
new file mode 100644
index 0000000000..d6bd7fa39c
--- /dev/null
+++ b/meta/recipes-devtools/go/go-1.9/set-external-linker.patch
@@ -0,0 +1,111 @@
1Change the dynamic linker hardcoding to use musl when not using glibc
2this should be applied conditional to musl being the system C library
3
4Upstream-Status: Inappropriate [Real Fix should be portable across libcs]
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7
8Index: go/src/cmd/link/internal/amd64/obj.go
9===================================================================
10--- go.orig/src/cmd/link/internal/amd64/obj.go
11+++ go/src/cmd/link/internal/amd64/obj.go
12@@ -67,7 +67,7 @@ func Init() {
13 ld.Thearch.Append64 = ld.Append64l
14 ld.Thearch.TLSIEtoLE = tlsIEtoLE
15
16- ld.Thearch.Linuxdynld = "/lib64/ld-linux-x86-64.so.2"
17+ ld.Thearch.Linuxdynld = "/lib/ld-musl-x86_64.so.1"
18 ld.Thearch.Freebsddynld = "/libexec/ld-elf.so.1"
19 ld.Thearch.Openbsddynld = "/usr/libexec/ld.so"
20 ld.Thearch.Netbsddynld = "/libexec/ld.elf_so"
21Index: go/src/cmd/link/internal/arm/obj.go
22===================================================================
23--- go.orig/src/cmd/link/internal/arm/obj.go
24+++ go/src/cmd/link/internal/arm/obj.go
25@@ -63,7 +63,7 @@ func Init() {
26 ld.Thearch.Append32 = ld.Append32l
27 ld.Thearch.Append64 = ld.Append64l
28
29- ld.Thearch.Linuxdynld = "/lib/ld-linux.so.3" // 2 for OABI, 3 for EABI
30+ ld.Thearch.Linuxdynld = "/lib/ld-musl-armhf.so.1"
31 ld.Thearch.Freebsddynld = "/usr/libexec/ld-elf.so.1"
32 ld.Thearch.Openbsddynld = "/usr/libexec/ld.so"
33 ld.Thearch.Netbsddynld = "/libexec/ld.elf_so"
34Index: go/src/cmd/link/internal/arm64/obj.go
35===================================================================
36--- go.orig/src/cmd/link/internal/arm64/obj.go
37+++ go/src/cmd/link/internal/arm64/obj.go
38@@ -62,7 +62,7 @@ func Init() {
39 ld.Thearch.Append32 = ld.Append32l
40 ld.Thearch.Append64 = ld.Append64l
41
42- ld.Thearch.Linuxdynld = "/lib/ld-linux-aarch64.so.1"
43+ ld.Thearch.Linuxdynld = "/lib/ld-musl-aarch64.so.1"
44
45 ld.Thearch.Freebsddynld = "XXX"
46 ld.Thearch.Openbsddynld = "XXX"
47Index: go/src/cmd/link/internal/mips/obj.go
48===================================================================
49--- go.orig/src/cmd/link/internal/mips/obj.go
50+++ go/src/cmd/link/internal/mips/obj.go
51@@ -77,7 +77,7 @@ func Init() {
52 ld.Thearch.Append64 = ld.Append64b
53 }
54
55- ld.Thearch.Linuxdynld = "/lib/ld.so.1"
56+ ld.Thearch.Linuxdynld = "/lib/ld-musl-mipsle.so.1"
57
58 ld.Thearch.Freebsddynld = "XXX"
59 ld.Thearch.Openbsddynld = "XXX"
60Index: go/src/cmd/link/internal/mips64/obj.go
61===================================================================
62--- go.orig/src/cmd/link/internal/mips64/obj.go
63+++ go/src/cmd/link/internal/mips64/obj.go
64@@ -75,7 +75,7 @@ func Init() {
65 ld.Thearch.Append64 = ld.Append64b
66 }
67
68- ld.Thearch.Linuxdynld = "/lib64/ld64.so.1"
69+ ld.Thearch.Linuxdynld = "/lib64/ld-musl-mips64le.so.1"
70
71 ld.Thearch.Freebsddynld = "XXX"
72 ld.Thearch.Openbsddynld = "XXX"
73Index: go/src/cmd/link/internal/ppc64/obj.go
74===================================================================
75--- go.orig/src/cmd/link/internal/ppc64/obj.go
76+++ go/src/cmd/link/internal/ppc64/obj.go
77@@ -77,7 +77,7 @@ func Init() {
78 }
79
80 // TODO(austin): ABI v1 uses /usr/lib/ld.so.1
81- ld.Thearch.Linuxdynld = "/lib64/ld64.so.1"
82+ ld.Thearch.Linuxdynld = "/lib/ld-musl-powerpc64le.so.1"
83
84 ld.Thearch.Freebsddynld = "XXX"
85 ld.Thearch.Openbsddynld = "XXX"
86Index: go/src/cmd/link/internal/s390x/obj.go
87===================================================================
88--- go.orig/src/cmd/link/internal/s390x/obj.go
89+++ go/src/cmd/link/internal/s390x/obj.go
90@@ -62,7 +62,7 @@ func Init() {
91 ld.Thearch.Append32 = ld.Append32b
92 ld.Thearch.Append64 = ld.Append64b
93
94- ld.Thearch.Linuxdynld = "/lib64/ld64.so.1"
95+ ld.Thearch.Linuxdynld = "/lib/ld-musl-s390x.so.1"
96
97 // not relevant for s390x
98 ld.Thearch.Freebsddynld = "XXX"
99Index: go/src/cmd/link/internal/x86/obj.go
100===================================================================
101--- go.orig/src/cmd/link/internal/x86/obj.go
102+++ go/src/cmd/link/internal/x86/obj.go
103@@ -63,7 +63,7 @@ func Init() {
104 ld.Thearch.Append32 = ld.Append32l
105 ld.Thearch.Append64 = ld.Append64l
106
107- ld.Thearch.Linuxdynld = "/lib/ld-linux.so.2"
108+ ld.Thearch.Linuxdynld = "/lib/ld-musl-i386.so.1"
109 ld.Thearch.Freebsddynld = "/usr/libexec/ld-elf.so.1"
110 ld.Thearch.Openbsddynld = "/usr/libexec/ld.so"
111 ld.Thearch.Netbsddynld = "/usr/libexec/ld.elf_so"