summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/go/go-1.10/0004-ld-add-soname-to-shareable-objects.patch
blob: c23ca94290ecb202483fe1e47d44c8cc38e9b3bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
From 85252f0bd8743223eb778edbe9fb31dff17a23d8 Mon Sep 17 00:00:00 2001
From: Matt Madison <matt@madison.systems>
Date: Sat, 17 Feb 2018 06:26:10 -0800
Subject: [PATCH 4/9] ld: add soname to shareable objects

so that OE's shared library dependency handling
can find them.

Upstream-Status: Inappropriate [OE specific]

Signed-off-by: Matt Madison <matt@madison.systems>
---
 src/cmd/link/internal/ld/lib.go | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go
index 6dcaf64122..11cbb8a8bb 100644
--- a/src/cmd/link/internal/ld/lib.go
+++ b/src/cmd/link/internal/ld/lib.go
@@ -1134,6 +1134,7 @@ func (ctxt *Link) hostlink() {
 				argv = append(argv, "-Wl,-z,relro")
 			}
 			argv = append(argv, "-shared")
+			argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile)))
 			if ctxt.HeadType != objabi.Hwindows {
 				// Pass -z nodelete to mark the shared library as
 				// non-closeable: a dlclose will do nothing.
@@ -1145,6 +1146,8 @@ func (ctxt *Link) hostlink() {
 			argv = append(argv, "-Wl,-z,relro")
 		}
 		argv = append(argv, "-shared")
+		argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile)))
+
 	case BuildModePlugin:
 		if ctxt.HeadType == objabi.Hdarwin {
 			argv = append(argv, "-dynamiclib")
@@ -1153,6 +1156,7 @@ func (ctxt *Link) hostlink() {
 				argv = append(argv, "-Wl,-z,relro")
 			}
 			argv = append(argv, "-shared")
+			argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile)))
 		}
 	}
 
-- 
2.14.1