On 2/28/25 7:52 AM, Jose Quaresma via lists.openembedded.org wrote:
The dynamic linked standard library 
/usr/lib/go/pkg/linux_amd64_dynlink/libstd.so
contains reference to TMPDIR that I couldn't fix and this breakes the 
go-runtime.

The static linking is the default and most used linking in the golang ecosystem.
Even in more restricted environments such as embedded ones the space occupied by
the libstd.so and the golang aplications installed on target is considerably 
high
when few golang applications are used, being in the end higher than what it 
would
be with static linking.

When we use static linking we can only use the parts of libstd.so that we realy
need and thus we do not need to have unused features in the runtime system 
library.
This way it ends up not even being necessary to install the libstd.so on the 
target,
which reduces the total space when there are few applications as already 
mentioned.

I think it becomes more useful if there are lot of go apps on target, which might not be as common case so perhaps this switch is ok but we need to document it very clearly as defaults have changed users expectations should be aligned as well.



Signed-off-by: Jose Quaresma <jose.quare...@foundries.io>
---
  meta/classes-recipe/goarch.bbclass | 12 ++++++------
  1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/meta/classes-recipe/goarch.bbclass 
b/meta/classes-recipe/goarch.bbclass
index 1ebe03864f..dfe1c64b3b 100644
--- a/meta/classes-recipe/goarch.bbclass
+++ b/meta/classes-recipe/goarch.bbclass
@@ -38,12 +38,12 @@ BASE_GOARM:armv5 = '5'
  # Go supports dynamic linking on a limited set of architectures.
  # See the supportsDynlink function in go/src/cmd/compile/internal/gc/main.go
  GO_DYNLINK = ""
-GO_DYNLINK:arm ?= "1"
-GO_DYNLINK:aarch64 ?= "1"
-GO_DYNLINK:x86 ?= "1"
-GO_DYNLINK:x86-64 ?= "1"
-GO_DYNLINK:powerpc64 ?= "1"
-GO_DYNLINK:powerpc64le ?= "1"
+GO_DYNLINK:arm ?= ""
+GO_DYNLINK:aarch64 ?= ""
+GO_DYNLINK:x86 ?= ""
+GO_DYNLINK:x86-64 ?= ""
+GO_DYNLINK:powerpc64 ?= ""
+GO_DYNLINK:powerpc64le ?= ""
  GO_DYNLINK:class-native ?= ""
  GO_DYNLINK:class-nativesdk = ""


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#212085): 
https://lists.openembedded.org/g/openembedded-core/message/212085
Mute This Topic: https://lists.openembedded.org/mt/111436384/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to