Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/7] package/go: handle CGO linking for the host
@ 2024-08-01  8:45 yann.morin
  2024-08-01  8:45 ` [Buildroot] [PATCH 1/7] package/skopeo: add missing dependency on host go arch support yann.morin
                   ` (7 more replies)
  0 siblings, 8 replies; 11+ messages in thread
From: yann.morin @ 2024-08-01  8:45 UTC (permalink / raw)
  To: buildroot; +Cc: Yann E . MORIN, Anisse Astier, Christian Stewart, Thomas Perale

From: "Yann E. MORIN" <yann.morin@orange.com>

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}"
    done

Which 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.mk

Skopeo 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
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-09-03 21:15 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-01  8:45 [Buildroot] [PATCH 0/7] package/go: handle CGO linking for the host yann.morin
2024-08-01  8:45 ` [Buildroot] [PATCH 1/7] package/skopeo: add missing dependency on host go arch support yann.morin
2024-08-19 21:33   ` Thomas Petazzoni via buildroot
2024-08-01  8:45 ` [Buildroot] [PATCH 2/7] package/go: expose host CGO linking support yann.morin
2024-09-03 20:44   ` Arnout Vandecappelle via buildroot
2024-08-01  8:45 ` [Buildroot] [PATCH 3/7] package/delve: needs CGO linking for host yann.morin
2024-08-01  8:45 ` [Buildroot] [PATCH 4/7] package/moby-buildkit: " yann.morin
2024-08-01  8:45 ` [Buildroot] [PATCH 5/7] package/runc: " yann.morin
2024-08-01  8:45 ` [Buildroot] [PATCH 6/7] package/skopeo: " yann.morin
2024-08-01  8:45 ` [Buildroot] [PATCH 7/7] package/skopeo: bump version yann.morin
2024-09-03 21:15 ` [Buildroot] [PATCH 0/7] package/go: handle CGO linking for the host Arnout Vandecappelle via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox