32 -> 64 bit cross compiler package?

Is there a package for cross compilation, to produce x86_64 binaries on i586? (Or packages, with ar, nm etc. packaged separately.)

The directions for building 64-bit Haiku look like that’s supported on the i586 platform, so that would be one way to go - download the whole Haiku source, build the tools and run them from there. (The directions talk about “Getting prerequisite software”, but I gather gcc, ld etc are in the Haiku source.)

The cross compiler for building haiku can be built using the configure script from the haiku repo (using the --build-cross-tools option). This option works on Haiku but I have not tried building the 64 bit version. Try it and let us know what happens!

1 Like

Seems to work, for a couple simple programs anyway. The haiku build didn’t finish successfully, but it compiled most everything. I took the gcc spec from build/BuildConfig, and copied development files from the haiku and haiku_devel packages to make a working gcc --sysroot directory, and with that it compiles binaries that work on x86_64.

Building haiku was kind of a mess. First, jambase was out of date, so I was to update it. Well … current jam version is installed … let’s uninstall it and install it again. whoa, seems like lots of stuff coming with it. Reboot, and jam works.

Next, some script is failing with “mformat: command not found”, “mmd: …”, but no idea what or where. All I know is it happens right after what looks like a “dd”. Well … let’s try “jam -dx” to see what it’s actually running. whoa, lots of stuff now compiling. Who knows. Anyway mostly built.

The haiku build is able to cross-compile things out of its own files, so I suppose I could in theory have set up a gcc command to do that for general purpose, just couldn’t see how. So I copied the development environment I needed out of the haiku and haiku_devel packages, as mentioned above.

These are from the mtools package, and used to create and manipulate FAT filesystems, I guess in this case to generate the EFI partition. They are listed in our dependencies for building:
https://www.haiku-os.org/guides/building/pre-reqs