Go: cmd/compile: implement powerpc 32-bit backend (ppc32)

Created on 27 Nov 2017  路  35Comments  路  Source: golang/go

Tracking bug for missing PowerPC 32-bit backend. People interested in this can put a 馃憤 reaction here so that we can track interest.

FeatureRequest

Most helpful comment

Interested by PPC32 here for "qoriq" Synology architectures

All 35 comments

any update 驴?

Updates will be posted here. There are no updates. I only see ten thumbs-up which is not really very many, though of course if someone volunteers to do the work and maintain a builder we will accept the port.

I want to help to work with g4/g5

32-bit PowerPC would be the 4xx, 6xx, 7xx (G3, Broadway/Wii, etc), and 74xx (G4), in addition to a few others.

The G5 is a POWER4+-based 64-bit PowerPC, which was supported until Go 1.9: see #19074 for more.

We at Ad茅lie have a ppc32 builder that could potentially be used for CI if this went anywhere.

any update about go with 32 bit for g4/g3 ?

I'm interested in create backend for ppc32, but currently I only have POWER8. I need to try build and run ppc32 binaries on my machine.

Linux installs on 64-bit PowerPC can do 32-bit chroots. You can set up a distro that supports ppc32, like Ad茅lie or Debian, into a chroot and work with it there.

I don't know if you can cross-endian chroot; I think you will need to be using big-endian PowerPC on the host.

I want to work with go in openbsd with powerpc g3/g4.

I'm interested in ppc32 in order to use prometheus node_exporter on a Dell/Cumulus switch

I'm interested in order to build restic backup on a MacMini PPC 7450.

I'll make a note that if you're using Linux and glibc, gcc-go works fine on PPC32. It does not yet work properly on musl, but I'm investigating that. This way we have a platform to bootstrap golang with, if there is ever such a backend.

Interested by PPC32 here for "qoriq" Synology architectures

Also interested in this for deployment of Go code, including but not limited to Prometheus node_exporter & blackbox_exporter on PPC32-based network switches.

Updates will be posted here. There are no updates. I only see ten thumbs-up which is not really very many, though of course if someone volunteers to do the work and maintain a builder we will accept the port.

@ianlancetaylor Having read up on #19074 and #24358, and fumbling slightly in the dark here except for knowing that I'd definitely would like to be able to build go apps for ppc32, it seems based on your comment alone that all that is required in order to enable this support is:

  • that ppc32-based builders are provided
  • that someone gifts the work to the project of enabling support for the arch

But given those two referenced tickets, is there opposition within the go community against having ppc32 supported? ppc32 runs on millions of devices, not only Wii's but various network devices with either Linux or BSD. I believe the use case me and @travbrack lists could see see significant adoption (for some value of significant).

If those two items are the "only" things required, perhaps I'd be interested in helping out. I can definitely provide a few linux & bsd-builders, but I would absolutely need help with the second point.

I can help testing with openbsd in ppc32 and 64 . (macppc , old powerpc apple)

Yes, having a builder and doing the work are all that is required. But maybe I should use scare quotes around "all" because the work is not trivial.

I can't think of any reason why anybody would be opposed to adding ppc32 support to Go. It seems like a good idea to me.

I'll note again here that any ppc64 (big endian) host can function as a ppc32 builder with a simple chroot. That's what we're doing at Ad茅lie to take advantage of the build speed of POWER9 hardware. You'll just have to be careful to not use any newer ISA instructions, since ppc32 goes back to at least the 700. (Not sure if the 4xx and 6xx would be supported by Go. Very popular in embedded still.)

The devices I'm looking at, I believe have 7xx, and it is exactly the fear (due to my ignorance) of accidentally using too new instruction sets that made me believe some Wii or similar would be an apt 7xx builder. But with less ignorance I guess newer hardware can be used as you say @awilfox.
Regardless, I googled Wii variants and it seems definitely tractable to solve this even in that way.

The big unknown for me is: where to even start looking at the scope of adding an arch to "cmd/compiler". @ianlancetaylor is non-trivial order of 100 hours, 1000 hours or more?

The length of time it takes is very hard to say, since it depends on how much you know about compilers already and how well you understand the PPC/PPC64 architecture. Adding PPC32 support should be much simpler than supporting a new architecture from scratch, since it will be very similar to the existing PPC64 support. The length of time is not really in doing the actual work; it is in understanding what has to be done.

I'm not sure exactly how to set it up to be usable in this role, but I have an iBook G3 with a PPC750 running Ad茅lie Linux that I could probably be convinced to turn in to a builder. (Or, I could simply smoketest on it when asked.)

