Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Fiona Klute <fiona.klute@gmx.de>
Cc: buildroot@buildroot.org, yann.morin@orange.com,
	Christian Stewart <christian@aperture.us>
Subject: Re: [Buildroot] [PATCH v3 2/3] package/pkg-golang: use ld.bfd instead of ld.gold on aarch64
Date: Sat, 22 Feb 2025 15:32:30 +0100	[thread overview]
Message-ID: <Z7nf_jNmDVM-N6WI@landeda> (raw)
In-Reply-To: <20250205135825.2310972-2-fiona.klute@gmx.de>

Fiona, All,

On 2025-02-05 14:58 +0100, Fiona Klute via buildroot spake thusly:
> From: "Fiona Klute (WIWA)" <fiona.klute@gmx.de>
> 
> Go forces use of the Gold linker on aarch64 due to a bug in BFD that
> is fixed in Binutils >= 2.41 (that includes all versions provided by
> Buildroot). Forcing Gold will break with toolchains that don't provide
> it (like the Buildroot toolchains), so override the flag and use BFD.
> 
> This override should be removed if Go stops forcing Gold, and may have
> to be adapted if the set of available linkers changes (e.g. with a
> future Binutils update).

This patch would fix issues also related to containerd, that we also
see in the autobuilders, e.g.:

    http://autobuild.buildroot.org/results/a59/a59bc999e9620ff6b9d97138a2de898aadc07529/build-end.log

    [...]/host/bin/aarch64-buildroot-linux-gnu-gcc [...] -fuse-ld=gold [...]
    collect2: fatal error: cannot find 'ld'
    compilation terminated.

Regards,
Yann E. MORIN.

> See: https://github.com/golang/go/issues/22040
> 
> Signed-off-by: Fiona Klute (WIWA) <fiona.klute@gmx.de>
> ---
> Changes v2 -> v3:
> * Note in commit message that changes to the override may be required
>   with Go or Binutils updates
> 
>  package/pkg-golang.mk | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/package/pkg-golang.mk b/package/pkg-golang.mk
> index a3421af288..bdf8de4d66 100644
> --- a/package/pkg-golang.mk
> +++ b/package/pkg-golang.mk
> @@ -118,6 +118,16 @@ $(2)_EXTLDFLAGS += -static
>  $(2)_TAGS += osusergo netgo
>  endif
>  
> +ifeq ($(BR2_aarch64),y)
> +# Go forces use of the Gold linker on aarch64 due to a bug in BFD that
> +# is fixed in Binutils >= 2.41 (that includes all versions provided by
> +# Buildroot). Forcing Gold will break with toolchains that don't
> +# provide it (like the Buildroot toolchains), so override the flag and
> +# use BFD.
> +# See: https://github.com/golang/go/issues/22040
> +$(2)_EXTLDFLAGS += -fuse-ld=bfd
> +endif
> +
>  ifneq ($$($(2)_EXTLDFLAGS),)
>  $(2)_LDFLAGS += -extldflags '$$($(2)_EXTLDFLAGS)'
>  endif
> -- 
> 2.47.2
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
> 

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  parent reply	other threads:[~2025-02-22 14:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-05 13:58 [Buildroot] [PATCH v3 1/3] package/pkg-golang: allow packages to provide extldflags Fiona Klute via buildroot
2025-02-05 13:58 ` [Buildroot] [PATCH v3 2/3] package/pkg-golang: use ld.bfd instead of ld.gold on aarch64 Fiona Klute via buildroot
2025-02-05 14:40   ` yann.morin
2025-02-22 14:32   ` Yann E. MORIN [this message]
2025-02-22 17:50     ` Christian Stewart via buildroot
2025-02-22 21:29       ` Romain Naour via buildroot
2025-02-05 13:58 ` [Buildroot] [PATCH v3 3/3] package/containerd: use --no-pie on musl Fiona Klute via buildroot
2025-02-05 14:41   ` yann.morin
2025-02-05 14:39 ` [Buildroot] [PATCH v3 1/3] package/pkg-golang: allow packages to provide extldflags yann.morin
2025-02-05 20:30 ` Christian Stewart via buildroot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z7nf_jNmDVM-N6WI@landeda \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@buildroot.org \
    --cc=christian@aperture.us \
    --cc=fiona.klute@gmx.de \
    --cc=yann.morin@orange.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox