Skip to contentSkip to conversation

consul: don't build with the '-linkshared' option

PATCH In review Mark Asselstine 2 participants 2 messages Apr 3, 2019 – Apr 8, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 consul: don't build with the '-linkshared' option

We are currently seeing the following error:
type..eUfRrckI: missing section for relocation target type..FEeY9FdU
...

This is similar to the reported issues
http://www.lyddzz.com/github_/golang/go/issues/30768
and
https://github.com/hashicorp/consul/issues/5486 (but this one appears to be a report of 'our' issue so isn't really valid)

The go.bbclass currently completes 2 builds (if GO_DYNLINK is set), one without '-linkshared' and one with. The '--linkshared' option is marked as experimental (https://golang.org/cmd/link/ -- "-linkshared Link against installed Go shared libraries (experimental)").

By setting GO_LINKSHARED prior to inheriting go.bbclass we can overwrite the default compile behavior and only perform the build without the '-linkshared' option. This shouldn't change the functionality of consul and we can revert to the default behavior when the issues have been addressed.

---
 recipes-connectivity/consul/consul_git.bb | 5 +++++
 1 file changed, 5 insertions(+)
recipes-connectivity/consul/consul_git.bb +5 -0
index f9fb236..ab78cbd 100644
@@ -13,6 +13,11 @@ S = "${WORKDIR}/git"
 
 RDEPENDS_${PN}-dev_append = " bash"
 
+# Temporarily workaround an issue with GO 1.12.1
+# http://www.lyddzz.com/github_/golang/go/issues/30768
+# Disable experimental use of '-linkshared'.
+GO_LINKSHARED = ""
+
 inherit systemd go
 
 # Besides the hosts specified in goarch, we do not build for mips.
Signature · 1 line
2.7.4
#1 lore raw
Quoted 16 lines · Mark Asselstine

We are currently seeing the following error:
type..eUfRrckI: missing section for relocation target type..FEeY9FdU
...

This is similar to the reported issues
http://www.lyddzz.com/github_/golang/go/issues/30768
and
https://github.com/hashicorp/consul/issues/5486 (but this one appears to be a report of 'our' issue so isn't really valid)

The go.bbclass currently completes 2 builds (if GO_DYNLINK is set), one without '-linkshared' and one with. The '--linkshared' option is marked as experimental (https://golang.org/cmd/link/ -- "-linkshared Link against installed Go shared libraries (experimental)").

Quoted 5 lines

By setting GO_LINKSHARED prior to inheriting go.bbclass we can overwrite the default compile behavior and only perform the build without the '-linkshared' option. This shouldn't change the functionality of consul and we can revert to the default behavior when the issues have been addressed.

Agreed, and this works for me as well.

Merged.

Bruce

Quoted 25 lines
---
 recipes-connectivity/consul/consul_git.bb | 5 +++++
 1 file changed, 5 insertions(+)
recipes-connectivity/consul/consul_git.bb +5 -1
index f9fb236..ab78cbd 100644
@@ -13,6 +13,11 @@ S = "${WORKDIR}/git"
 
 RDEPENDS_${PN}-dev_append = " bash"
 
+# Temporarily workaround an issue with GO 1.12.1
+# http://www.lyddzz.com/github_/golang/go/issues/30768
+# Disable experimental use of '-linkshared'.
+GO_LINKSHARED = ""
+
 inherit systemd go
 
 # Besides the hosts specified in goarch, we do not build for mips.
--

2.7.4

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II