svn commit: trunk/uClibc/include

Denys Vlasenko vda.linux at googlemail.com
Fri Feb 27 22:47:57 UTC 2009


On Thursday 26 February 2009 08:57:41 pm Rob Landley wrote:
> On Thursday 26 February 2009 02:16:02 Bernhard Reutner-Fischer wrote:
> > On Wed, Feb 25, 2009 at 01:38:39PM -0600, Rob Landley wrote:
> > >On Wednesday 25 February 2009 12:35:54 Bernhard Reutner-Fischer wrote:
> > >> On Tue, Feb 24, 2009 at 12:27:34AM +0000, landley at uclibc.org wrote:
> > >> > /* Special exit function which only terminates the current thread.  */
> > >> >-extern void __exit_thread (int val) __attribute__ ((noreturn));
> > >> >+extern void __exit_thread (int val) __attribute__ ((__noreturn__));
> > >>
> > >> This should rather be attribute_noreturn
> > >
> > >*shrug*  I just made it consistent with all the other declarations in the
> > >file.  Is there documentation on this somewhere?
> >
> > libc-symbols.h
> 
> That's documentation, is it?  I'd previously believed that "This file is
> part of the GNU C Library" at the top of those sort of files meant it
> had been blindly copied from glibc, and not necessarily indicative of
> uClibc's coding style.
> 
> Rummage, rummage...
> 
> I don't understand your recommendation.  include/unistd.h doesn't
> #include libc-symbols.h.  Nothing does, it only gets included because
> the uClibc build goes:
> 
>   CFLAGS := -include $(top_builddir)include/libc-symbols.h
> 
> in Rules.mak.  This means after the build, when unistd.h gets
> installed in /usr/include, how the heck are programs that #include
> it supposed to get a definition of attribute_noreturn (which would
> be polluting the user symbol space anyway)?
> 
> Let me check the current source:
> 
> $ find include | grep -v .svn | xargs grep noreturn
> include/libc-symbols.h:# define attribute_noreturn __attribute__ ((__noreturn__))
> include/libc-symbols.h:# define attribute_noreturn
> include/unistd.h:extern void _exit (int __status) __attribute__ ((__noreturn__));
> include/unistd.h:extern void __exit_thread (int val) __attribute__ ((__noreturn__));
> include/setjmp.h:     __THROW __attribute__ ((__noreturn__));
> include/setjmp.h:     __THROW __attribute__ ((__noreturn__));
> include/setjmp.h:     __THROW __attribute__ ((__noreturn__));
> include/stdlib.h:extern void abort (void) __THROW __attribute__ ((__noreturn__));
> include/stdlib.h:extern void exit (int __status) __THROW __attribute__ ((__noreturn__));
> include/stdlib.h:extern void _Exit (int __status) __THROW __attribute__ ((__noreturn__));
> include/err.h:     __attribute__ ((__noreturn__, __format__ (__printf__, 2, 3)));
> include/err.h:     __attribute__ ((__noreturn__, __format__ (__printf__, 2, 0)));
> include/err.h:     __attribute__ ((__noreturn__, __format__ (__printf__, 2, 3)));
> include/err.h:     __attribute__ ((__noreturn__, __format__ (__printf__, 2, 0)));
> 
> So there are exactly two instances in the headers of attribute_noreturn,
> both are the #defines you pointed two in libc-symbols.h.  Every other
> instance is __attribute__ ((__noreturn__)).
> 
> Out of curiosity, let's see what happens if I make the change, make clean,
> make defconfig, make...
> 
>   CC libc/sysdeps/linux/common/fstat.os
> libc/sysdeps/linux/common/fstat.c:43: error: '__EI_fstat64' aliased to undefined symbol '__GI_fstat64'
> make: *** [libc/sysdeps/linux/common/fstat.os] Error 1
> 
> Current svn doesn't build a defconfig on Ubuntu 8.10 x86_64 is what happens.
> (Try with 2.6.29-rc5 kernel headers?  Nope, that's not it, it's the .config.)
> 
> Ok, so which config symbol controls that...
> ./libc/sysdeps/linux/common/.fstat.os.dep:libc/sysdeps/linux/common/fstat.os: 
> libc/sysdeps/linux/common/fstat.c \
> 
> .fstat.os.dep?  Right, not the bug I'm looking for, so put a bit #if 0/#endif
> around the entire contents of that file.  Do it _again_ when lstat.c breaks
> the same way.  Do it _again_ for stat.c...

Reproduced.

Oh no. There is a particularly nasty hack around aliases, hidden symbols and such.
When I see something like *this*, I know it can't be good:

/* need to hide the 64bit prototype or the strong_alias()
 * will fail when __NR_stat64 doesnt exist */
#define stat64 __hidestat64
#include <sys/syscall.h>
#include <unistd.h>
...

And it indeed broke with libc_hidden_proto() removal.

Please try this patch. It worked for me (two .config's tested),
and it makes this stuff _simpler_.
--
vda



-------------- next part --------------
A non-text attachment was scrubbed...
Name: 9.patch
Type: text/x-diff
Size: 8518 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/uclibc/attachments/20090227/ae287ca7/attachment.bin>


More information about the uClibc mailing list