HEADS UP: sparc64 backend for llvm/clang imported

Dimitry Andric dim at FreeBSD.org
Fri Feb 28 19:22:20 UTC 2014


In r262613 I have merged the clang-sparc64 branch back to head.  This
imports an updated sparc64 backend for llvm and clang, allowing clang to
bootstrap itself on sparc64, and to completely build world.  To be able
to build the GENERIC kernel, there is still one patch to be finalized,
see below.

If you have any sparc64 hardware, and are not afraid to encounter rough
edges, please try out building and running your system with clang.  To
do so, update to at least r262613, and enable the following options in
e.g. src.conf, or in your build environment:


Alternatively, if you would rather keep gcc as /usr/bin/cc for the
moment, build world using just WITH_CLANG, enabling clang to be built
(by gcc) and installed.  After installworld, you can then set CC=clang,
CXX=clang++ and CPP=clang-cpp for building another world.

For building the sparc64 kernel, there is one open issue left, which is
that sys/sparc64/include/pcpu.h uses global register variables, and this
is not supported by clang.  A preliminary patch for this is attached,
but it may or may not blow up your system, please beware!

The patch changes the pcpu and curpcb global register variables into
inline functions, similar to what is done on other architectures.
However, the current approach is not optimal, and the emitted code is
slightly different from what gcc outputs.  Any improvements to this
patch are greatly appreciated!

Last but not least, thanks go out to Roman Divacky for his work with
llvm/clang upstream in getting the sparc64 backend into shape.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang-sparc64-pcpu-1.diff
Type: application/octet-stream
Size: 850 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-sparc64/attachments/20140228/c59a66cb/attachment.obj>
-------------- next part --------------

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 203 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freebsd.org/pipermail/freebsd-sparc64/attachments/20140228/c59a66cb/attachment.sig>

More information about the freebsd-sparc64 mailing list