svn commit: trunk/uClibc: include libc/inet libc/inet/rpc libc/mis etc...

Denys Vlasenko vda.linux at googlemail.com
Tue May 20 18:40:19 UTC 2008


On Tuesday 20 May 2008 11:03, Bernhard Fischer wrote:
> On Mon, May 19, 2008 at 03:57:36PM -0700, vda at uclibc.org wrote:
> >Author: vda
> >Date: 2008-05-19 15:57:34 -0700 (Mon, 19 May 2008)
> >New Revision: 22012
> >
> >Log:
> >Moving libc_hidden_proto's into #ifdef UCLIBC_INTERNAL block
> >in string.h and strings.h. This caught unguarded string ops in
> >libc/inet/ethers.c __ether_line_w() function.
> >
> >I will wait for fallout reports for a week or so,
> 
>   CC libpthread/linuxthreads.old/forward.oS
> In file included from
> libpthread/linuxthreads.old/../linuxthreads.old_db/thread_dbP.h:7,
>                  from libpthread/linuxthreads.old/internals.h:32,
>                  from libpthread/linuxthreads.old/forward.c:27:
> ./include/string.h:440: warning: asm declaration ignored due to conflict with previous rename
> ./include/string.h:441: warning: asm declaration ignored due to conflict with previous rename
> ./include/string.h:443: warning: asm declaration ignored due to conflict with previous rename
> ./include/string.h:445: warning: asm declaration ignored due to conflict with previous rename
> ./include/string.h:446: warning: asm declaration ignored due to conflict with previous rename
> ./include/string.h:447: warning: asm declaration ignored due to conflict with previous rename
> [snip all the rest]
> 
> Please let me know if you need additional info.

I can reproduce it. In fact, there is a hint in libpthread/linuxthreads.old/forward.c
that something is fishy here:

#include <features.h>
#include <stdlib.h>
#include <dlfcn.h>

/* psm: keep this before internals.h */  <==============
libc_hidden_proto(exit)

#include "internals.h"
...

psm noticed that doing libc_hidden_proto(exit) AFTER #include "internals.h"
produces a warning, and commented about it. But he either didn't look into "why?"
or he didn't describe it in comments. Bad boy psm, bad ;) [joking]

The same thing bites here, just with libc_hidden_proto(memcpy) etc. instead.
it happens inside internals.h when it includes string.h.
I killed 20 minutes finding out "why?".
It happens quite deep in include tree.

I took unmodified tree (prior to rev 22012) and played with
adding just libc_hidden_proto(memcpy).
In libpthread/linuxthreads.old/sysdeps/pthread/bits/libc-lock.h
adding #include <string.h> and libc_hidden_proto(memcpy)
just before weak_extern (__pthread_initialize) will not warn:

//warns? no
//#include <string.h>
//libc_hidden_proto(memcpy)
weak_extern (__pthread_initialize)
//warns? yes
//#include <string.h>
//libc_hidden_proto(memcpy)

but adding after it will! Which is extremely strange -
weak_extern expands into just "#pragma weak __pthread_initialize"

These are exact gcc commands which are used to generate forward.oS:

