Brad Bishop | 1d80a2e | 2019-11-15 16:35:03 -0500 | [diff] [blame] | 1 | From bf5cf5301ae5914498454c87293d1df2e1d8489f Mon Sep 17 00:00:00 2001 |
| 2 | From: Alex Kube <alexander.j.kube@gmail.com> |
| 3 | Date: Wed, 23 Oct 2019 21:16:32 +0430 |
| 4 | Subject: [PATCH 4/9] ld: add soname to shareable objects |
| 5 | |
| 6 | so that OE's shared library dependency handling |
| 7 | can find them. |
| 8 | |
| 9 | Adapted to Go 1.13 from patches originally submitted to |
| 10 | the meta/recipes-devtools/go tree by |
| 11 | Matt Madison <matt@madison.systems>. |
| 12 | |
| 13 | Upstream-Status: Inappropriate [OE specific] |
| 14 | |
| 15 | Signed-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 | diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go |
| 21 | index 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 | -- |
| 49 | 2.17.1 (Apple Git-112) |
| 50 | |