blob: cd875f1164d7469e74965ecdd794d403bc7a3335 [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001From bf5cf5301ae5914498454c87293d1df2e1d8489f Mon Sep 17 00:00:00 2001
2From: Alex Kube <alexander.j.kube@gmail.com>
3Date: Wed, 23 Oct 2019 21:16:32 +0430
4Subject: [PATCH 4/9] ld: add soname to shareable objects
5
6so that OE's shared library dependency handling
7can find them.
8
9Adapted to Go 1.13 from patches originally submitted to
10the meta/recipes-devtools/go tree by
11Matt Madison <matt@madison.systems>.
12
13Upstream-Status: Inappropriate [OE specific]
14
15Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
16---
17 src/cmd/link/internal/ld/lib.go | 3 +++
18 1 file changed, 3 insertions(+)
19
20--- a/src/cmd/link/internal/ld/lib.go
21+++ b/src/cmd/link/internal/ld/lib.go
Andrew Geissler90fd73c2021-03-05 15:25:55 -060022@@ -1343,6 +1343,7 @@ func (ctxt *Link) hostlink() {
Andrew Geissler82c905d2020-04-13 13:39:40 -050023 argv = append(argv, "-Wl,-z,relro")
24 }
25 argv = append(argv, "-shared")
26+ argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile)))
Andrew Geissler90fd73c2021-03-05 15:25:55 -060027 if ctxt.HeadType == objabi.Hwindows {
28 if *flagAslr {
29 argv = addASLRargs(argv)
30@@ -1358,6 +1359,7 @@ func (ctxt *Link) hostlink() {
Andrew Geissler82c905d2020-04-13 13:39:40 -050031 argv = append(argv, "-Wl,-z,relro")
32 }
33 argv = append(argv, "-shared")
34+ argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile)))
35 case BuildModePlugin:
36 if ctxt.HeadType == objabi.Hdarwin {
37 argv = append(argv, "-dynamiclib")
Andrew Geissler90fd73c2021-03-05 15:25:55 -060038@@ -1366,6 +1368,7 @@ func (ctxt *Link) hostlink() {
Andrew Geissler82c905d2020-04-13 13:39:40 -050039 argv = append(argv, "-Wl,-z,relro")
40 }
41 argv = append(argv, "-shared")
42+ argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile)))
43 }
44 }
45