crossbuild icon indicating copy to clipboard operation
crossbuild copied to clipboard

Add GCC & binutils to osxcross

Open abrodkin opened this issue 5 years ago • 0 comments

osxcross allows to additionally build cross-GCC & cross-binutils for Darwin (macOS). This could be done as simple as:

./build_gcc.sh
./build_binutils.sh

One note though - Binutils are being installed in target/binutils folder1, not target where Clang & GCC are being put. And so additional location target/binutils/bin should be added in the PATH.

And with both GCC & Binutils built I may do such a fancy things as building GNU toolchain for multiple CPU architectures that will work on macOS (via process known as a "Canadian cross" with https://github.com/crosstool-ng/crosstool-ng). If of any interest I may explain how that could be easily done :)

If any testing is needed I'll be happy to help.

1As I learned it the hard way there's a good reason for that: some binaries have the same name in both Binutils & cctools while not really being equally good (I bumped into GNU's Binutils ar creating bad archive headers which later leads to linkage problems, see a very similar problem discussed here - https://github.com/golang/go/issues/28796, once I have more time I'll try to see if that might be fixed - I guess it should just work in the end).

abrodkin avatar Jul 12 '20 07:07 abrodkin