diff options
author | Matt Madison <matt@madison.systems> | 2017-09-13 14:54:04 -0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-09-14 11:35:45 +0100 |
commit | 996836ae4bfb11caa0e0baa35013c7fb7b01c5f0 (patch) | |
tree | fc05947b36a011dff0c9844aef4439e2e544c5ce | |
parent | e3c693eaeaa4d417fefa1cf1f0e4d7ebe780d9d8 (diff) | |
download | poky-996836ae4bfb11caa0e0baa35013c7fb7b01c5f0.tar.gz |
go-1.8: add patch for set soname in ELF shared objects
The go link tool does not set the soname by default, which
prevents package.bbclass's shlibs processing from seeing
shared libraries built with go.
This patch passes appropriate options to go's linker and
the external linker to set the soname.
(From OE-Core rev: 24c2ac446296663b86160cac046e7faccb19f5af)
Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/recipes-devtools/go/go-1.8.inc | 1 | ||||
-rw-r--r-- | meta/recipes-devtools/go/go-1.8/0006-linker-add-soname-to-shareable-objects.patch | 44 |
2 files changed, 45 insertions, 0 deletions
diff --git a/meta/recipes-devtools/go/go-1.8.inc b/meta/recipes-devtools/go/go-1.8.inc index 141c0994c3..8c4b71e428 100644 --- a/meta/recipes-devtools/go/go-1.8.inc +++ b/meta/recipes-devtools/go/go-1.8.inc | |||
@@ -16,6 +16,7 @@ SRC_URI += "\ | |||
16 | file://gotooldir.patch \ | 16 | file://gotooldir.patch \ |
17 | file://make-goroot-precious.patch \ | 17 | file://make-goroot-precious.patch \ |
18 | file://set-gotooldir-during-bootstrap.patch \ | 18 | file://set-gotooldir-during-bootstrap.patch \ |
19 | file://0006-linker-add-soname-to-shareable-objects.patch \ | ||
19 | " | 20 | " |
20 | SRC_URI[main.md5sum] = "64e9380e07bba907e26a00cf5fcbe77e" | 21 | SRC_URI[main.md5sum] = "64e9380e07bba907e26a00cf5fcbe77e" |
21 | SRC_URI[main.sha256sum] = "5f5dea2447e7dcfdc50fa6b94c512e58bfba5673c039259fd843f68829d99fa6" | 22 | SRC_URI[main.sha256sum] = "5f5dea2447e7dcfdc50fa6b94c512e58bfba5673c039259fd843f68829d99fa6" |
diff --git a/meta/recipes-devtools/go/go-1.8/0006-linker-add-soname-to-shareable-objects.patch b/meta/recipes-devtools/go/go-1.8/0006-linker-add-soname-to-shareable-objects.patch new file mode 100644 index 0000000000..74e1f2459e --- /dev/null +++ b/meta/recipes-devtools/go/go-1.8/0006-linker-add-soname-to-shareable-objects.patch | |||
@@ -0,0 +1,44 @@ | |||
1 | From 81e9e322297d83f57f02548689c71859bfce10ee Mon Sep 17 00:00:00 2001 | ||
2 | From: Matt Madison <matt@madison.systems> | ||
3 | Date: Sun, 15 Jan 2017 05:24:49 -0800 | ||
4 | Subject: [PATCH 6/6] linker: add soname to shareable objects | ||
5 | |||
6 | Shared library handling in OE builds works better when shared | ||
7 | libraries are tagged with SONAMEs. | ||
8 | |||
9 | Upstream-Status: Pending | ||
10 | Signed-off-by: Matt Madison <matt@madison.systems> | ||
11 | --- | ||
12 | src/cmd/link/internal/ld/lib.go | 3 +++ | ||
13 | 1 file changed, 3 insertions(+) | ||
14 | |||
15 | diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go | ||
16 | index 74d79d3..6d03005 100644 | ||
17 | --- a/src/cmd/link/internal/ld/lib.go | ||
18 | +++ b/src/cmd/link/internal/ld/lib.go | ||
19 | @@ -1040,12 +1040,14 @@ func (l *Link) hostlink() { | ||
20 | // Pass -z nodelete to mark the shared library as | ||
21 | // non-closeable: a dlclose will do nothing. | ||
22 | argv = append(argv, "-shared", "-Wl,-z,nodelete") | ||
23 | + argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile))) | ||
24 | } | ||
25 | case BuildmodeShared: | ||
26 | if UseRelro() { | ||
27 | argv = append(argv, "-Wl,-z,relro") | ||
28 | } | ||
29 | argv = append(argv, "-shared") | ||
30 | + argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile))) | ||
31 | case BuildmodePlugin: | ||
32 | if Headtype == obj.Hdarwin { | ||
33 | argv = append(argv, "-dynamiclib") | ||
34 | @@ -1054,6 +1056,7 @@ func (l *Link) hostlink() { | ||
35 | argv = append(argv, "-Wl,-z,relro") | ||
36 | } | ||
37 | argv = append(argv, "-shared") | ||
38 | + argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile))) | ||
39 | } | ||
40 | } | ||
41 | |||
42 | -- | ||
43 | 2.7.4 | ||
44 | |||