Hi,

I played a bit with installed uclibc headers
(result of make install) and I noticed a few things:

features.h:

/* uClibc does not support *at interfaces. */
#undef _ATFILE_SOURCE
#undef __USE_ATFILE

Is this still frue? I saw some patches flying around...


Looks like _LIB define actually means "at libc build time"
(wow, a textbook example of a bad name).

#ifdef _LIBC
# include <libc-internal.h>
#endif

That's what I used UCLIBC_INTERNAL for (because I didn't know
about/_LIBC), but UCLIBC_INTERNAL also is unifdef'ed
out of installed headers. Are we better to also unifdef _LIBC?

And lastly, libc-internal.h and libc-symbols.h seem to be
of interest only to uclibc itself. These are also the only
files with pattern libc-XXXX.h. Should we exclude all such files?

This would be useful for other internal things too.
For one, I plan to add some optimized assembly
for inlined memsets etc, and I don't want it to spill over
into installed headers. libc-string-$ARCH.h would be a good place...

(OTOH:
hmm maybe i _should_ make it appear in installed headers?
User program:
#define UCLIBC_GIVE_ME_GOOD_STUFF
#include <string.h> // your memset now a clever macro (maybe)
)

Example of changes in installed headers by attached patch:

--- /usr/srcdevel/uclibc/fix/uClibc.t6/!INSTALL/i386/usr/include/features.h     
Thu Dec 11 00:36:36 2008
+++ !INSTALL/i386/usr/include/features.h        Thu Dec 11 01:05:33 2008
@@ -410,9 +410,6 @@
 #undef _ATFILE_SOURCE
 #undef __USE_ATFILE

-#ifdef _LIBC
-# include <libc-internal.h>
-#endif

 /* Some people like to build up uClibc with *-elf toolchains, so
  * a little grease here until we drop '#ifdef __linux__' checks
Only in /usr/srcdevel/uclibc/fix/uClibc.t6/!INSTALL: 
i386/usr/include/libc-symbols.h
--- /usr/srcdevel/uclibc/fix/uClibc.t6/!INSTALL/i386/usr/include/malloc.h       
Thu Dec 11 00:36:36 2008
+++ !INSTALL/i386/usr/include/malloc.h  Thu Dec 11 01:05:33 2008
@@ -51,11 +51,7 @@
 # define __malloc_ptr_t  char *
 #endif

-#ifdef _LIBC
-/* Used by GNU libc internals. */
-# define __malloc_size_t size_t
-# define __malloc_ptrdiff_t ptrdiff_t
-#elif !defined __attribute_malloc__
+#if   !defined __attribute_malloc__
 # define __attribute_malloc__
 #endif


The patch itself is below. Is it ok?
--
vda



diff -d -urpN uClibc.6/extra/scripts/install_headers.sh 
uClibc.7/extra/scripts/install_headers.sh
--- uClibc.6/extra/scripts/install_headers.sh   2008-11-29 16:37:45.000000000 
+0100
+++ uClibc.7/extra/scripts/install_headers.sh   2008-12-11 01:09:20.000000000 
+0100
@@ -41,13 +41,17 @@ IFS=''
 while read -r filename; do
        if test -d "$1/$filename"; then
                mkdir -p "$2/$filename" 2>/dev/null
-       else
-               # NB: unifdef exits with 1 if output is not
-               # exactly the same as input. That's ok.
-               # Do not abort the script if unifdef "fails"!
-               "$top_builddir/extra/scripts/unifdef" -UUCLIBC_INTERNAL 
"$1/$filename" \
-                   | sed -e 
'/^\(rtld\|lib\(c\|m\|resolv\|dl\|intl\|rt\|nsl\|util\|crypt\|pthread\)\)_hidden_proto[
    ]*([a-zA-Z0-9_]*)$/d' >"$2/$filename"
+               continue
+       fi
+       if test x"${filename##libc-*.h}" = x""; then
+               # Do not install libc-XXXX.h files
+               continue
        fi
+       # NB: unifdef exits with 1 if output is not
+       # exactly the same as input. That's ok.
+       # Do not abort the script if unifdef "fails"!
+       "$top_builddir/extra/scripts/unifdef" -UUCLIBC_INTERNAL -U_LIBC 
"$1/$filename" \
+           | sed -e 
'/^\(rtld\|lib\(c\|m\|resolv\|dl\|intl\|rt\|nsl\|util\|crypt\|pthread\)\)_hidden_proto[
    ]*([a-zA-Z0-9_]*)$/d' >"$2/$filename"
 done
 )
 
_______________________________________________
uClibc mailing list
uClibc@uclibc.org
http://busybox.net/cgi-bin/mailman/listinfo/uclibc

Reply via email to