blob: 4bb1106f09d0635abcfc47f3b69618017bd017f8 [file] [log] [blame]
Brad Bishop1d80a2e2019-11-15 16:35:03 -05001From 973251ae0c69a35721f6115345d3f57b2847979f Mon Sep 17 00:00:00 2001
2From: Alex Kube <alexander.j.kube@gmail.com>
3Date: Wed, 23 Oct 2019 21:20:13 +0430
4Subject: [PATCH 9/9] ld: replace glibc dynamic linker with musl
5
6Rework of patch by Khem Raj <raj.khem@gmail.com>
7for go 1.10. Should be applied conditionally on
8musl being the system C library.
9
10Adapted to Go 1.13 from patches originally submitted to
11the meta/recipes-devtools/go tree by
12Matt Madison <matt@madison.systems>.
13
14Upstream-Status: Inappropriate [Real fix should be portable across libcs]
15
16Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
17---
18 src/cmd/link/internal/amd64/obj.go | 2 +-
19 src/cmd/link/internal/arm/obj.go | 2 +-
20 src/cmd/link/internal/arm64/obj.go | 2 +-
21 src/cmd/link/internal/mips/obj.go | 2 +-
22 src/cmd/link/internal/mips64/obj.go | 2 +-
23 src/cmd/link/internal/ppc64/obj.go | 2 +-
24 src/cmd/link/internal/s390x/obj.go | 2 +-
25 src/cmd/link/internal/x86/obj.go | 2 +-
26 8 files changed, 8 insertions(+), 8 deletions(-)
27
28diff --git a/src/cmd/link/internal/amd64/obj.go b/src/cmd/link/internal/amd64/obj.go
29index 23741eb..8e74576 100644
30--- a/src/cmd/link/internal/amd64/obj.go
31+++ b/src/cmd/link/internal/amd64/obj.go
32@@ -62,7 +62,7 @@ func Init() (*sys.Arch, ld.Arch) {
33 PEreloc1: pereloc1,
34 TLSIEtoLE: tlsIEtoLE,
35
36- Linuxdynld: "/lib64/ld-linux-x86-64.so.2",
37+ Linuxdynld: "/lib64/ld-musl-x86-64.so.1",
38 Freebsddynld: "/libexec/ld-elf.so.1",
39 Openbsddynld: "/usr/libexec/ld.so",
40 Netbsddynld: "/libexec/ld.elf_so",
41diff --git a/src/cmd/link/internal/arm/obj.go b/src/cmd/link/internal/arm/obj.go
42index 45a406e..724d3e3 100644
43--- a/src/cmd/link/internal/arm/obj.go
44+++ b/src/cmd/link/internal/arm/obj.go
45@@ -59,7 +59,7 @@ func Init() (*sys.Arch, ld.Arch) {
46 Machoreloc1: machoreloc1,
47 PEreloc1: pereloc1,
48
49- Linuxdynld: "/lib/ld-linux.so.3", // 2 for OABI, 3 for EABI
50+ Linuxdynld: "/lib/ld-musl-armhf.so.1",
51 Freebsddynld: "/usr/libexec/ld-elf.so.1",
52 Openbsddynld: "/usr/libexec/ld.so",
53 Netbsddynld: "/libexec/ld.elf_so",
54diff --git a/src/cmd/link/internal/arm64/obj.go b/src/cmd/link/internal/arm64/obj.go
55index 7c66623..d8b1db1 100644
56--- a/src/cmd/link/internal/arm64/obj.go
57+++ b/src/cmd/link/internal/arm64/obj.go
58@@ -57,7 +57,7 @@ func Init() (*sys.Arch, ld.Arch) {
59 Gentext: gentext,
60 Machoreloc1: machoreloc1,
61
62- Linuxdynld: "/lib/ld-linux-aarch64.so.1",
63+ Linuxdynld: "/lib/ld-musl-aarch64.so.1",
64
65 Freebsddynld: "XXX",
66 Openbsddynld: "/usr/libexec/ld.so",
67diff --git a/src/cmd/link/internal/mips/obj.go b/src/cmd/link/internal/mips/obj.go
68index 231e1ff..631dd7a 100644
69--- a/src/cmd/link/internal/mips/obj.go
70+++ b/src/cmd/link/internal/mips/obj.go
71@@ -60,7 +60,7 @@ func Init() (*sys.Arch, ld.Arch) {
72 Gentext: gentext,
73 Machoreloc1: machoreloc1,
74
75- Linuxdynld: "/lib/ld.so.1",
76+ Linuxdynld: "/lib/ld-musl-mipsle.so.1",
77
78 Freebsddynld: "XXX",
79 Openbsddynld: "XXX",
80diff --git a/src/cmd/link/internal/mips64/obj.go b/src/cmd/link/internal/mips64/obj.go
81index 9604208..5ef3ffc 100644
82--- a/src/cmd/link/internal/mips64/obj.go
83+++ b/src/cmd/link/internal/mips64/obj.go
84@@ -59,7 +59,7 @@ func Init() (*sys.Arch, ld.Arch) {
85 Gentext: gentext,
86 Machoreloc1: machoreloc1,
87
88- Linuxdynld: "/lib64/ld64.so.1",
89+ Linuxdynld: "/lib64/ld-musl-mips64le.so.1",
90 Freebsddynld: "XXX",
91 Openbsddynld: "XXX",
92 Netbsddynld: "XXX",
93diff --git a/src/cmd/link/internal/ppc64/obj.go b/src/cmd/link/internal/ppc64/obj.go
94index 51d1791..b15da85 100644
95--- a/src/cmd/link/internal/ppc64/obj.go
96+++ b/src/cmd/link/internal/ppc64/obj.go
97@@ -63,7 +63,7 @@ func Init() (*sys.Arch, ld.Arch) {
98 Xcoffreloc1: xcoffreloc1,
99
100 // TODO(austin): ABI v1 uses /usr/lib/ld.so.1,
101- Linuxdynld: "/lib64/ld64.so.1",
102+ Linuxdynld: "/lib64/ld-musl-powerpc64le.so.1",
103
104 Freebsddynld: "XXX",
105 Openbsddynld: "XXX",
106diff --git a/src/cmd/link/internal/s390x/obj.go b/src/cmd/link/internal/s390x/obj.go
107index 3454476..42cc346 100644
108--- a/src/cmd/link/internal/s390x/obj.go
109+++ b/src/cmd/link/internal/s390x/obj.go
110@@ -57,7 +57,7 @@ func Init() (*sys.Arch, ld.Arch) {
111 Gentext: gentext,
112 Machoreloc1: machoreloc1,
113
114- Linuxdynld: "/lib64/ld64.so.1",
115+ Linuxdynld: "/lib64/ld-musl-s390x.so.1",
116
117 // not relevant for s390x
118 Freebsddynld: "XXX",
119diff --git a/src/cmd/link/internal/x86/obj.go b/src/cmd/link/internal/x86/obj.go
120index f1fad20..d2ca10c 100644
121--- a/src/cmd/link/internal/x86/obj.go
122+++ b/src/cmd/link/internal/x86/obj.go
123@@ -58,7 +58,7 @@ func Init() (*sys.Arch, ld.Arch) {
124 Machoreloc1: machoreloc1,
125 PEreloc1: pereloc1,
126
127- Linuxdynld: "/lib/ld-linux.so.2",
128+ Linuxdynld: "/lib/ld-musl-i386.so.1",
129 Freebsddynld: "/usr/libexec/ld-elf.so.1",
130 Openbsddynld: "/usr/libexec/ld.so",
131 Netbsddynld: "/usr/libexec/ld.elf_so",
132--
1332.17.1 (Apple Git-112)
134