Cross compiling GCC for aarch64

Tarjei Jensen tarjei99 at
Mon Oct 9 17:16:41 UTC 2017


This does NOT concern making a cross compiler. It is about cross compiling
gcc from ports so that it will work on aarch64 FreeBSD 12-CURRENT.

I have managed to create my own ports which allow me to use gcc6 as a cross
compiler on x86 Freebsd 11.1 with aarch64 FreeBSD 12-CURRENT being the
target. It seems to work fine.

The problem is that I want the GNU Ada compiler (gnat). It requires a
working Ada compiler to compile parts of the compiler. There is a gcc6-aux
pkg and port which uses v11 binaries. However it does *not* work on FreeBSD
12. It can compile, but the resulting executables does not work. And the
gdb skills needed to find out why is simply beyond me.

As I understand, what I am attempting is called a Canadian Cross.

My plan would be to use the ports system to do this. e.g. by doing a "make
build". Create a tarball of the result and unpack on the target system and
do a "make install". Or make a pkg. Whatever works.

I seem to have found the parameters to use for running the configure
script, but I would very much like to use the ports way.

Can anybody explain or point to an article which explains how to use the
Canadian Cross to cross compile gcc?

Suggestions and pointers to documentation are very much appreciated.


More information about the freebsd-ports mailing list