package/go: handle CGO linking for the host
cover package/go: handle CGO linking for the host
From: "Yann E. MORIN" <[email protected]>
Hello All!
This series adds the necessary pieces to expose whether the go compiler has CGO linking support for the host.
The overall issue with the go compiler, is that we have a single one that can build for the target *and* for the host. Any limitation due to the target thus leak to the host. This is notably the case for CGO linking.
This series fixes that by adding a Kconfig symbol that represents whether CGO linking for the host is available. Then, it goes on to fix a few existing packages to add the new dependency.
Host variants of target packages that need CGO linking were found with:
$ git grep -l BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS \
|while read f; do
[ -e "${f}.host" ] && echo "${f}"
doneWhich returns a rather short list:
package/delve/Config.in
package/moby-buildkit/Config.in
package/runc/Config.in
And thus they are all three fixed.
There are only two host-only packages:
$ git grep -l host-golang-package package/*/'**'.mk \
|while read f; do
grep -q -E '\(golang' "${f}" || echo "${f}"
done
package/mender-artifact/mender-artifact.mk
package/skopeo/skopeo.mkSkopeo is fixed in this series, as this is what prompted this work; so it leaves mender-artifact to check. I have no idea how to check whether a package needs CGO linking, though, so this is left as an exercise for any interested party... This is however rather theoretical, as the only hosts that do not support CGO linking (based on the target conditions) would be mips64 or mips64el hosts, and it is very doubtful Buildroot ever ran, runs, or will ever run on such hosts [0]; static-only or thread-less hosts are also not widely deployed either...
[0] git grep -E 'HOSTARCH.*mips64' returns nothing before this series, so we have no special condition for running on mips64, which is a bit surprising...
Regards,
Yann E. MORIN.
The following changes since commit e321e81cf921346ec2d4cd1a9439016c7b2d3fb5
configs/beaglebone: bump Linux to 6.6.32-ti-rt-arm32-r7 and U-Boot to 2024.07 (2024-07-30 23:44:30 +0200)
are available as patches in this mail series,
for you to apply patches up to 5cb88f8337a63230f90e02423005ba169e307549
package/skopeo: bump version (2024-08-01 10:36:24 +0200)
----------------------------------------------------------------
Yann E. MORIN (7):
package/skopeo: add missing dependency on host go arch support package/go: expose host CGO linking support package/delve: needs CGO linking for host package/moby-buildkit: needs CGO linking for host package/runc: needs CGO linking for host package/skopeo: needs CGO linking for host package/skopeo: bump version
docs/manual/adding-packages-golang.adoc | 3 ++- package/delve/Config.in.host | 1 + package/go/Config.in.host | 12 ++++++++++++ package/go/go.mk | 7 ++++--- package/moby-buildkit/Config.in.host | 1 + package/runc/Config.in.host | 1 + package/skopeo/Config.in.host | 2 ++ package/skopeo/skopeo.hash | 2 +- package/skopeo/skopeo.mk | 2 +- 9 files changed, 25 insertions(+), 6 deletions(-)
--
____________ .-----------------.--------------------: _ :------------------. | Yann E. MORIN | Real-Time Embedded | __/ ) | /"\ ASCII RIBBON | | | Software Designer | _/ - /' | \ / CAMPAIGN | | +33 638.411.245 '--------------------: (_ `--, | X AGAINST | | yann.morin (at) orange.com |_=" ,--' | / \ HTML MAIL |
'--------------------------------------:______/_____:------------------'
____________________________________________________________________________________________________________
Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration, Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.
This message and its attachments may contain confidential or privileged information that may be protected by law; they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments. As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified. Thank you.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH 1/7 package/skopeo: add missing dependency on host go arch support
From: "Yann E. MORIN" <[email protected]>
--- package/skopeo/Config.in.host | 1 + 1 file changed, 1 insertion(+)
package/skopeo/Config.in.host +1 -0
@@ -1,5 +1,6 @@ config BR2_PACKAGE_HOST_SKOPEO bool "host skopeo" + depends on BR2_PACKAGE_HOST_GO_HOST_ARCH_SUPPORTS help skopeo is a command line utility that performs various operations on container images and image repositories.
Signature · 18 lines
2.34.1 ____________________________________________________________________________________________________________ Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration, Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci. This message and its attachments may contain confidential or privileged information that may be protected by law; they should not be distributed, used or copied without authorisation. If you have received this email in error, please notify the sender and delete this message and its attachments. As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified. Thank you. _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH 1/7] package/skopeo: add missing dependency on host go arch support
Quoted 8 lines · On Thu, 1 Aug 2024 10:45:45 +0200 <[email protected]> wrote:
From: "Yann E. MORIN" <[email protected]>
Fixes 619b83a4438667cdb4cc8a7dddc79dbf6d84ec2aSigned-off-by Yann E. MORIN <[email protected]>--- package/skopeo/Config.in.host | 1 + 1 file changed, 1 insertion(+)
Applied to master after adding a reference to an autobuilder failure fixed by this patch. Thanks!
Thomas
Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH 2/7 package/go: expose host CGO linking support
In reply to [email protected]From: "Yann E. MORIN" <[email protected]>
Even when configured for cross-compilation, the go compiler is always able to build natively as well, and this is was we use in Buildroot to build host go packages. This implies that when the target has limitations, those limitations thus also apply to the host builds.
This means that, when there is no CGO linking support for the target, the compiler is built without CGO linking support, and thus CGO linking is also not available for the host builds.
Of course, when there is no go support for the target, the CGO linking support only depends on the host architecture.
Add a new Kconfig symbol that repesent whether CGO linking is available for the host; host packages can then depend on that symbol, like the target variants do on the corresponding target symbol.
--- docs/manual/adding-packages-golang.adoc | 3 ++- package/go/Config.in.host | 12 ++++++++++++ package/go/go.mk | 7 ++++--- 3 files changed, 18 insertions(+), 4 deletions(-)
docs/manual/adding-packages-golang.adoc +2 -1
@@ -49,7 +49,8 @@ infrastructure should depend on +BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS+ because Buildroot will automatically add a dependency on +host-go+ to such packages. If you need CGO support in your package, you must add a dependency on -+BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS+. ++BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS+; for host packages, +add a dependency on +BR2_PACKAGE_HOST_GO_HOST_CGO_LINKING_SUPPORTS+. The main macro of the Go package infrastructure is +golang-package+. It is similar to the +generic-package+ macro. The
package/go/Config.in.host +12 -0
@@ -36,6 +36,18 @@ config BR2_PACKAGE_HOST_GO_HOST_ARCH_SUPPORTS default y depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE3_ARCH_SUPPORTS +# CGO linking for the host. Since we use the same compiler for target +# and host, if the target can't do CGO linking, then the host can't. +# But if the target is not supported by Go, then the host can do CGO +# linking (except when it itself does not support CGO linking). +config BR2_PACKAGE_HOST_GO_HOST_CGO_LINKING_SUPPORTS + bool + default y if BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS + default y if !BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS + depends on BR2_PACKAGE_HOST_GO_HOST_ARCH_SUPPORTS + depends on BR2_HOSTARCH != "mips64" + depends on BR2_HOSTARCH != "mips64el" + # Go packages should select BR2_PACKAGE_HOST_GO config BR2_PACKAGE_HOST_GO bool
package/go/go.mk +4 -3
@@ -91,10 +91,11 @@ else HOST_GO_CGO_ENABLED = 0 endif else # !BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS -# If the target arch does not support go, host-go can still be used to build -# packages for the host, and enable cgo. No need to set all the arch stuff -#since we will not be cross-compiling. +ifeq ($(BR2_PACKAGE_HOST_GO_HOST_CGO_LINKING_SUPPORTS),y) HOST_GO_CGO_ENABLED = 1 +else # !BR2_PACKAGE_HOST_GO_HOST_CGO_LINKING_SUPPORTS +HOST_GO_CGO_ENABLED = 0 +endif # BR2_PACKAGE_HOST_GO_HOST_CGO_LINKING_SUPPORTS endif # BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS # Ensure the toolchain is available, whatever the provider HOST_GO_DEPENDENCIES += $(HOST_GO_DEPENDENCIES_CGO)
Signature · 18 lines
2.34.1 ____________________________________________________________________________________________________________ Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration, Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci. This message and its attachments may contain confidential or privileged information that may be protected by law; they should not be distributed, used or copied without authorisation. If you have received this email in error, please notify the sender and delete this message and its attachments. As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified. Thank you. _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH 2/7] package/go: expose host CGO linking support
Quoted 70 lines · On 01/08/2024 10:45, [email protected] wrote:
From: "Yann E. MORIN" <[email protected]>
Even when configured for cross-compilation, the go compiler is always able to build natively as well, and this is was we use in Buildroot to build host go packages. This implies that when the target has limitations, those limitations thus also apply to the host builds.
This means that, when there is no CGO linking support for the target, the compiler is built without CGO linking support, and thus CGO linking is also not available for the host builds.
Of course, when there is no go support for the target, the CGO linking support only depends on the host architecture.
Add a new
Kconfigsymbol that repesent whether CGO linking is available for the host; host packages can then depend on that symbol, like the target variants do on the corresponding target symbol.Signed-off-by Yann E. MORIN <[email protected]>Cc Thomas Perale <[email protected]>Cc Christian Stewart <[email protected]>Cc Anisse Astier <[email protected]>--- docs/manual/adding-packages-golang.adoc | 3 ++- package/go/Config.in.host | 12 ++++++++++++ package/go/go.mk | 7 ++++--- 3 files changed, 18 insertions(+), 4 deletions(-)docs/manual/adding-packages-golang.adoc +2
-1@@ -49,7 +49,8 @@ infrastructure should depend on +BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS+ because Buildroot will automatically add a dependency on +host-go+ to such packages. If you need CGO support in your package, you must add a dependency on -+BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS+. ++BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS+; for host packages, +add a dependency on +BR2_PACKAGE_HOST_GO_HOST_CGO_LINKING_SUPPORTS+. The main macro of the Go package infrastructure is +golang-package+. It is similar to the +generic-package+ macro. Thepackage/go/Config.in.host +12
-0@@ -36,6 +36,18 @@ config BR2_PACKAGE_HOST_GO_HOST_ARCH_SUPPORTS default y depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE3_ARCH_SUPPORTS +# CGO linking for the host. Since we use the same compiler for target +# and host, if the target can't do CGO linking, then the host can't. +# But if the target is not supported by Go, then the host can do CGO +# linking (except when it itself does not support CGO linking). +config BR2_PACKAGE_HOST_GO_HOST_CGO_LINKING_SUPPORTS + bool + default y if BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS + default y if !BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS + depends on BR2_PACKAGE_HOST_GO_HOST_ARCH_SUPPORTS + depends on BR2_HOSTARCH != "mips64" + depends on BR2_HOSTARCH != "mips64el" + # Go packages should select BR2_PACKAGE_HOST_GO config BR2_PACKAGE_HOST_GO boolpackage/go/go.mk +0
-0
package/go/go.mk else · line 97
Quoted 10 lines
package/go/go.mk +3
-3@@ -91,10 +91,11 @@ else HOST_GO_CGO_ENABLED = 0 endif else # !BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS -# If the target arch does not support go, host-go can still be used to build -# packages for the host, and enable cgo. No need to set all the arch stuff -#since we will not be cross-compiling. +ifeq ($(BR2_PACKAGE_HOST_GO_HOST_CGO_LINKING_SUPPORTS),y) HOST_GO_CGO_ENABLED = 1 +else # !BR2_PACKAGE_HOST_GO_HOST_CGO_LINKING_SUPPORTS +HOST_GO_CGO_ENABLED = 0
There is still a weird situation here: if the host is mips64, then it's
possible that the host builds do _not_ support CGO, but target builds don't - and we still pass CGO_ENABLED=1 for host builds. Of course, host packages that rely on CGO should be excluded already in Config.in.host, but what if CGO is optional?
My first intuition was that we should have a separate HOST_GO_HOST_CGO_ENABLED
for host builds, but the problem still exists for the go-src package itself, since it has host and target in a single build. In fact, what will happen when you build that package on a mips64 for a target that does support CGO?
Anyway, I think this patch is still progress, but a bit risky to still apply
to master just befor the release. So I applied to next instead.
Regards,
Arnout
package/go/go.mk else · line 101
Quoted 4 lines
package/go/go.mk +1
-0+endif # BR2_PACKAGE_HOST_GO_HOST_CGO_LINKING_SUPPORTS endif # BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS # Ensure the toolchain is available, whatever the provider HOST_GO_DEPENDENCIES += $(HOST_GO_DEPENDENCIES_CGO)
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH 3/7 package/delve: needs CGO linking for host
In reply to [email protected]From: "Yann E. MORIN" <[email protected]>
The target variant depends on CGO linking, so propagate it to the host variant as well.
--- package/delve/Config.in.host | 1 + 1 file changed, 1 insertion(+)
package/delve/Config.in.host +1 -0
@@ -1,6 +1,7 @@ config BR2_PACKAGE_HOST_DELVE bool "host delve" depends on BR2_PACKAGE_HOST_GO_HOST_ARCH_SUPPORTS + depends on BR2_PACKAGE_HOST_GO_HOST_CGO_LINKING_SUPPORTS select BR2_PACKAGE_HOST_GO help Delve is a debugger for the Go programming language.
Signature · 18 lines
2.34.1 ____________________________________________________________________________________________________________ Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration, Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci. This message and its attachments may contain confidential or privileged information that may be protected by law; they should not be distributed, used or copied without authorisation. If you have received this email in error, please notify the sender and delete this message and its attachments. As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified. Thank you. _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH 4/7 package/moby-buildkit: needs CGO linking for host
In reply to [email protected]From: "Yann E. MORIN" <[email protected]>
The target variant depends on CGO linking, so propagate it to the host variant as well.
--- package/moby-buildkit/Config.in.host | 1 + 1 file changed, 1 insertion(+)
package/moby-buildkit/Config.in.host +1 -0
@@ -1,6 +1,7 @@ config BR2_PACKAGE_HOST_MOBY_BUILDKIT bool "host moby-buildkit" depends on BR2_PACKAGE_HOST_GO_HOST_ARCH_SUPPORTS + depends on BR2_PACKAGE_HOST_GO_HOST_CGO_LINKING_SUPPORTS select BR2_PACKAGE_HOST_GO help BuildKit is a toolkit for converting source code to build
Signature · 18 lines
2.34.1 ____________________________________________________________________________________________________________ Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration, Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci. This message and its attachments may contain confidential or privileged information that may be protected by law; they should not be distributed, used or copied without authorisation. If you have received this email in error, please notify the sender and delete this message and its attachments. As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified. Thank you. _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH 5/7 package/runc: needs CGO linking for host
In reply to [email protected]From: "Yann E. MORIN" <[email protected]>
The target variant depends on CGO linking, so propagate it to the host variant as well.
--- package/runc/Config.in.host | 1 + 1 file changed, 1 insertion(+)
package/runc/Config.in.host +1 -0
@@ -1,6 +1,7 @@ config BR2_PACKAGE_HOST_RUNC bool "host runc" depends on BR2_PACKAGE_HOST_GO_HOST_ARCH_SUPPORTS + depends on BR2_PACKAGE_HOST_GO_HOST_CGO_LINKING_SUPPORTS select BR2_PACKAGE_HOST_GO help runC is a CLI tool for spawning and running containers
Signature · 18 lines
2.34.1 ____________________________________________________________________________________________________________ Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration, Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci. This message and its attachments may contain confidential or privileged information that may be protected by law; they should not be distributed, used or copied without authorisation. If you have received this email in error, please notify the sender and delete this message and its attachments. As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified. Thank you. _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH 6/7 package/skopeo: needs CGO linking for host
In reply to [email protected]From: "Yann E. MORIN" <[email protected]>
--- package/skopeo/Config.in.host | 1 + 1 file changed, 1 insertion(+)
package/skopeo/Config.in.host +1 -0
@@ -1,6 +1,7 @@ config BR2_PACKAGE_HOST_SKOPEO bool "host skopeo" depends on BR2_PACKAGE_HOST_GO_HOST_ARCH_SUPPORTS + depends on BR2_PACKAGE_HOST_GO_HOST_CGO_LINKING_SUPPORTS help skopeo is a command line utility that performs various operations on container images and image repositories.
Signature · 18 lines
2.34.1 ____________________________________________________________________________________________________________ Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration, Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci. This message and its attachments may contain confidential or privileged information that may be protected by law; they should not be distributed, used or copied without authorisation. If you have received this email in error, please notify the sender and delete this message and its attachments. As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified. Thank you. _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH 7/7 package/skopeo: bump version
In reply to [email protected]From: "Yann E. MORIN" <[email protected]>
--- package/skopeo/skopeo.hash | 2 +- package/skopeo/skopeo.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
package/skopeo/skopeo.hash +1 -1
@@ -1,3 +1,3 @@ # Locally calculated -sha256 0b788fc5725ac79327f7c29797821a2bafc1c3c87bbfcb2998c2a1be949e314d skopeo-1.13.3-go2.tar.gz +sha256 fed91fd067605460ef33431163227471b1e85c8768203fc393345d6ffd645448 skopeo-1.16.0-go2.tar.gz sha256 716a8b80635c394681e652823e1e42e411ad2d254e1f202403422d74f4b0b106 LICENSE
package/skopeo/skopeo.mk +1 -1
@@ -4,7 +4,7 @@ # ################################################################################ -SKOPEO_VERSION = 1.13.3 +SKOPEO_VERSION = 1.16.0 SKOPEO_SITE = $(call github,containers,skopeo,v$(SKOPEO_VERSION)) SKOPEO_LICENSE = Apache-2.0
Signature · 18 lines
2.34.1 ____________________________________________________________________________________________________________ Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration, Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci. This message and its attachments may contain confidential or privileged information that may be protected by law; they should not be distributed, used or copied without authorisation. If you have received this email in error, please notify the sender and delete this message and its attachments. As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified. Thank you. _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 70 lines · On 01/08/2024 10:45, [email protected] wrote:
From: "Yann E. MORIN" <[email protected]>
Hello All!
This series adds the necessary pieces to expose whether the go compiler has CGO linking support for the host.
The overall issue with the go compiler, is that we have a single one that can build for the target *and* for the host. Any limitation due to the target thus leak to the host. This is notably the case for CGO linking.
This series fixes that by adding a
Kconfigsymbol that represents whether CGO linking for the host is available. Then, it goes on to fix a few existing packages to add the new dependency.Host variants of target packages that need CGO linking were found with:
$ git grep -l BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS \ |while read f; do [ -e "${f}.host" ] && echo "${f}" doneWhich returns a rather short list:
package/delve/Config.in
package/moby-buildkit/Config.in
package/runc/Config.inAnd thus they are all three fixed.
There are only two host-only packages:
$ git grep -l host-golang-package package/*/'**'.mk \ |while read f; do grep -q -E '\(golang' "${f}" || echo "${f}" done package/mender-artifact/mender-artifact.mk package/skopeo/skopeo.mkSkopeo is fixed in this series, as this is what prompted this work; so it leaves mender-artifact to check. I have no idea how to check whether a package needs CGO linking, though, so this is left as an exercise for any interested party... This is however rather theoretical, as the only hosts that do not support CGO linking (based on the target conditions) would be mips64 or mips64el hosts, and it is very doubtful Buildroot ever ran, runs, or will ever run on such hosts [0]; static-only or thread-less hosts are also not widely deployed either...
[0] git grep -E 'HOSTARCH.*mips64' returns nothing before this series, so we have no special condition for running on mips64, which is a bit surprising...
Regards,
Yann E. MORIN.The following changes since commit
e321e81cf921346ec2d4cd1a9439016c7b2d3fb5configs/beaglebone: bump Linux to 6.6.32-ti-rt-arm32-r7 and U-Boot to 2024.07 (2024-07-30 23:44:30 +0200)are available as patches in this mail series,
for you to apply patches up to
5cb88f8337a63230f90e02423005ba169e307549package/skopeo: bump version (2024-08-01 10:36:24 +0200)
Quoted 9 lines
----------------------------------------------------------------
Yann E. MORIN (7):
package/skopeo: add missing dependency on host go arch support package/go: expose host CGO linking support package/delve: needs CGO linking for host package/moby-buildkit: needs CGO linking for host package/runc: needs CGO linking for host package/skopeo: needs CGO linking for host package/skopeo: bump versio
Applied the rest of the series to next. To avoid a merge conflict later, I
also cherry-picked the first one from maser to next.
Regards,
Arnout
Quoted 33 lines
docs/manual/adding-packages-golang.adoc | 3 ++- package/delve/Config.in.host | 1 + package/go/Config.in.host | 12 ++++++++++++ package/go/go.mk | 7 ++++--- package/moby-buildkit/Config.in.host | 1 + package/runc/Config.in.host | 1 + package/skopeo/Config.in.host | 2 ++ package/skopeo/skopeo.hash | 2 +- package/skopeo/skopeo.mk | 2 +- 9 files changed, 25 insertions(+), 6 deletions(-)--
____________ .-----------------.--------------------: _ :------------------. | Yann E. MORIN | Real-Time Embedded | __/ ) | /"\ ASCII RIBBON | | | Software Designer | _/ - /' | \ / CAMPAIGN | | +33 638.411.245 '--------------------: (_ `--, | X AGAINST | | yann.morin (at) orange.com |_=" ,--' | / \ HTML MAIL |'--------------------------------------:______/_____:------------------'
____________________________________________________________________________________________________________
Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration, Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.This message and its attachments may contain confidential or privileged information that may be protected by law; they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments. As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified. Thank you.
Quoted 4 lines
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot