[Clfs-support] Compilation error for SPARC v9 Multilib (32-bit glibc)

Berkin Ozisikyilmaz boz283 at ece.northwestern.edu
Mon Jan 21 12:09:53 PST 2008


boz283 wrote:
>
> At section 5.9 of SPARC Cross-Compiled Linux From Scratch - Version
> SVN-20080119-Sparc64-Multilib
>
> http://cross-lfs.org/view/svn/sparc64/cross-tools/glibc.html
>
> When I say make, I get the following error. I have googled for it, and
> I didn’t find any error. I looked at the code and deleted “1” from one
> of the parameters. But then I got to the second error which is shown
> under =====.
>
>  
>
>  
>
> /clfs/sources/glibc-build/nptl/pthread_cond_signal.o.dt -MT
> /home/sparc/clfs/sources/glibc-build/nptl/pthread_cond_signal.o
>
> pthread_cond_signal.c:51:19: error: macro "lll_futex_wake_unlock"
> passed 5 arguments, but takes just 4
>
> pthread_cond_signal.c: In function '__pthread_cond_signal':
>
> pthread_cond_signal.c:49: error: 'lll_futex_wake_unlock' undeclared
> (first use in this function)
>
> pthread_cond_signal.c:49: error: (Each undeclared identifier is
> reported only once
>
> pthread_cond_signal.c:49: error: for each function it appears in.)
>
> make[2]: ***
> [/home/sparc/clfs/sources/glibc-build/nptl/pthread_cond_signal.o] Error 1
>
> make[2]: Leaving directory `/home/sparc/clfs/sources/glibc-2.7/nptl'
>
> make[1]: *** [nptl/subdir_lib] Error 2
>
> make[1]: Leaving directory `/home/sparc/clfs/sources/glibc-2.7'
>
> make: *** [all] Error 2
>
>
I have looked in to the code above and the way i have modigied the
pthread_cond_signal.c seems to be incorrect.

The lll_futex_wake_unlock is defined at
nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h as
#ifdef __sparc32_atomic_do_lock
/* Avoid FUTEX_WAKE_OP if supporting pre-v9 CPUs.  */
# define lll_futex_wake_unlock(futexp, nr_wake, nr_wake2, futexp2) 1
#else
# define lll_futex_wake_unlock(futexp, nr_wake, nr_wake2, futexp2,
private) \


So it seems that for the 32bit sparc this function returns always 1.
However there is no ifdef statement in pthread_cond_signal.c, that
changes the number of parameters this function is called.
The compiler description says that "You may use |__builtin_expect| to
provide the compiler with branch prediction information." So knowing
that when I am compiling 32bit glibc for the multilib, I think I can
change either this file or the lowlevellock.h accordingly.
      if (! __builtin_expect (lll_futex_wake_unlock
(&cond->__data.__futex, 1,
                                                     1,
&cond->__data.__lock,
                                                     pshared), 0))
        return 0;
      lll_futex_wake (&cond->__data.__futex, 1, pshared);


Are my assumptions correct? Or is there a patch that can be applied?

Berkin



More information about the Clfs-support mailing list