* [Buildroot] [PATCH 1/1] package/go: make pre-built compiler provide target support too @ 2025-06-11 16:21 Florian Larysch 2025-07-06 16:40 ` Romain Naour via buildroot 2025-07-14 14:52 ` [Buildroot] [PATCH v2 " Florian Larysch 0 siblings, 2 replies; 13+ messages in thread From: Florian Larysch @ 2025-06-11 16:21 UTC (permalink / raw) To: buildroot; +Cc: Christian Stewart, Thomas Perale, Florian Larysch Currently, BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE3_ARCH_SUPPORTS, which transitively depends on stage1 bootstrapping support, which is only present for x86/x86_64 and arm. When building on a host system which doesn't support a full bootstrap (like aarch64), we can fall back on the pre-built toolchain. However, in that case, those symbols are all false, making the internal state of the build system inconsistent. In particular, this causes none of the environment variables like GOARCH to be set and thus the Go compiler will perform a native build instead of a cross build. Fix this by also allowing BR2_PACKAGE_HOST_GO_BIN_HOST_ARCH_SUPPORTS to fulfill the dependency. Signed-off-by: Florian Larysch <fl@n621.de> --- package/go/Config.in.host | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/go/Config.in.host b/package/go/Config.in.host index 7e354b3298..a42e37f90b 100644 --- a/package/go/Config.in.host +++ b/package/go/Config.in.host @@ -2,7 +2,7 @@ config BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS bool default y - depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE3_ARCH_SUPPORTS + depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE3_ARCH_SUPPORTS || BR2_PACKAGE_HOST_GO_BIN_HOST_ARCH_SUPPORTS # See https://go.dev/doc/install/source#environment # See src/go/build/syslist.go for the list of supported architectures depends on (BR2_arm && BR2_TOOLCHAIN_SUPPORTS_PIE) || BR2_aarch64 \ -- 2.49.0 _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [Buildroot] [PATCH 1/1] package/go: make pre-built compiler provide target support too 2025-06-11 16:21 [Buildroot] [PATCH 1/1] package/go: make pre-built compiler provide target support too Florian Larysch @ 2025-07-06 16:40 ` Romain Naour via buildroot 2025-07-06 17:13 ` Florian Larysch 2025-07-14 14:52 ` [Buildroot] [PATCH v2 " Florian Larysch 1 sibling, 1 reply; 13+ messages in thread From: Romain Naour via buildroot @ 2025-07-06 16:40 UTC (permalink / raw) To: Florian Larysch, buildroot; +Cc: Christian Stewart, Thomas Perale, yann.morin Hello Florian, Adding Yann in Cc (Go infra related topic) Le 11/06/2025 à 18:21, Florian Larysch a écrit : > Currently, BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS depends on > BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE3_ARCH_SUPPORTS, which transitively > depends on stage1 bootstrapping support, which is only present for > x86/x86_64 and arm. Ok. > > When building on a host system which doesn't support a full bootstrap > (like aarch64), we can fall back on the pre-built toolchain. However, in > that case, those symbols are all false, making the internal state of the > build system inconsistent. In particular, this causes none of the > environment variables like GOARCH to be set and thus the Go compiler > will perform a native build instead of a cross build. I don't understand this part. Since BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS is not set on aarch64 build machine, we can't enable any go packages for the target. We can only install host-go-bin (which is useless in this case). > > Fix this by also allowing BR2_PACKAGE_HOST_GO_BIN_HOST_ARCH_SUPPORTS to > fulfill the dependency. This would fix this commit [1] from Buildroot 2024.11, so it should be backported. [1] https://gitlab.com/buildroot.org/buildroot/-/commit/7b2a164b7460c07471080fe565bf5da76b032e59 Best regards, Romain > > Signed-off-by: Florian Larysch <fl@n621.de> > --- > package/go/Config.in.host | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/package/go/Config.in.host b/package/go/Config.in.host > index 7e354b3298..a42e37f90b 100644 > --- a/package/go/Config.in.host > +++ b/package/go/Config.in.host > @@ -2,7 +2,7 @@ > config BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS > bool > default y > - depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE3_ARCH_SUPPORTS > + depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE3_ARCH_SUPPORTS || BR2_PACKAGE_HOST_GO_BIN_HOST_ARCH_SUPPORTS > # See https://go.dev/doc/install/source#environment > # See src/go/build/syslist.go for the list of supported architectures > depends on (BR2_arm && BR2_TOOLCHAIN_SUPPORTS_PIE) || BR2_aarch64 \ _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Buildroot] [PATCH 1/1] package/go: make pre-built compiler provide target support too 2025-07-06 16:40 ` Romain Naour via buildroot @ 2025-07-06 17:13 ` Florian Larysch 2025-07-06 19:59 ` Romain Naour via buildroot 0 siblings, 1 reply; 13+ messages in thread From: Florian Larysch @ 2025-07-06 17:13 UTC (permalink / raw) To: Romain Naour; +Cc: buildroot, Christian Stewart, Thomas Perale, yann.morin Hello Romain, thanks for taking a look! On Sun, Jul 06, 2025 at 06:40:10PM +0200, Romain Naour wrote: > > When building on a host system which doesn't support a full bootstrap > > (like aarch64), we can fall back on the pre-built toolchain. However, in > > that case, those symbols are all false, making the internal state of the > > build system inconsistent. In particular, this causes none of the > > environment variables like GOARCH to be set and thus the Go compiler > > will perform a native build instead of a cross build. > > I don't understand this part. Since BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS is > not set on aarch64 build machine, we can't enable any go packages for the > target. Exactly, that's the problem I'm trying to solve here. > We can only install host-go-bin (which is useless in this case). It isn't useless because this is the cross-compiler that enables us to build packages for the target. Whether we do a full bootstrap via BR2_PACKAGE_HOST_GO_SRC or get the pre-built binary via BR2_PACKAGE_HOST_GO_BIN, the result is the same kind of host-go. Florian _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Buildroot] [PATCH 1/1] package/go: make pre-built compiler provide target support too 2025-07-06 17:13 ` Florian Larysch @ 2025-07-06 19:59 ` Romain Naour via buildroot 2025-07-07 15:43 ` Florian Larysch 0 siblings, 1 reply; 13+ messages in thread From: Romain Naour via buildroot @ 2025-07-06 19:59 UTC (permalink / raw) To: Florian Larysch; +Cc: buildroot, Christian Stewart, Thomas Perale, yann.morin Hello Florian, Le 06/07/2025 à 19:13, Florian Larysch a écrit : > Hello Romain, > > thanks for taking a look! > > On Sun, Jul 06, 2025 at 06:40:10PM +0200, Romain Naour wrote: >>> When building on a host system which doesn't support a full bootstrap >>> (like aarch64), we can fall back on the pre-built toolchain. However, in >>> that case, those symbols are all false, making the internal state of the >>> build system inconsistent. In particular, this causes none of the >>> environment variables like GOARCH to be set and thus the Go compiler >>> will perform a native build instead of a cross build. >> >> I don't understand this part. Since BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS is >> not set on aarch64 build machine, we can't enable any go packages for the >> target. > > Exactly, that's the problem I'm trying to solve here. > >> We can only install host-go-bin (which is useless in this case). > > It isn't useless because this is the cross-compiler that enables us to > build packages for the target. Whether we do a full bootstrap via > BR2_PACKAGE_HOST_GO_SRC or get the pre-built binary via > BR2_PACKAGE_HOST_GO_BIN, the result is the same kind of host-go. I believe there is an misunderstanding here. When you say "we can fall back on the pre-built toolchain", we indeed fall back on the pre-built go cross-toolchain (host-go) but since BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS is missing, host-go can't be used to build go target packages (even if it's installed in HOST_DIR). Since it's a pre-built toolchain there is no native build involved. As you explained, the full bootstrap via BR2_PACKAGE_HOST_GO_SRC is not supported on aarch64 hosts. With your patch applied, we can now use host-go (provided by host-go-bin) on aaarch64 hosts to build go target packages. I'm agree with your changes, it's just the commit log that needs to be reworded (with the link to the commit adding host-go-bin package). Best regards, Romain > > Florian _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Buildroot] [PATCH 1/1] package/go: make pre-built compiler provide target support too 2025-07-06 19:59 ` Romain Naour via buildroot @ 2025-07-07 15:43 ` Florian Larysch 2025-07-08 5:04 ` yann.morin 0 siblings, 1 reply; 13+ messages in thread From: Florian Larysch @ 2025-07-07 15:43 UTC (permalink / raw) To: Romain Naour; +Cc: buildroot, Christian Stewart, Thomas Perale, yann.morin Hello Romain, On Sun, Jul 06, 2025 at 09:59:53PM +0200, Romain Naour wrote: > I believe there is an misunderstanding here. Yeah and I'm afraid you've lost me completely now, sorry. :( > When you say "we can fall back on the pre-built toolchain", we indeed fall back > on the pre-built go cross-toolchain (host-go) but since > BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS is missing, host-go can't be used to > build go target packages (even if it's installed in HOST_DIR). > > Since it's a pre-built toolchain there is no native build involved. > As you explained, the full bootstrap via BR2_PACKAGE_HOST_GO_SRC is not > supported on aarch64 hosts. > > With your patch applied, we can now use host-go (provided by host-go-bin) on > aaarch64 hosts to build go target packages. I'm agree with your changes, it's > just the commit log that needs to be reworded (with the link to the commit > adding host-go-bin package). As I read it, this is more or less what the commit message is already saying. Can you please explain where you think it is incorrect or imprecise? The only reference to a native build in the commit message is when it is describing the current broken state that causes a native build of target packages to happen erroneously. I can of course add the link. Florian _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Buildroot] [PATCH 1/1] package/go: make pre-built compiler provide target support too 2025-07-07 15:43 ` Florian Larysch @ 2025-07-08 5:04 ` yann.morin 2025-07-09 14:59 ` Florian Larysch 0 siblings, 1 reply; 13+ messages in thread From: yann.morin @ 2025-07-08 5:04 UTC (permalink / raw) To: Florian Larysch; +Cc: Romain Naour, buildroot, Christian Stewart, Thomas Perale Florian, All, On 2025-07-07 17:43 +0200, Florian Larysch spake thusly: > On Sun, Jul 06, 2025 at 09:59:53PM +0200, Romain Naour wrote: > > I believe there is an misunderstanding here. > Yeah and I'm afraid you've lost me completely now, sorry. :( To be honest, I also got slightly lost. I agree with Romain that the original commit message was not entirely clear (I had to read it very carefully to get it, but then I'm still waiting for my cafeine shot to kick in...) But also I'm not sure I entirely groked Romain's comments either. ;-p So, I've had a go (aha!) at rewriting a commit log as I understood the situation, building upon your initial commit log and trying to account for Romain's comments: ---8<--- All go packages must depend on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS, which ensures that we do have a go compiler available for that target. Now, BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS is restricted to the availability of a host go bootstrap, i.e. that the build machine can bootstrap a go compiler. However, there are architectures which can not bootstrap a go compiler, but for which exist pre-built go toolchains; this is the case, for example, of AArch64. Thus, currently, on an AArch64 host, we can't build go packages (for target or host), because we can't bootstrap a go compiler. It is to be noted that a single go compiler can generate code for all the architectures supported by go. When host-go-bin was added in commit 7b2a164b7460 (package/go/go-bin: new host-go provider), the host depenency was properly accounted for: it is already possible to build host-go packages with go-bin. However, the fact that a go compiler, in addition to its native target, can also generate code for all supported architectures, was missed at the time. We fix that by relaxing the condition under which BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS is set, by allowing go-bin along go-bootstrap. This allows a situation where the host can't bootstrap, but for which there is a pre-built toolchain, to build go packages for a supported target. ---8<--- I hope that is clearer and fits the bill. If I missed anything, don;t hesitate to amend/fix/ditch that proposal. Regards, Yann E. MORIN. > > When you say "we can fall back on the pre-built toolchain", we indeed fall back > > on the pre-built go cross-toolchain (host-go) but since > > BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS is missing, host-go can't be used to > > build go target packages (even if it's installed in HOST_DIR). > > > > Since it's a pre-built toolchain there is no native build involved. > > As you explained, the full bootstrap via BR2_PACKAGE_HOST_GO_SRC is not > > supported on aarch64 hosts. > > > > With your patch applied, we can now use host-go (provided by host-go-bin) on > > aaarch64 hosts to build go target packages. I'm agree with your changes, it's > > just the commit log that needs to be reworded (with the link to the commit > > adding host-go-bin package). > > As I read it, this is more or less what the commit message is already > saying. Can you please explain where you think it is incorrect or > imprecise? > > The only reference to a native build in the commit message is when it is > describing the current broken state that causes a native build of target > packages to happen erroneously. > > I can of course add the link. > > Florian -- ____________ .-----------------.--------------------: _ :------------------. | 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] 13+ messages in thread
* Re: [Buildroot] [PATCH 1/1] package/go: make pre-built compiler provide target support too 2025-07-08 5:04 ` yann.morin @ 2025-07-09 14:59 ` Florian Larysch 2025-07-10 8:35 ` yann.morin 0 siblings, 1 reply; 13+ messages in thread From: Florian Larysch @ 2025-07-09 14:59 UTC (permalink / raw) To: yann.morin; +Cc: Romain Naour, buildroot, Christian Stewart, Thomas Perale Hello Yann, On Tue, Jul 08, 2025 at 07:04:22AM +0200, yann.morin@orange.com wrote: > So, I've had a go (aha!) at rewriting a commit log as I understood the > situation, building upon your initial commit log and trying to account > for Romain's comments: Thank you! That does seem more straightforward than the original message. I think I now realize where the whole confusion was coming from: The package in question in our internal tree that made me discover this problem in the first place was missing the BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS dependency and thus enabling "go-bin" *seemed* to work but ended up just building the package for the host architecture. I didn't realize that this was caused by a packaging problem on our end and not a Buildroot issue (if the dependency had been correctly declared, the package would not have been selectable) and I ended up dragging this into my commit message (the part about native builds). Either way, feel free to commit this with your reworded message. Or should I send a v2? Florian _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Buildroot] [PATCH 1/1] package/go: make pre-built compiler provide target support too 2025-07-09 14:59 ` Florian Larysch @ 2025-07-10 8:35 ` yann.morin 0 siblings, 0 replies; 13+ messages in thread From: yann.morin @ 2025-07-10 8:35 UTC (permalink / raw) To: Florian Larysch; +Cc: Romain Naour, buildroot, Christian Stewart, Thomas Perale Florian, All, On 2025-07-09 16:59 +0200, Florian Larysch spake thusly: > On Tue, Jul 08, 2025 at 07:04:22AM +0200, yann.morin@orange.com wrote: > > So, I've had a go (aha!) at rewriting a commit log as I understood the > > situation, building upon your initial commit log and trying to account > > for Romain's comments: > Thank you! That does seem more straightforward than the original > message. [--SNIP--] > Either way, feel free to commit this with your reworded message. Or > should I send a v2? I think you should just resubmit with the updated commit log. Do not forget to mention, below the '---' line, that is is a v2 that incorporates an extended commit log, e.g. something like: Signed-off-by: Your NAME <your-email> Cc: romain <email> Cc: yann <email> --- Changes v1 -> v2: - rewrite commit log as suggested by Romain and Yann. that way, it is easier for a future reviewer to follow what's going on. Regards, Yann E. MORIN. -- ____________ .-----------------.--------------------: _ :------------------. | 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] 13+ messages in thread
* [Buildroot] [PATCH v2 1/1] package/go: make pre-built compiler provide target support too 2025-06-11 16:21 [Buildroot] [PATCH 1/1] package/go: make pre-built compiler provide target support too Florian Larysch 2025-07-06 16:40 ` Romain Naour via buildroot @ 2025-07-14 14:52 ` Florian Larysch 2025-07-28 14:12 ` Florian Larysch ` (2 more replies) 1 sibling, 3 replies; 13+ messages in thread From: Florian Larysch @ 2025-07-14 14:52 UTC (permalink / raw) To: buildroot Cc: Christian Stewart, Thomas Perale, Florian Larysch, Yann E. MORIN, Romain Naour All Go packages must depend on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS, which ensures that we do have a Go compiler available for that target. BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS is currently restricted to the availability of a full host Go compiler bootstrap. However, there are architectures like AArch64 for which a full bootstrap is not supported. Thus, currently, on an AArch64 host, we can't build Go packages (for target or host), because we can't bootstrap a Go compiler. However, note that a single Go compiler can generate code for all the architectures supported by Go and for some host architectures, there are pre-built toolchains available. When host-go-bin was added in commit 7b2a164b7460 ("package/go/go-bin: new host-go provider"), the host dependency was properly accounted for: It is already possible to build host-go packages with go-bin. However, the fact that a Go compiler, in addition to its native target, can also generate code for all supported architectures, was missed at the time. Thus, we can fix this problem by relaxing the condition under which BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS is set to allowing go-bin along with go-bootstrap. This allows a situation where the host can't bootstrap, but for which there is a pre-built toolchain to build Go packages for a supported target. Signed-off-by: Florian Larysch <fl@n621.de> Cc: Yann E. MORIN <yann.morin@orange.com> Cc: Romain Naour <romain.naour@smile.fr> --- v1->v2: - Reworded commit message after discussion with Romain and Yann. package/go/Config.in.host | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/go/Config.in.host b/package/go/Config.in.host index 7e354b3298..a42e37f90b 100644 --- a/package/go/Config.in.host +++ b/package/go/Config.in.host @@ -2,7 +2,7 @@ config BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS bool default y - depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE3_ARCH_SUPPORTS + depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE3_ARCH_SUPPORTS || BR2_PACKAGE_HOST_GO_BIN_HOST_ARCH_SUPPORTS # See https://go.dev/doc/install/source#environment # See src/go/build/syslist.go for the list of supported architectures depends on (BR2_arm && BR2_TOOLCHAIN_SUPPORTS_PIE) || BR2_aarch64 \ -- 2.49.0 _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [Buildroot] [PATCH v2 1/1] package/go: make pre-built compiler provide target support too 2025-07-14 14:52 ` [Buildroot] [PATCH v2 " Florian Larysch @ 2025-07-28 14:12 ` Florian Larysch 2025-07-29 11:53 ` yann.morin 2025-08-14 20:31 ` Thomas Perale via buildroot 2 siblings, 0 replies; 13+ messages in thread From: Florian Larysch @ 2025-07-28 14:12 UTC (permalink / raw) To: buildroot; +Cc: Yann E. MORIN, Romain Naour Yann, Romain, do you have any further feedback on the new version of this patch? Thanks, Florian _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Buildroot] [PATCH v2 1/1] package/go: make pre-built compiler provide target support too 2025-07-14 14:52 ` [Buildroot] [PATCH v2 " Florian Larysch 2025-07-28 14:12 ` Florian Larysch @ 2025-07-29 11:53 ` yann.morin 2025-08-09 17:27 ` Romain Naour via buildroot 2025-08-14 20:31 ` Thomas Perale via buildroot 2 siblings, 1 reply; 13+ messages in thread From: yann.morin @ 2025-07-29 11:53 UTC (permalink / raw) To: Florian Larysch; +Cc: buildroot, Christian Stewart, Thomas Perale, Romain Naour Florian, All, On 2025-07-14 16:52 +0200, Florian Larysch spake thusly: > All Go packages must depend on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS, > which ensures that we do have a Go compiler available for that target. > > BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS is currently restricted to the > availability of a full host Go compiler bootstrap. However, there are > architectures like AArch64 for which a full bootstrap is not supported. > > Thus, currently, on an AArch64 host, we can't build Go packages (for > target or host), because we can't bootstrap a Go compiler. > > However, note that a single Go compiler can generate code for all the > architectures supported by Go and for some host architectures, there are > pre-built toolchains available. When host-go-bin was added in commit > 7b2a164b7460 ("package/go/go-bin: new host-go provider"), the host > dependency was properly accounted for: It is already possible to build > host-go packages with go-bin. However, the fact that a Go compiler, in > addition to its native target, can also generate code for all supported > architectures, was missed at the time. > > Thus, we can fix this problem by relaxing the condition under which > BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS is set to allowing go-bin > along with go-bootstrap. This allows a situation where the host can't > bootstrap, but for which there is a pre-built toolchain to build Go > packages for a supported target. > > Signed-off-by: Florian Larysch <fl@n621.de> > Cc: Yann E. MORIN <yann.morin@orange.com> > Cc: Romain Naour <romain.naour@smile.fr> Reviewed-by: Yann E. MORIN <yann.morin@orange.com> Thanks for the respin! Regards, Yann E. MORIN. > --- > v1->v2: > - Reworded commit message after discussion with Romain and Yann. > > package/go/Config.in.host | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/package/go/Config.in.host b/package/go/Config.in.host > index 7e354b3298..a42e37f90b 100644 > --- a/package/go/Config.in.host > +++ b/package/go/Config.in.host > @@ -2,7 +2,7 @@ > config BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS > bool > default y > - depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE3_ARCH_SUPPORTS > + depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE3_ARCH_SUPPORTS || BR2_PACKAGE_HOST_GO_BIN_HOST_ARCH_SUPPORTS > # See https://go.dev/doc/install/source#environment > # See src/go/build/syslist.go for the list of supported architectures > depends on (BR2_arm && BR2_TOOLCHAIN_SUPPORTS_PIE) || BR2_aarch64 \ > -- > 2.49.0 > -- ____________ .-----------------.--------------------: _ :------------------. | 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] 13+ messages in thread
* Re: [Buildroot] [PATCH v2 1/1] package/go: make pre-built compiler provide target support too 2025-07-29 11:53 ` yann.morin @ 2025-08-09 17:27 ` Romain Naour via buildroot 0 siblings, 0 replies; 13+ messages in thread From: Romain Naour via buildroot @ 2025-08-09 17:27 UTC (permalink / raw) To: yann.morin, Florian Larysch; +Cc: buildroot, Christian Stewart, Thomas Perale Hello Forian, Yann, All, Le 29/07/2025 à 13:53, yann.morin@orange.com a écrit : > Florian, All, > > On 2025-07-14 16:52 +0200, Florian Larysch spake thusly: >> All Go packages must depend on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS, >> which ensures that we do have a Go compiler available for that target. >> >> BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS is currently restricted to the >> availability of a full host Go compiler bootstrap. However, there are >> architectures like AArch64 for which a full bootstrap is not supported. >> >> Thus, currently, on an AArch64 host, we can't build Go packages (for >> target or host), because we can't bootstrap a Go compiler. >> >> However, note that a single Go compiler can generate code for all the >> architectures supported by Go and for some host architectures, there are >> pre-built toolchains available. When host-go-bin was added in commit >> 7b2a164b7460 ("package/go/go-bin: new host-go provider"), the host >> dependency was properly accounted for: It is already possible to build >> host-go packages with go-bin. However, the fact that a Go compiler, in >> addition to its native target, can also generate code for all supported >> architectures, was missed at the time. >> >> Thus, we can fix this problem by relaxing the condition under which >> BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS is set to allowing go-bin >> along with go-bootstrap. This allows a situation where the host can't >> bootstrap, but for which there is a pre-built toolchain to build Go >> packages for a supported target. >> >> Signed-off-by: Florian Larysch <fl@n621.de> >> Cc: Yann E. MORIN <yann.morin@orange.com> >> Cc: Romain Naour <romain.naour@smile.fr> > > Reviewed-by: Yann E. MORIN <yann.morin@orange.com> > > Thanks for the respin! +1 :) Applied to master, thanks. Best regards, Romain > > Regards, > Yann E. MORIN. > >> --- >> v1->v2: >> - Reworded commit message after discussion with Romain and Yann. >> >> package/go/Config.in.host | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/package/go/Config.in.host b/package/go/Config.in.host >> index 7e354b3298..a42e37f90b 100644 >> --- a/package/go/Config.in.host >> +++ b/package/go/Config.in.host >> @@ -2,7 +2,7 @@ >> config BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS >> bool >> default y >> - depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE3_ARCH_SUPPORTS >> + depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE3_ARCH_SUPPORTS || BR2_PACKAGE_HOST_GO_BIN_HOST_ARCH_SUPPORTS >> # See https://go.dev/doc/install/source#environment >> # See src/go/build/syslist.go for the list of supported architectures >> depends on (BR2_arm && BR2_TOOLCHAIN_SUPPORTS_PIE) || BR2_aarch64 \ >> -- >> 2.49.0 >> > _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Buildroot] [PATCH v2 1/1] package/go: make pre-built compiler provide target support too 2025-07-14 14:52 ` [Buildroot] [PATCH v2 " Florian Larysch 2025-07-28 14:12 ` Florian Larysch 2025-07-29 11:53 ` yann.morin @ 2025-08-14 20:31 ` Thomas Perale via buildroot 2 siblings, 0 replies; 13+ messages in thread From: Thomas Perale via buildroot @ 2025-08-14 20:31 UTC (permalink / raw) To: Florian Larysch; +Cc: Thomas Perale, buildroot In reply of: > All Go packages must depend on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS, > which ensures that we do have a Go compiler available for that target. > > BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS is currently restricted to the > availability of a full host Go compiler bootstrap. However, there are > architectures like AArch64 for which a full bootstrap is not supported. > > Thus, currently, on an AArch64 host, we can't build Go packages (for > target or host), because we can't bootstrap a Go compiler. > > However, note that a single Go compiler can generate code for all the > architectures supported by Go and for some host architectures, there are > pre-built toolchains available. When host-go-bin was added in commit > 7b2a164b7460 ("package/go/go-bin: new host-go provider"), the host > dependency was properly accounted for: It is already possible to build > host-go packages with go-bin. However, the fact that a Go compiler, in > addition to its native target, can also generate code for all supported > architectures, was missed at the time. > > Thus, we can fix this problem by relaxing the condition under which > BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS is set to allowing go-bin > along with go-bootstrap. This allows a situation where the host can't > bootstrap, but for which there is a pre-built toolchain to build Go > packages for a supported target. > > Signed-off-by: Florian Larysch <fl@n621.de> > Cc: Yann E. MORIN <yann.morin@orange.com> > Cc: Romain Naour <romain.naour@smile.fr> Applied to 2025.02.x & 2025.05.x. Thanks > --- > v1->v2: > - Reworded commit message after discussion with Romain and Yann. > > package/go/Config.in.host | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/package/go/Config.in.host b/package/go/Config.in.host > index 7e354b3298..a42e37f90b 100644 > --- a/package/go/Config.in.host > +++ b/package/go/Config.in.host > @@ -2,7 +2,7 @@ > config BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS > bool > default y > - depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE3_ARCH_SUPPORTS > + depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE3_ARCH_SUPPORTS || BR2_PACKAGE_HOST_GO_BIN_HOST_ARCH_SUPPORTS > # See https://go.dev/doc/install/source#environment > # See src/go/build/syslist.go for the list of supported architectures > depends on (BR2_arm && BR2_TOOLCHAIN_SUPPORTS_PIE) || BR2_aarch64 \ > -- > 2.49.0 > > _______________________________________________ > buildroot mailing list > buildroot@buildroot.org > https://lists.buildroot.org/mailman/listinfo/buildroot _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2025-08-14 20:31 UTC | newest] Thread overview: 13+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2025-06-11 16:21 [Buildroot] [PATCH 1/1] package/go: make pre-built compiler provide target support too Florian Larysch 2025-07-06 16:40 ` Romain Naour via buildroot 2025-07-06 17:13 ` Florian Larysch 2025-07-06 19:59 ` Romain Naour via buildroot 2025-07-07 15:43 ` Florian Larysch 2025-07-08 5:04 ` yann.morin 2025-07-09 14:59 ` Florian Larysch 2025-07-10 8:35 ` yann.morin 2025-07-14 14:52 ` [Buildroot] [PATCH v2 " Florian Larysch 2025-07-28 14:12 ` Florian Larysch 2025-07-29 11:53 ` yann.morin 2025-08-09 17:27 ` Romain Naour via buildroot 2025-08-14 20:31 ` Thomas Perale via buildroot
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox