svn commit: trunk/uClibc: include libc/string libc/string/generic etc...

Denys Vlasenko vda.linux at googlemail.com
Mon Jul 20 22:42:08 UTC 2009


On Monday 20 July 2009 23:00, Mike Frysinger wrote:
> > With attached config, and i486-linux-uclibc-XXX
> > toolchain, it works for me.
> >
> > Can you send me your .config, preprocessed source
> > and gcc command line which gives you trouble?
> >
> > What does your gcc -v say?
> 
> defconfig i386, then enable DODEBUG and DODEBUG_PT.  using gcc-4.1.1.

Thanks. The offending gcc command line is:


gcc -c libc/stdio/_fwrite.c -o libc/stdio/_fwrite.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 -funsigned-char -fno-builtin -fno-asm -std=gnu99 -ffunction-sections -fdata-sections \
-m32 -fno-stack-protector -nostdinc -I./include -I. -I./libc/sysdeps/linux/i386 -DUCLIBC_INTERNAL \
\
-O0 \
\
-g3 -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/include/ \
-isystem /.share/usr/app/gcc-4.2.1/bin/../lib/gcc/i386-pc-linux-gnu/4.2.1/include-fixed \
-isystem /.share/usr/app/gcc-4.2.1/bin/../lib/gcc/i386-pc-linux-gnu/4.2.1/include -DNDEBUG \
-fPIC -MT libc/stdio/_fwrite.os -MD -MP -MF libc/stdio/._fwrite.os.dep


-O0 is the problem, gcc becomes much dumber.

Please try attached patch. For me it compiles. Resulting code
from memchr(buffer, '\n', pending):

...
 132:   c7 45 e8 0a 00 00 00    movl   $0xa,-0x18(%ebp)  <=== !
 139:   8b 45 dc                mov    -0x24(%ebp),%eax
 13c:   89 45 e4                mov    %eax,-0x1c(%ebp)
 13f:   8b 7d ec                mov    -0x14(%ebp),%edi
 142:   8b 45 e8                mov    -0x18(%ebp),%eax  <=== wow!
 145:   8b 4d e4                mov    -0x1c(%ebp),%ecx
 148:   e3 07                   jecxz  151 <__stdio_fwrite+0x151>
 14a:   f2 ae                   repnz scas %es:(%edi),%al
 14c:   8d 7f ff                lea    -0x1(%edi),%edi
 14f:   74 02                   je     153 <__stdio_fwrite+0x153>
 151:   31 ff                   xor    %edi,%edi
...

-- 
vda

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


More information about the uClibc mailing list