gccgo: Fix build on Hurd #4477
No reviewers
Labels
No labels
closure-size
deprecation
good first issue
help-wanted
kind
bug
kind
foreign-distro
kind
moreinfo
kind
system-test
kind
wishlist
kind
wont-fix
package
fix
patch-upgrade
security-fixes
team-ai
team-audio
team-beam
team-bioinformatics
team-bootstrap
team-build-tools
team-core
team-core-packages
team-cpp
team-crypto
team-documentation
team-electronics
team-emacs
team-embedded
team-games
team-gnome
team-go
team-guile
team-hare
team-haskell
team-home
team-hpc
team-hurd
team-installer
team-java
team-javascript
team-julia
team-kde
team-kernel
team-lisp
team-localization
team-lua
team-lxqt
team-mate
team-mozilla
team-ocaml
team-perl
team-python
team-qa-packages
team-qt
team-r
team-racket
team-release
team-reproduciblebuilds
team-ruby
team-rust
team-science
team-sugar
team-sysadmin
team-telephony
team-tex
team-translations
team-vcs
team-xfce
team-zig
user-reviewed
world-rebuild
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
guix/guix!4477
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "yelninei/goos-hurd"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Change-Id: Ib2ec622d8dd4795afd3b8164ab5e910bbadb563b
tested to crossbuild a go application and noticed the goos value is wrong.
GOOS value from https://github.com/golang/go/blob/master/src/internal/syslist/syslist.go
Sadly
go-stdfails with default go.hurd is not a valid goos according to https://go.dev/doc/install/source#environment
Evaluation succeeded but produced no new builds.
Hurd should work with gccgo but i am not sure how to use with go-build-system.
When cross-compiling to hurd the
#:goused is(default-go)and not(default-gccgo)because(supported-package? (default-go))only checks the native system and not the target.build-system: go: Set correct GOOS for Hurd.to WIP: build-system: go: Set correct GOOS for Hurd.d1e8ca95f9tod088096a30WIP: build-system: go: Set correct GOOS for Hurd.to build-system: go: Set correct GOOS for Hurd.WIth this change go is only used if it is supported by both the system and target, falling back to gccgo if not.
ALso the change for the correct hurd goos.
build-system: go: Set correct GOOS for Hurd.to build-system: go: When cross compiling check if target supports go.build-system: go: When cross compiling check if target supports go.to WIP: build-system: go: When cross compiling check if target supports go.Tried to cross compile a simple hello world and it failed with
So it seems like cross compiling does not work at all currently as that is also the error i get when trying to build from x86_64-linux->aarch64-linux
Then with an unset GOBIN gccgo failed linking
I guess we need a gccgo cross compiler instead of the native gccgo
WIP: build-system: go: When cross compiling check if target supports go.to WIP: build-system: go: Support cross compilationd088096a30to03596d297bWIP: build-system: go: Support cross compilationto WIP: gccgo on HurdI think I'll only try to solve the native case first, the cross stuff is a bit more involved.
gccgo fails to build
the configure script correctly determins that
-fsplit-stackdoes not workto be investigated,
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104290
https://gcc.gnu.org/cgit/gcc/commit/?id=29eacf043b6e8560c5c42d67f7f9b11e4e2cb156
The patch fixes gccgo, i am not sure what to do with it, it should be in gcc itself and not only gccgo.
The patch is now in the gcc trees for v13,v14 and v15.
I have built a gccgo@12 with this and assume that others are fine as well as gcc14 failed with the same error before.
Also a simple hello world example works without issues.
WIP: gccgo on Hurdto gccgo on Hurdgccgo on Hurdto gccgo: Fix build on Hurdgccgo@14 fails on x86_64-gnu with
This is fixed in gcc 15 with.
github.com/golang/gofrontend@f9ea980105gcc@15 works on x86_64-gnu.
Should default gccgo beupdated to track default/latest gcc?
Hi, thank you for your R&D work to bring Go to Hurd.
Sorry for no replay for a long time, I have no Hurd machine to check the native build only Qemu VM, how did you check?
i have both a i586-gnu and x86_64-gnu childhurd (with hurd-vm-service-type) and offload the builds with something like
and then wait 4h for gcc to bootstrap (you probably need to run them with at least 3G of ram and 7-8GiB of disk size).
WIth this patch it works for gccgo@12,13,14,15 on i586-gnu and gccgo@15 on x86_64-gnu (it needs the other patch i mentioned for the older versions).
I odn't quite like that the patch is only in gccgo and not the default gc where it should really belong.
What do you think of bumping the default gccgo to 15 (latest) and putting the patch to the default gcc@15 patches and then gccgo@15 will inherit automatically?
This would be relatively easy now while gcc@15 has not many dependants yet.
Adding it to the other gcc's is a lot harder because they have a lot of dependant packages but if the default gccgo is bumped then the fact that the older ones don't build should be ok.
Is gccgo used on other platforms or are all the other ones supported by the default go?
The other thing setting the correct GOOS is a nice thing for technical correctness but cross compiling in go-build-system in general seems to be broken atm. I opened an issue for that here guix/guix#5063
9023f841d9tof7a79e3229@Hellseher I did exactly that in the latest update and am currently rebuilding both gccgo.
As the default go seems to be supported by all but powerpc-linux and hurd the bump of the default-gccgo should not rebuild much.
I also put the patch on the default gcc-15 so it can be automatically removed when gcc-15 eventually gets updated to 15.3.
There are still some uses of gccgo-12 and gccgo-14 should these be updated aswell? maybe there should be an unversioned gccgo symbol (pointing to gccgo-15) that everything that uses gccgo references?
but updating thesemight need to go on a go-team branch.
Results of evaluation 195175 for commit
f7a79e3229:gcc-toolchain-15.2.0,hyprlang-0.6.7,hyprgraphics-0.4.0,hyprutils-0.10.4,rr-5.9.0-0.7fe1e36,xdg-desktop-portal-hyprland-1.3.11,hyprwayland-scanner-0.4.5,libgccjit-15.2.0,gcc-15.2.0,gccgo-15.2.0, and 17 more@Hellseher Any update on this?
@Yelninei wrote in #4477 (comment):
Hi, sorry did not have a chance yet to work on go-team branch, still on python.
Maybe @guix/hurd may give some review points meanwhile?
guix/hurd currently consists of janneke and myself.
the gcc patch is already in the trees for gcc-13,14 and 15.
For supporting x86_64-gnu one needs gcc-14+ but that is difficult to change and would need a second patch to fix the build.
Whether the gccgo used should be updated is a decision for guix/go. And from what I can see only hurd and 32bit powerpc are not supported by the normal go.
The GOOS change is trivial but cross compiling currently does not seem to work (especially when the target is not support by the regular go)
75b299934f* build-system: go: Update default-gccgo to gccgo@15.e4e34a57e5* gnu: gccgo-15: Fix build on Hurd.2e2914da5a* build-system: go: Set correct GOOS for Hurd.