I'm trying to cross-compile (first cross-tools) on amd64 to macppc
target. Since I've hit several issues along the way I'd first like to
verify I'm doing it in expected way. Of course I'm on fairly recent
-current (last week's code). What I do is:
$ cd /usr/src
$ doas make -f Makefile.cross TARGET=macppc cross-tools
is that supported/expected way or not?
My changes raping OpenBSD src are:
1) enable cross-compilation of 32-bit ppc on 64-bit amd64 in Makefile.cross
2) Clang produces more warnings than GCC so it chokes on -Werror in
binutils-2.17. "Fixed" by switching off appropriate warning option just
in related code by using #pragma ...Attempted to minimize impact since
those warnings are usable
3) fix un-init variabnle in xcofflink.c -- Clang caught.
4) clang/Makefile.inc uses -Wl,-relax on powerpc platform, but this
option is not supported by neither of OpenBSD linkers. GNU supports
--relax but since clang (used as HOSTCC) seems to use LLVM's ld, it
chokes on this so I commented this out.
5) libcompiler_rt/Makefile. Defines CC and CXX, but got it in a wrong
way for cross-compilation hence I ended with using clang for compiling
ppc code in libcompiler_rt and correctly used TARGET ld complains about
wrong ELF format. Comment the code to solve this.