blob: da29923920163daf6570b44b1cdf730e2f862a5d [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 Geisslerc9f78652020-09-18 14:11:35 -050022@@ -1446,6 +1446,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)))
27 if ctxt.HeadType != objabi.Hwindows {
28 // Pass -z nodelete to mark the shared library as
29 // non-closeable: a dlclose will do nothing.
Andrew Geisslerc9f78652020-09-18 14:11:35 -050030@@ -1457,6 +1458,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 Geisslerc9f78652020-09-18 14:11:35 -050038@@ -1465,6 +1467,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