summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/go/go/0003-ld-add-soname-to-shareable-objects.patch
blob: 9cab2969c8ff76b0888a323e2699f5c685a2f4c8 (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
48
49
50
51
From 7dde77b3ce8138314dd2736604b1b110dbcc0ac1 Mon Sep 17 00:00:00 2001
From: Alex Kube <alexander.j.kube@gmail.com>
Date: Wed, 23 Oct 2019 21:16:32 +0430
Subject: [PATCH 3/9] ld: add soname to shareable objects

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

Adapted to Go 1.13 from patches originally submitted to
the meta/recipes-devtools/go tree by
Matt Madison <matt@madison.systems>.

Upstream-Status: Inappropriate [OE specific]

Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
---
 src/cmd/link/internal/ld/lib.go | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go
index eab74dc328..ae9bbc9093 100644
--- a/src/cmd/link/internal/ld/lib.go
+++ b/src/cmd/link/internal/ld/lib.go
@@ -1576,6 +1576,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 {
 				argv = addASLRargs(argv, *flagAslr)
 			} else {
@@ -1591,6 +1592,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)))
 	case BuildModePlugin:
 		if ctxt.HeadType == objabi.Hdarwin {
 			argv = append(argv, "-dynamiclib")
@@ -1599,6 +1601,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.44.0