blob: 40763ad5b1d698f85dbc0fea7b513285f09e78ec [file] [log] [blame]
Brad Bishop1d80a2e2019-11-15 16:35:03 -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
20diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go
21index 3fa258d..f96fb02 100644
22--- a/src/cmd/link/internal/ld/lib.go
23+++ b/src/cmd/link/internal/ld/lib.go
24@@ -1215,6 +1215,7 @@ func (ctxt *Link) hostlink() {
25 argv = append(argv, "-Wl,-z,relro")
26 }
27 argv = append(argv, "-shared")
28+ argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile)))
29 if ctxt.HeadType != objabi.Hwindows {
30 // Pass -z nodelete to mark the shared library as
31 // non-closeable: a dlclose will do nothing.
32@@ -1226,6 +1227,7 @@ func (ctxt *Link) hostlink() {
33 argv = append(argv, "-Wl,-z,relro")
34 }
35 argv = append(argv, "-shared")
36+ argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile)))
37 case BuildModePlugin:
38 if ctxt.HeadType == objabi.Hdarwin {
39 argv = append(argv, "-dynamiclib")
40@@ -1234,6 +1236,7 @@ func (ctxt *Link) hostlink() {
41 argv = append(argv, "-Wl,-z,relro")
42 }
43 argv = append(argv, "-shared")
44+ argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile)))
45 }
46 }
47
48--
492.17.1 (Apple Git-112)
50