Compiling ports in a post-9.0-RELEASE world

Kostik Belousov kostikbel at
Fri Mar 18 14:16:22 UTC 2011

On Fri, Mar 18, 2011 at 11:40:38AM +0100, Marco van de Voort wrote:
> In our previous episode, Matthias Andree said:
> > 
> > So far I've found clang surprisingly good in that it revealed a few 
> > quirks in my own software (in C) that GCC or ICC had silently accepted, 
> > and the static analyzer has a few rough edges, but I have found bugs in 
> > my own software, not in clang 2.8 so far, although I suspect that a few 
> > might linger there.
> How much changes for non-(GC)C ports? In other words, ports that directly
> use AS and LD to generate binaries, but might also link to C libraries
> outside of gcc's control.
> (I'm thinking about e.g. lang/fpc here)
> Issues like
> - Are there fundamental startup code (CSU) changes due to this in 9?
csu consists of two pieces. One, living in lib/csu, provides the
system startup for activated image, and it is not compiler-depended
in any way. The other part, implemented by crtbegin.o/crtend.o in gcc,
is compiler-depended and arranges the ctr/dtr calls at proper time.

> - libraries that might need to be implicitely linked when linking against C
>   code (like libgcc,c)
libc is system library, it is compiler-agnostic and shall provide the
same ABI regardless of the compiler. libgcc is compiler-depended, but
clang claims to conform to gcc ABI there.

> - Do certain libc internal macros change (like __errno_location)
Errno is part of libc, see above.

> - Do lowlevel details of stuff like TLS change?
TLS is implemented according to ELF ABI (some sort of ABI, there).
It is mostly implemented in rtld, and compiler just need to follow
the ABI.

> Of course I'll load up some RC or DP in a VM if necessary to find my own
> answers. But if somebody knows some details, it would help guestimating the
> effort.

It should be plug and play, modulo the bugs.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url :

More information about the freebsd-ports mailing list