blob: c23ca94290ecb202483fe1e47d44c8cc38e9b3bb [file] [log] [blame]
Brad Bishop316dfdd2018-06-25 12:45:53 -04001From 85252f0bd8743223eb778edbe9fb31dff17a23d8 Mon Sep 17 00:00:00 2001
2From: Matt Madison <matt@madison.systems>
3Date: Sat, 17 Feb 2018 06:26:10 -0800
4Subject: [PATCH 4/9] ld: add soname to shareable objects
5
6so that OE's shared library dependency handling
7can find them.
8
9Upstream-Status: Inappropriate [OE specific]
10
11Signed-off-by: Matt Madison <matt@madison.systems>
12---
13 src/cmd/link/internal/ld/lib.go | 4 ++++
14 1 file changed, 4 insertions(+)
15
16diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go
17index 6dcaf64122..11cbb8a8bb 100644
18--- a/src/cmd/link/internal/ld/lib.go
19+++ b/src/cmd/link/internal/ld/lib.go
20@@ -1134,6 +1134,7 @@ func (ctxt *Link) hostlink() {
21 argv = append(argv, "-Wl,-z,relro")
22 }
23 argv = append(argv, "-shared")
24+ argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile)))
25 if ctxt.HeadType != objabi.Hwindows {
26 // Pass -z nodelete to mark the shared library as
27 // non-closeable: a dlclose will do nothing.
28@@ -1145,6 +1146,8 @@ func (ctxt *Link) hostlink() {
29 argv = append(argv, "-Wl,-z,relro")
30 }
31 argv = append(argv, "-shared")
32+ argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile)))
33+
34 case BuildModePlugin:
35 if ctxt.HeadType == objabi.Hdarwin {
36 argv = append(argv, "-dynamiclib")
37@@ -1153,6 +1156,7 @@ func (ctxt *Link) hostlink() {
38 argv = append(argv, "-Wl,-z,relro")
39 }
40 argv = append(argv, "-shared")
41+ argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile)))
42 }
43 }
44
45--
462.14.1
47