This is a bug report from an OpenWrt user that I have also noticed myself. uClibc requires its syscalls to be inlined and therefore the attribute always_inline was added to ensure inlining. When gcc is called with -Os the always_inline attribute is not honored, resulting in a non working uClibc ldso. Please find the environmnet below. This is probably related to the regression closed here: System type: Debian testing compiling OpenWrt trunk 16656 GCC configuration: Using built-in specs. Target: mips-openwrt-linux-uclibc Configured with: /home/florian/dev/openwrt/trunk/build_dir/toolchain-mips_gcc-4.4.0_uClibc-0.9.30.1/gcc-4.4.0/configure --prefix=/home/florian/dev/openwrt/trunk/staging_dir/toolchain-mips_gcc-4.4.0_uClibc-0.9.30.1/usr --build=i486-linux-gnu --host=i486-linux-gnu --target=mips-openwrt-linux-uclibc --with-gnu-ld --enable-target-optspace --disable-libgomp --disable-libmudflap --disable-multilib --disable-nls --with-float=soft --with-gmp=/home/florian/dev/openwrt/trunk/staging_dir/host --with-mpfr=/home/florian/dev/openwrt/trunk/staging_dir/host --disable-decimal-float --disable-libssp --disable-__cxa_atexit --enable-languages=c --enable-shared --enable-threads --disable-tls --with-slibdir=/home/florian/dev/openwrt/trunk/staging_dir/toolchain-mips_gcc-4.4.0_uClibc-0.9.30.1/lib Thread model: posix gcc version 4.4.0 (GCC) Compiler output: mips-openwrt-linux-uclibc-gcc -c ldso/ldso/ldso.c -o ldso/ldso/ldso.oS -include ./include/libc-symbols.h -Wall -Wstrict-prototypes -fno-strict-aliasing -Os -march=octeon -pipe -funit-at-a-time -fhonour-copts -msoft-float -fno-stack-protector -fno-builtin -nostdinc -I./include -I. -I./libc/sysdeps/linux/mips -fno-asm -msoft-float -DUCLIBC_INTERNAL -std=gnu99 -Os -funit-at-a-time -fno-tree-loop-optimize -fno-tree-dominator-opts -fno-strength-reduce -mno-split-addresses -I./libpthread/linuxthreads.old/sysdeps/unix/sysv/linux/mips -I./libpthread/linuxthreads.old/sysdeps/mips -I./libpthread/linuxthreads.old/sysdeps/unix/sysv/linux -I./libpthread/linuxthreads.old/sysdeps/pthread -I./libpthread/linuxthreads.old -I./libpthread -I/home/florian/dev/openwrt/trunk/build_dir/toolchain-mips_gcc-4.4.0_uClibc-0.9.30.1/linux-dev/usr/include/ -I/home/florian/dev/openwrt/trunk/staging_dir/toolchain-mips_gcc-4.4.0_uClibc-0.9.30.1/usr/lib/gcc/mips-openwrt-linux-uclibc/4.4.0//include-fixed -I/home/florian/dev/openwrt/trunk/staging_dir/toolchain-mips_gcc-4.4.0_uClibc-0.9.30.1/usr/lib/gcc/mips-openwrt-linux-uclibc/4.4.0/include -DNDEBUG -mno-split-addresses -fPIC -DSHARED -DNOT_IN_libc -DIS_IN_rtld -fno-stack-protector -E -fno-omit-frame-pointer -I./ldso/ldso/mips -I./ldso/include -I./ldso/ldso -DUCLIBC_RUNTIME_PREFIX="/" -DUCLIBC_LDSO="ld-uClibc.so.0" -DLDSO_ELFINTERP="mips/elfinterp.c" -DNOT_IN_libc -DIS_IN_rtld -fno-stack-protector -E -fno-omit-frame-pointer -I./ldso/ldso/mips -I./ldso/include -I./ldso/ldso -DUCLIBC_RUNTIME_PREFIX="/" -DUCLIBC_LDSO="ld-uClibc.so.0" -MT ldso/ldso/ldso.oS -MD -MP -MF ldso/ldso/.ldso.oS.dep mips-openwrt-linux-uclibc-gcc -c ldso/ldso/mips/resolve.S -o ldso/ldso/mips/resolve.oS -include ./include/libc-symbols.h -Wall -Wstrict-prototypes -fno-strict-aliasing -Os -march=octeon -pipe -funit-at-a-time -fhonour-copts -msoft-float -fno-stack-protector -fno-builtin -nostdinc -I./include -I. -I./libc/sysdeps/linux/mips -fno-asm -msoft-float -DUCLIBC_INTERNAL -Os -funit-at-a-time -fno-tree-loop-optimize -fno-tree-dominator-opts -fno-strength-reduce -mno-split-addresses -I./libpthread/linuxthreads.old/sysdeps/unix/sysv/linux/mips -I./libpthread/linuxthreads.old/sysdeps/mips -I./libpthread/linuxthreads.old/sysdeps/unix/sysv/linux -I./libpthread/linuxthreads.old/sysdeps/pthread -I./libpthread/linuxthreads.old -I./libpthread -I/home/florian/dev/openwrt/trunk/build_dir/toolchain-mips_gcc-4.4.0_uClibc-0.9.30.1/linux-dev/usr/include/ -I/home/florian/dev/openwrt/trunk/staging_dir/toolchain-mips_gcc-4.4.0_uClibc-0.9.30.1/usr/lib/gcc/mips-openwrt-linux-uclibc/4.4.0//include-fixed -I/home/florian/dev/openwrt/trunk/staging_dir/toolchain-mips_gcc-4.4.0_uClibc-0.9.30.1/usr/lib/gcc/mips-openwrt-linux-uclibc/4.4.0/include -DNDEBUG -mno-split-addresses -fPIC -DSHARED -DNOT_IN_libc -DIS_IN_rtld -fno-stack-protector -E -fno-omit-frame-pointer -I./ldso/ldso/mips -I./ldso/include -I./ldso/ldso -DUCLIBC_RUNTIME_PREFIX="/" -DUCLIBC_LDSO="ld-uClibc.so.0" -MT ldso/ldso/mips/resolve.oS -MD -MP -MF ldso/ldso/mips/.resolve.oS.dep -D__ASSEMBLER__ -Wa,--noexecstack
Created attachment 18136 [details] ldso.Os.i preprocessed file This file is the preprocessed file which causes problems.
Does -fno-ipa-cp fix it?
Btw, with a cross I cannot seem to reproduce the problem. How do non-inlined calls look like with mips?
(In reply to comment #2) > Does -fno-ipa-cp fix it? > Unfortunately, no the problem is still there event with -fno-ipa-cp.
(In reply to comment #3) > Btw, with a cross I cannot seem to reproduce the problem. How do non-inlined > calls look like with mips? > Let me attach a file showing how it looks like.
Created attachment 18295 [details] ldso.Os.i preprocessed file with non-inlined syscalls
Ping ? Anything else I should provide ? The bug is still present with gcc-4.4.1
(In reply to comment #7) > Ping ? Anything else I should provide ? The bug is still present with gcc-4.4.1 > The bug is now solved with Dan's uClibc patch to prevent some registers to be clobberd in syscalls.(In reply to comment #7) > Ping ? Anything else I should provide ? The bug is still present with gcc-4.4.1 > The bug is fixed with the following patch : http://lists.uclibc.org/pipermail/uclibc/2009-September/043020.html