gcc -E libpthread/linuxthreads.old/forward.c -o forward.i.c -include ./include/libc-symbols.h -Wall -Wstrict-prototypes -fno-strict-aliasing -Wnested-externs -Wshadow -Wmissing-noreturn -Wmissing-format-attribute -Wformat=2 -Wmissing-prototypes -Wmissing-declarations -Wnonnull -Wundef -ffunction-sections -fdata-sections -m32 -march=i486 -fstack-protector -fno-builtin -nostdinc -I./include -I. -I./libc/sysdeps/linux/i386 -DUCLIBC_INTERNAL -std=gnu99 -Os -funit-at-a-time -fno-tree-loop-optimize -fno-tree-dominator-opts -fno-strength-reduce -fomit-frame-pointer -mpreferred-stack-boundary=2 -falign-functions=1 -falign-jumps=1 -falign-labels=1 -falign-loops=1 -I./libpthread/linuxthreads.old/sysdeps/unix/sysv/linux/i386 -I./libpthread/linuxthreads.old/sysdeps/i386 -I./libpthread/linuxthreads.old/sysdeps/unix/sysv/linux -I./libpthread/linuxthreads.old/sysdeps/pthread -I./libpthread/linuxthreads.old -I./libpthread -I/usr/srcdevel/uclibc/include_2.6.18.1/include/ -iwithprefix include-fixed -iwithprefix include -DMALLOC_DEBUGGING -DHEAP_DEBUGGING -fPIC -DSHARED -fstack-protector-all
gcc -c forward.i.c -o forward.i.oS -include ./include/libc-symbols.h -Wall -Wstrict-prototypes -fno-strict-aliasing -Wnested-externs -Wshadow -Wmissing-noreturn -Wmissing-format-attribute -Wformat=2 -Wmissing-prototypes -Wmissing-declarations -Wnonnull -Wundef -ffunction-sections -fdata-sections -m32 -march=i486 -fstack-protector -fno-builtin -nostdinc -I./include -I. -I./libc/sysdeps/linux/i386 -DUCLIBC_INTERNAL -std=gnu99 -Os -funit-at-a-time -fno-tree-loop-optimize -fno-tree-dominator-opts -fno-strength-reduce -fomit-frame-pointer -mpreferred-stack-boundary=2 -falign-functions=1 -falign-jumps=1 -falign-labels=1 -falign-loops=1 -I./libpthread/linuxthreads.old/sysdeps/unix/sysv/linux/i386 -I./libpthread/linuxthreads.old/sysdeps/i386 -I./libpthread/linuxthreads.old/sysdeps/unix/sysv/linux -I./libpthread/linuxthreads.old/sysdeps/pthread -I./libpthread/linuxthreads.old -I./libpthread -I/usr/srcdevel/uclibc/include_2.6.18.1/include/ -iwithprefix include-fixed -iwithprefix include -DMALLOC_DEBUGGING -DHEAP_DEBUGGING -fPIC -DSHARED -fstack-protector-all

Can you confirm my observation by adding #include <string.h>
and libc_hidden_proto(memcpy) after weak_extern (__pthread_initialize)
and running above two commands?

Also note: if you will run first command, then comment out this line
in forward.i.c:

//#pragma weak __pthread_initialize

which should change nothing - __pthread_initialize is not mentined anywhere else
in forward.i.c - and run the second command - it will NOT warn!

Looks like gcc bug to me.


P.S. I am getting tons of warnings like this:

 CC libpthread/linuxthreads.old/spinlock.o
In file included from ./libpthread/linuxthreads.old/sysdeps/i386/tls.h:23,
                 from ./include/bits/uClibc_errno.h:14,
                 from ./include/errno.h:62,
                 from libpthread/linuxthreads.old/spinlock.c:19:
./libpthread/linuxthreads.old/sysdeps/i386/pt-machine.h:76:5: warning: "__ASSUME_LDT_WORKS" is not defined
In file included from libpthread/linuxthreads.old/internals.h:22,
                 from libpthread/linuxthreads.old/spinlock.c:25:
./libpthread/linuxthreads.old/sysdeps/pthread/bits/libc-tsd.h:40:5: warning: "USE_TLS" is not defined

(.config is attached)