Hi everybody. I can help with testing in PowerMac dual G5, iMac G4 & PowerBook G4, all with Ubuntu 16.04.5:

~$ uname -a
Linux nice 4.4.0-137-powerpc64-smp #163-Ubuntu SMP Mon Sep 24 13:53:31 UTC 2018 ppc64 ppc64 ppc64 GNU/Linux

~$ cat /etc/issue
Ubuntu 16.04.5 LTS

~$ sudo apt show golang
[sudo] password for remote: 
Package: golang
Version: 2:1.6-1ubuntu4
Priority: optional
Section: devel
Source: golang-defaults
Origin: Ubuntu
Maintainer: Ubuntu Developers <[email protected]>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 10.2 kB
Depends: golang-1.6, golang-doc (>= 2:1.6-1ubuntu4), golang-go (>= 2:1.6-1ubuntu4), golang-src (>= 2:1.6-1ubuntu4)
Homepage: https://golang.org
Download-Size: 2,766 B
APT-Sources: http://ports.ubuntu.com/ubuntu-ports xenial/main powerpc Packages

Interested by PPC32 for "ppc853x" Synology architectures

Cisco IE4000 supports running Docker containers but the platform is ppc32, AFAICT.

I own a Synology DS413 (https://en.wikichip.org/wiki/freescale/qoriq/p1022) so I would also love to be able to cross compile to POWER. Thanks!

I own a Synology DS213+ and would like to run Syncthing but that requires ppc32 support. Thanks in advance.

I want to run beats/filebeat in a ppc32 machine, but can not compile it now.

I have a mac mini G4 here. Running with MacOS 10.5.8 - I can test builds :-)

Running an eMac. Happy to help with testing!

I've got a Powerbook G4 and Blue & White iMac G3 both running Void Linux i can help test with.

I also have access to some ppc32 hardware.

Quoting this super useful post from Aram H膬v膬rneanu from https://groups.google.com/d/msg/golang-dev/SRUK7yJVA0c/JeoCRMwzBwAJ

"I've done many ports now, so the strategy I use
is this (very simplified):

1. Add GOOS/GOARCH support to the toolchain

2. Add some support for GOARCH in cmd/internal/obj
3. Add some support for GOARCH in cmd/asm
4. Add some support for GOOS/GOARCH in cmd/link

5. Iterate through 2-3-4 until you can produse some kind
   of binaries from assembly files. Depending on the specifics
   of GOOS/GOARCH you might, or might not need to use external
   linking.

6. Once you can produce binaries, thoroughly test them (link
   just assembly programs, without runtime). Basically make
   sure the low-level toolchain works.

7. Start working on the Go compiler for GOARCH.

8. Write a minimal alternative runtime for Go. The runtime
   is much too complicated as a first test Go program. Basically
   write your own runtime in assembly that is just stubbed
   out, but can run a good bulk of the programs in go/test.

9. Once that works well enough, start using the real runtime.
   This requires implementing a lot of assembly, but you can
   use the lessons learned from #8.

10. Make all the tests in go/test work.
11. Make all the stdlib tests work. You are still working
    amd64 now, and executing on GOARCH with go_GOOS_GOARCH_exec.

12. Run bootstrap.bash

13. Move over the artifacts on GOOS/GOARCH machine.

14. Make sure make.bash works. You will still likely have
    to fix problems to make this N-generation compiler work.

15. Make sure all.bash works.

16. Done.

As you can see, steps 1-14 are done on amd64 (or some other supported
platform), and only step 15 is done on the target architecture.

--
Aram H膬v膬rneanu"

I'm hoping to get OpenWrt support on powerpc_8540 and powerpc_464fp, including devices which tend to have a ton of ram and storage -- and tons of backup / storage utilities are written in Go.

An addendum for all here:

If you really need something written in Go compiled for your machine, use gccgo. That's probably the fastest way to get it done without heavy ISA-specific knowledge.

It appears there has been success in using gccgo to build Docker on the 440fpu architecture: https://www.mail-archive.com/[email protected]&q=subject:%22Re%5C%3A+%5C%5Bgo%5C-nuts%5C%5D+Port+to+powerpc+440fpu%22&o=newest

While it does not fall under the scope of the original issue, it looks like ppc32 gccgo is going OK on the go-nuts mailing list for building Docker.

... more information here about how they are going about developing and debugging gccgo compilation on ppc32: https://www.mail-archive.com/[email protected]/msg39718.html

Was this page helpful?
0 / 5 - 0 ratings