[oe-commits] [openembedded-core] 03/12: go-1.8: add patch for set soname in ELF shared objects

git at git.openembedded.org git at git.openembedded.org
Wed Sep 13 21:21:12 UTC 2017


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 24c2ac446296663b86160cac046e7faccb19f5af
Author: Matt Madison <matt at madison.systems>
AuthorDate: Wed Sep 13 14:54:04 2017 -0300

    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.
    
    Signed-off-by: Matt Madison <matt at madison.systems>
    Signed-off-by: Otavio Salvador <otavio at ossystems.com.br>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/recipes-devtools/go/go-1.8.inc                |  1 +
 ...06-linker-add-soname-to-shareable-objects.patch | 44 ++++++++++++++++++++++
 2 files changed, 45 insertions(+)

diff --git a/meta/recipes-devtools/go/go-1.8.inc b/meta/recipes-devtools/go/go-1.8.inc
index 141c099..8c4b71e 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 += "\
        file://gotooldir.patch \
        file://make-goroot-precious.patch \
        file://set-gotooldir-during-bootstrap.patch \
+       file://0006-linker-add-soname-to-shareable-objects.patch \
 "
 SRC_URI[main.md5sum] = "64e9380e07bba907e26a00cf5fcbe77e"
 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 0000000..74e1f24
--- /dev/null
+++ b/meta/recipes-devtools/go/go-1.8/0006-linker-add-soname-to-shareable-objects.patch
@@ -0,0 +1,44 @@
+From 81e9e322297d83f57f02548689c71859bfce10ee Mon Sep 17 00:00:00 2001
+From: Matt Madison <matt at madison.systems>
+Date: Sun, 15 Jan 2017 05:24:49 -0800
+Subject: [PATCH 6/6] linker: add soname to shareable objects
+
+Shared library handling in OE builds works better when shared
+libraries are tagged with SONAMEs.
+
+Upstream-Status: Pending
+Signed-off-by: Matt Madison <matt at madison.systems>
+---
+ 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 74d79d3..6d03005 100644
+--- a/src/cmd/link/internal/ld/lib.go
++++ b/src/cmd/link/internal/ld/lib.go
+@@ -1040,12 +1040,14 @@ func (l *Link) hostlink() {
+ 			// Pass -z nodelete to mark the shared library as
+ 			// non-closeable: a dlclose will do nothing.
+ 			argv = append(argv, "-shared", "-Wl,-z,nodelete")
++			argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile)))
+ 		}
+ 	case BuildmodeShared:
+ 		if UseRelro() {
+ 			argv = append(argv, "-Wl,-z,relro")
+ 		}
+ 		argv = append(argv, "-shared")
++		argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile)))
+ 	case BuildmodePlugin:
+ 		if Headtype == obj.Hdarwin {
+ 			argv = append(argv, "-dynamiclib")
+@@ -1054,6 +1056,7 @@ func (l *Link) hostlink() {
+ 				argv = append(argv, "-Wl,-z,relro")
+ 			}
+ 			argv = append(argv, "-shared")
++			argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile)))
+ 		}
+ 	}
+ 
+-- 
+2.7.4
+

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list