This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: pthread_barrier_wait help
- From: "Ryan S. Arnold" <ryan dot arnold at gmail dot com>
- To: vijay nag <vijunag at gmail dot com>
- Cc: Jagadish Kotra <jagadishkotra at gmail dot com>, "libc-help at sourceware dot org" <libc-help at sourceware dot org>
- Date: Sat, 17 Aug 2013 08:49:47 -0500
- Subject: Re: pthread_barrier_wait help
- References: <520BED4E dot 9060301 at gmail dot com> <520EECF9 dot 2000406 at gmail dot com> <CAKhyrx8KWjbDhRDaL9g8LFhMqk1z6s-=ygQzt7DKWcd4fEJUqQ at mail dot gmail dot com> <CAKhyrx-Sha5-s0D94zDV_z1s+ADFhmg4isy9d6s1ZdphSjX33w at mail dot gmail dot com>
On Sat, Aug 17, 2013 at 2:23 AM, vijay nag <vijunag@gmail.com> wrote:
> On Saturday, August 17, 2013, Jagadish_gmail <jagadishkotra@gmail.com> wrote:
>> Hello,
>>
>> I have installed glibc using the following command ..
>>
>> I have added my new function pthread_barrier_wait_jag()
>>
>> bash$pwd
>> /home/jbk5155/glibc/glibc-build/
>> bash$../glibc-2.15/configure --prefix=/home/jbk5155/glibc/glibc-build/ --enable-addon=pthread
>> ......
>> ......
>> .....
>> <configure successful>
>> bash$sudo make
>> <make was successful>
>> bash$sudo make install
>> <make install was successful>
>>
>> I see my function being listed with nm command listed below ..
>>
>> nm libpthread.so.0 | grep "jag"
>>
>> but when I try to compile my testcase with -L/home/jbk5155/glibc/glibc-build/ -lpthread ... testcase compiled successfully but when I do a ldd I still see the default libpthread.so.0 is being picked up
>>
>> jbk5155@jbk5155:~/splash/codes/kernels/fft$ ldd FFT
>> linux-gate.so.1 => (0xb7741000)
>> libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xb7712000)
>> libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xb76e6000)
>> libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb753b000)
>> /lib/ld-linux.so.2 (0xb7742000)
>>
>> and hence when I run it my testcase crashes saying pthread_barrier_wait_jag() is not found. Can you please let me know what I am doing wrong?
>>
>> Thanks and Regards,
>> Jagadish.
>>
>> -------- Original Message --------
>> Subject: pthread_barrier_wait help
>> Date: Wed, 14 Aug 2013 13:49:18 -0700
>> From: Jagadish_gmail <jagadishkotra@gmail.com>
>> To: libc-help@sourceware.org
>>
>>
>>
>> Hello,
>>
>> I am a graduate student and I am looking for some help with glibc. I
>> am working on a project where I am trying to modify
>> pthread_barrier_wait.c() code. I see that the hand-optimized
>> pthread_barrier_wait.S (assembler version) is currently being used as I
>> am on X86 architecture.
>>
>> I want my build scripts to use the generic pthread_barrier_wait.c
>> instead of the hand-optimized pthread_barrier_wait.S.
>>
>> Can you please let me know what changes do I need to make to use this c
>> version of the code instead of the hand-optimized assembler version ?
>>
>> Thanks and Regards,
>> Jagadish
>>
>>
> Try removing absolute path in the linker script libpthread.so. Ld is
> most probably picking library from host machine rather than from your
> custom libc ?
Vijay is right. The correct way to test this is to use the dynamic
linker from your new build to invoke your application, for example:
/home/jagadish/glibc-build/elf/ld.so.1 --library-path
/home/jagadish/glibc-build/:/home/jagadish/glibc-build/nptl:<more
paths to the temp glibc build> ./application
Ryan