[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

-xc99=all and libraries on Solaris 10

From: Peter O'Gorman
Subject: -xc99=all and libraries on Solaris 10
Date: Wed, 10 Feb 2010 11:20:42 -0600
User-agent: Mutt/1.5.19 (2009-01-05)


We came across an issue where our builds of konsole and gnome-terminal
were not working (Ctrl-C caused konsole to "hang" and gnome-terminal to
exit). This turned out to be due to autoconf's AC_PROG_CC_C99 macro. We
built libintl with some small patches and re-autoconf'ed it, so that our
libintl ended up being built with -xc99=all. This was the cause of
konsole's brokenness.

Libc, when deciding what its behavior should be looks at the values of
two global integers __xpg4 and __xpg6.

__xpg4=1; __xpg6=0x0000FFFF; is c99 behavior
__xpg4=0; __xpg6=0xFFFF0000; is c89 behavior.

When creating a library or application with c99 or cc -xc99=all
/usr/lib/values-xpg6.o is included in the output, this object file
contains the c99 definitions for __xpg4 and __xpg6. When creating output
without c99/-xc99=all this extra object is not put into the output and
the values of __xpg4 and __xpg6 in libc (c89 behavior) are used (because
they are the only definitions available).

What this means is, if a library is linked with c99 on solaris 10, any
clients of that library will get c99 behavior from libc (the lookup for
__xpg4 and __xpg6 will find the definitions in the library before
finding the ones in libc itself). It is, of course, possible to override
this by putting definitions for __xpg4 and __xpg6 into the application
itself (but then the library that was built with c99 will get c89
behavior from libc).

I don't believe that this behavior is documented, perhaps it should be?

Also, does anyone happen to know what exactly libc does differently
with __xpg4=1 (the __xpg6 settings are documented in

Peter O'Gorman

reply via email to

[Prev in Thread] Current Thread [Next in Thread]