0004-ld-add-soname-to-shareable-objects.patch 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. so that OE's shared library dependency handling
  6. can find them.
  7. Adapted to Go 1.13 from patches originally submitted to
  8. the meta/recipes-devtools/go tree by
  9. Matt Madison <matt@madison.systems>.
  10. Upstream-Status: Inappropriate [OE specific]
  11. Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
  12. ---
  13. src/cmd/link/internal/ld/lib.go | 3 +++
  14. 1 file changed, 3 insertions(+)
  15. diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go
  16. index 3fa258d..f96fb02 100644
  17. --- a/src/cmd/link/internal/ld/lib.go
  18. +++ b/src/cmd/link/internal/ld/lib.go
  19. @@ -1215,6 +1215,7 @@ func (ctxt *Link) hostlink() {
  20. argv = append(argv, "-Wl,-z,relro")
  21. }
  22. argv = append(argv, "-shared")
  23. + argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile)))
  24. if ctxt.HeadType != objabi.Hwindows {
  25. // Pass -z nodelete to mark the shared library as
  26. // non-closeable: a dlclose will do nothing.
  27. @@ -1226,6 +1227,7 @@ func (ctxt *Link) hostlink() {
  28. argv = append(argv, "-Wl,-z,relro")
  29. }
  30. argv = append(argv, "-shared")
  31. + argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile)))
  32. case BuildModePlugin:
  33. if ctxt.HeadType == objabi.Hdarwin {
  34. argv = append(argv, "-dynamiclib")
  35. @@ -1234,6 +1236,7 @@ func (ctxt *Link) hostlink() {
  36. argv = append(argv, "-Wl,-z,relro")
  37. }
  38. argv = append(argv, "-shared")
  39. + argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile)))
  40. }
  41. }
  42. --
  43. 2.17.1 (Apple Git-112)