Hello all,

As it turned out, uncommenting the "!STATIC" condition in
include/libc-symbols.h breaks the "libc_hidden_proto()" for config_read().
I'm building busybox with its own version of config_read() and resolver gets
linked with the busybox version. It's the same issue as
http://lists.uclibc.org/pipermail/uclibc/2010-November/044488.html

Anyone willing to help? How can build linuxthreads.old in static configuration
so that the errno could be correctly initialized?

Thanks in advance.
Regards,
Sergei

On Sun, 17 Mar 2013 14:58:53 +0400
Sergei Poselenov <sposele...@emcraft.com> wrote:

> Sorry, I celebrated too early. Adding "errno.h" to  libc_pthread_init.c
> just makes the warning to go away, but errno is still not referenced
> correctly from threads.
> 
> So I have to uncomment the "!STATIC" condition in
> include/libc-symbols.h.
> 
> Any comments appreciated.
> 
> Regards,
> Sergei
> 
> On Вс., 2013-03-17 at 14:46 +0400, Sergei Poselenov wrote:
> > OK, got it fixed:
> > 
> > --- a/libpthread/linuxthreads.old/libc_pthread_init.c
> > +++ b/libpthread/linuxthreads.old/libc_pthread_init.c
> > @@ -21,6 +21,7 @@
> >  #include <locale.h>
> >  #include <stdlib.h>
> >  #include <string.h>
> > +#include <errno.h>
> >  
> >  /* see comment in forward.c */
> >  #define GCC_RENAME_BUG 1
> > 
> > 
> > Regards,
> > Sergei
> > 
> > On Вс., 2013-03-17 at 12:34 +0400, Sergei Poselenov wrote:
> > > Hello all,
> > > 
> > > Update, see below.
> > > 
> > > On Пт., 2013-03-15 at 20:51 +0400, Sergei Poselenov wrote:
> > > > Hello all,
> > > > 
> > > > I was hit by a nasty bug in the 0.9.33.2. It shows itself as that in
> > > > the thread context, any syscall ended with error always sets errno as
> > > > zero. For the main() context, errno is set correctly.
> > > > 
> > > > Configuration details:
> > > >  - Target is ARM Cortex-M3, uClibc builds as "make ARCH_CFLAGS=
> > > > 'CPU_CFLAGS=-mthumb -march=armv7 -mfix-cortex-m3-ldrd'"
> > > >  - Toolchain - CodeSourcery arm-2010q1, arm-uclinuxeabi.
> > > >  - uClibc-0.9.33.2 with the following main configuration options
> > > > defined: TARGET_arm
> > > > TARGET_ARCH="arm"
> > > > FORCE_OPTIONS_FOR_ARCH=y
> > > > CONFIG_ARM_EABI=y
> > > > COMPILE_IN_THUMB_MODE=y
> > > > USE_BX=y
> > > > LINUXTHREADS_OLD=y                                            
> > > > UCLIBC_HAS_THREADS=y
> > > > PTHREADS_DEBUG_SUPPORT=y
> > > > # ARCH_HAS_MMU is not set
> > > The key factor is turned to be this:
> > > ARCH_HAS_NO_SHARED=y
> > > 
> > > It adds -DSTATIC=1 to CFLAGS.
> > > 
> > > > 
> > > > It took me a while to notice that among (a lot of) others, compiler
> > > > throwed out the warning:
> > > > 
> > > > arm-uclinuxeabi-gcc -c
> > > > libpthread/linuxthreads.old/libc_pthread_init.c ...
> > > > 
> > > > In file included from ./include/errno.h:36,
> > > >                  from ./include/bits/syscalls.h:31,
> > > >                  from ./include/sys/syscall.h:34,
> > > >                  from 
> > > > ./libpthread/linuxthreads.old/sysdeps/arm/pt-machine.h:26,
> > > >                  from libpthread/linuxthreads.old/internals.h:30,
> > > >                  from
> > > > libpthread/linuxthreads.old/libc_pthread_init.c:35: 
> > > > ./include/bits/errno.h:46:
> > > > warning: asm declaration ignored due to conflict with previous rename
> > > > 
> > > > It all boiled down to the following commit which breaks my uClibc:
> > > > 
> > > > commit 6e97c25777a5da804fa5989c3ef8bebb1734b969
> > > > Author: Mike Frysinger <vap...@gentoo.org>
> > > > Date:   Mon Jun 19 03:43:20 2006 +0000
> > > > 
> > > >     use internal aliases for static objects as well
> > > > 
> > > > diff --git a/include/libc-symbols.h b/include/libc-symbols.h
> > > > index ef1e217..ec3696b 100644
> > > > --- a/include/libc-symbols.h
> > > > +++ b/include/libc-symbols.h
> > > > @@ -420,7 +420,7 @@
> > > >  # define __hidden_proto_hiddenattr(attrs...)
> > > >  #endif
> > > >  
> > > > -#if !defined STATIC && !defined __BCC__
> > > > +#if /*!defined STATIC &&*/ !defined __BCC__
> > > >  # ifndef __ASSEMBLER__
> > > >  #  define hidden_proto(name, attrs...) __hidden_proto (name,
> > > > __GI_##name, ##attrs) #  define __hidden_proto(name, internal,
> > > > attrs...) \
> > > > 
> > > > That was pretty long time ago for the bug to come unnoticed, so I guess
> > > > something wrong on my side.
> > > > 
> > > Well, now I think otherwise. The above hack broke off the linuxthreads
> > > (linuxthreads.old at least) for ARCH_HAS_NO_SHARED.
> > > 
> > > > Could someone please comment what could it be?
> > > Yes, please.
> > > 
> > > Regards,
> > > Sergei
> > > 
> > > > Thanks in advance.
> > > > 
> > > > Regards,
> > > > Sergei Poselenov
> > > 
> > > 
> > 
> > 
> > _______________________________________________
> > uClibc mailing list
> > uClibc@uclibc.org
> > http://lists.busybox.net/mailman/listinfo/uclibc
> 
> 



-- 
Emcraft Systems - uClinux for Cortex-M MCUs | www.emcraft.com | s...@emcraft.com

_______________________________________________
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc

Reply via email to