and also forward.oS is not automatically rebuilt by make
if I touch it. I need to delete it and lib/* to make it work.
Build system is broken.
--
vda
-------------- next part --------------
#
# Automatically generated make config: don't edit
# Tue May 20 18:52:44 2008
#
# TARGET_alpha is not set
# TARGET_arm is not set
# TARGET_avr32 is not set
# TARGET_bfin is not set
# TARGET_cris is not set
# TARGET_e1 is not set
# TARGET_frv is not set
# TARGET_h8300 is not set
# TARGET_hppa is not set
TARGET_i386=y
# TARGET_i960 is not set
# TARGET_ia64 is not set
# TARGET_m68k is not set
# TARGET_microblaze is not set
# TARGET_mips is not set
# TARGET_nios is not set
# TARGET_nios2 is not set
# TARGET_powerpc is not set
# TARGET_sh is not set
# TARGET_sh64 is not set
# TARGET_sparc is not set
# TARGET_v850 is not set
# TARGET_vax is not set
# TARGET_x86_64 is not set
# TARGET_xtensa is not set

#
# Target Architecture Features and Options
#
TARGET_ARCH="i386"
FORCE_OPTIONS_FOR_ARCH=y
# CONFIG_GENERIC_386 is not set
# CONFIG_386 is not set
CONFIG_486=y
# CONFIG_586 is not set
# CONFIG_586MMX is not set
# CONFIG_686 is not set
# CONFIG_PENTIUMII is not set
# CONFIG_PENTIUMIII is not set
# CONFIG_PENTIUM4 is not set
# CONFIG_K6 is not set
# CONFIG_K7 is not set
# CONFIG_ELAN is not set
# CONFIG_CRUSOE is not set
# CONFIG_WINCHIPC6 is not set
# CONFIG_WINCHIP2 is not set
# CONFIG_CYRIXIII is not set
# CONFIG_NEHEMIAH is not set
TARGET_SUBARCH=""

#
# Using ELF file format
#
ARCH_LITTLE_ENDIAN=y

#
# Using Little Endian
#
ARCH_HAS_MMU=y
ARCH_USE_MMU=y
UCLIBC_HAS_FLOATS=y
UCLIBC_HAS_FPU=y
DO_C99_MATH=y
UCLIBC_HAS_FENV=y
KERNEL_HEADERS="/usr/srcdevel/uclibc/include_2.6.18.1/include"
HAVE_DOT_CONFIG=y

#
# General Library Settings
#
# HAVE_NO_PIC is not set
# DOPIC is not set
# HAVE_NO_SHARED is not set
# ARCH_HAS_NO_LDSO is not set
HAVE_SHARED=y
FORCE_SHAREABLE_TEXT_SEGMENTS=y
LDSO_LDD_SUPPORT=y
LDSO_CACHE_SUPPORT=y
# LDSO_PRELOAD_FILE_SUPPORT is not set
LDSO_BASE_FILENAME="ld.so"
UCLIBC_STATIC_LDCONFIG=y
LDSO_RUNPATH=y
UCLIBC_CTOR_DTOR=y
LDSO_GNU_HASH_SUPPORT=y
# HAS_NO_THREADS is not set
UCLIBC_HAS_THREADS=y
# PTHREADS_DEBUG_SUPPORT is not set
LINUXTHREADS_OLD=y
UCLIBC_HAS_LFS=y
# MALLOC is not set
# MALLOC_SIMPLE is not set
MALLOC_STANDARD=y
# MALLOC_GLIBC_COMPAT is not set
# UCLIBC_DYNAMIC_ATEXIT is not set
COMPAT_ATEXIT=y
UCLIBC_SUSV3_LEGACY=y
UCLIBC_SUSV3_LEGACY_MACROS=y
UCLIBC_HAS_SHADOW=y
# UCLIBC_HAS_PROGRAM_INVOCATION_NAME is not set
UNIX98PTY_ONLY=y
ASSUME_DEVPTS=y
UCLIBC_HAS_TM_EXTENSIONS=y
UCLIBC_HAS_TZ_CACHING=y
UCLIBC_HAS_TZ_FILE=y
UCLIBC_HAS_TZ_FILE_READ_MANY=y
UCLIBC_TZ_FILE_PATH="/etc/TZ"

#
# Advanced Library Settings
#
UCLIBC_PWD_BUFFER_SIZE=256
UCLIBC_GRP_BUFFER_SIZE=256

#
# Networking Support
#
UCLIBC_HAS_IPV6=y
UCLIBC_HAS_RPC=y
UCLIBC_HAS_FULL_RPC=y
UCLIBC_HAS_REENTRANT_RPC=y
# UCLIBC_USE_NETLINK is not set
UCLIBC_HAS_BSD_RES_CLOSE=y

#
# String and Stdio Support
#
UCLIBC_HAS_STRING_GENERIC_OPT=y
UCLIBC_HAS_STRING_ARCH_OPT=y
UCLIBC_HAS_CTYPE_TABLES=y
UCLIBC_HAS_CTYPE_SIGNED=y
UCLIBC_HAS_CTYPE_UNSAFE=y
# UCLIBC_HAS_CTYPE_CHECKED is not set
# UCLIBC_HAS_CTYPE_ENFORCED is not set
# UCLIBC_HAS_WCHAR is not set
# UCLIBC_HAS_LOCALE is not set
# UCLIBC_HAS_HEXADECIMAL_FLOATS is not set
USE_OLD_VFPRINTF=y
UCLIBC_HAS_SCANF_GLIBC_A_FLAG=y
# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set
# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set
# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set
UCLIBC_HAS_STDIO_BUFSIZ_1024=y
# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set
# UCLIBC_HAS_STDIO_BUFSIZ_4096 is not set
# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set
UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set
# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set
# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set
UCLIBC_HAS_STDIO_GETC_MACRO=y
UCLIBC_HAS_STDIO_PUTC_MACRO=y
UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
# UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE is not set
# UCLIBC_HAS_GLIBC_CUSTOM_STREAMS is not set
UCLIBC_HAS_PRINTF_M_SPEC=y
UCLIBC_HAS_ERRNO_MESSAGES=y
# UCLIBC_HAS_SYS_ERRLIST is not set
UCLIBC_HAS_SIGNUM_MESSAGES=y
# UCLIBC_HAS_SYS_SIGLIST is not set
UCLIBC_HAS_GNU_GETOPT=y
UCLIBC_HAS_GNU_GETSUBOPT=y

#
# Big and Tall
#
UCLIBC_HAS_REGEX=y
# UCLIBC_HAS_REGEX_OLD is not set
UCLIBC_HAS_FNMATCH=y
# UCLIBC_HAS_FNMATCH_OLD is not set
UCLIBC_HAS_WORDEXP=y
UCLIBC_HAS_FTW=y
UCLIBC_HAS_GLOB=y
UCLIBC_HAS_GNU_GLOB=y

#
# Library Installation Options
#
SHARED_LIB_LOADER_PREFIX="$(RUNTIME_PREFIX)lib"
RUNTIME_PREFIX="/usr/app/uclibc-NEW/$(TARGET_ARCH)/"
DEVEL_PREFIX="/usr/app/uclibc-NEW/$(TARGET_ARCH)/usr/"

#
# Security options
#
# UCLIBC_BUILD_PIE is not set
UCLIBC_HAS_ARC4RANDOM=y
# HAVE_NO_SSP is not set
UCLIBC_HAS_SSP=y
# UCLIBC_HAS_SSP_COMPAT is not set
SSP_QUICK_CANARY=y
# PROPOLICE_BLOCK_ABRT is not set
PROPOLICE_BLOCK_SEGV=y
UCLIBC_BUILD_SSP=y
# UCLIBC_BUILD_RELRO is not set
UCLIBC_BUILD_NOW=y
# UCLIBC_BUILD_NOEXECSTACK is not set

#
# uClibc development/debugging options
#
CROSS_COMPILER_PREFIX=""
UCLIBC_EXTRA_CFLAGS=""
# DODEBUG is not set
# DODEBUG_PT is not set
# DOSTRIP is not set
DOASSERTS=y
SUPPORT_LD_DEBUG=y
SUPPORT_LD_DEBUG_EARLY=y
UCLIBC_MALLOC_DEBUGGING=y
WARNINGS="-Wall"
EXTRA_WARNINGS=y
# DOMULTI is not set
# UCLIBC_MJN3_ONLY is not set


More information about the uClibc mailing list