Any notes on details what can be done for buildworld/buildkernel via clang/clang++ for powerpc64?

Mark Millard markmi at dsl-only.net
Wed Jan 13 11:16:58 UTC 2016


I've been experimenting some with base/projects/clang380-import , cortex-a7 arm (rpi2b) and amd64 so far. I'm unsure what to do relative to a basic check on powerpc64 (or powerpc if that was possible).

Anyone willing to send out notes on techniques/known-status for buildworld/buildkernel via clang/clang++ for powerpc64 (or powerpc)? Native? Via amd64? src.conf content? Other "adjustments" to /usr/src/ ? How much of the build can be clang/clang++ based?


My initial powerpc64 context:

I have 11.0-CURRENT powerpc64 operational via using devel/powerpc64-gcc (native) as the system compiler with WITH_LIBCPLUSPLUS= , clang 3.7.1 built but not used, no gcc 4.2.1 built. (lib32 builds but fails to work due to the crtbeginS.o content produced and then used: segmentation fault in _init.)

# freebsd-version -ku; uname -aKU
11.0-CURRENT
11.0-CURRENT
FreeBSD FBSDG5C0 11.0-CURRENT FreeBSD 11.0-CURRENT #9 r293632M: Sun Jan 10 12:47:56 PST 2016     markmi at FBSDG5C0:/usr/obj/xtoolchain/powerpc.powerpc64/usr/src/sys/GENERIC64vtsc-NODEBUG  powerpc 1100093 1100093

So I could experiment from a native powerpc64 context that initially includes clang 3.7.1, libc++, and lang/powerpc64, other than lib32 contexts. (Also present: lang/gcc49 and lang/gcc5 but with 32-bit support disabled.)

One odd point that I'm aware exists is that /usr/src/lib/csu/powerpc64/Makefile forces:

CC:=		gcc
COMPILER_TYPE:=	gcc

In my context this Makefile uses the powerpc64-gcc compiler currently. I've also have 3 /usr/src/sys/boot/*/Makefile.inc sources that use "-Wl,-m -Wl,elf32ppc_fbsd" in LDFLAGS in powerpc64 specific places instead of "-m elf32ppc_fbsd".

Because the powerpc64 machines I have access to are PowerMac G5's, I have also my change that avoids the mtsprg0 in /usr/src/sys/powerpc/ofw/ofw_machdep.c in order for G5 booting to be reliable. Because of the reliable booting issue for G5's I try to avoid using standard FreeBSD installers (.iso's and the like).

I build a kernel that has both vt and sc (but not ps3).

In /usr/src/contrib/libcxxrt/guard.cc I've commented out the use of the C11 notation for a static assertion because it is rejected by powerpc64-gcc.


I've never dealt with the Big Endian  vs. Little Endian UFS file system incompatibility issue as far as cross installing from amd64 goes. (For the rpi2b I just plug in the media to an amd64 FreeBSD 11.0-CURRENT context, mount it to /mnt, and use DESTDIR=/mnt (make) and -D /mnt (mergemaster) during install activities.)



My powerpc (non-64) contexts are way out of date. I'd have research to do just to get them up to date, such as being based on a fairly modern libc++.


===
Mark Millard
markmi at dsl-only.net



More information about the freebsd-ppc mailing list