Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 Mar 2009 14:47:19 -0700
From:      Julian Elischer <julian@elischer.org>
To:        "Shaowei Wang (wsw)" <wsw1wsw2@gmail.com>
Cc:        Srinivas Ganji <srinivasganji@gmail.com>, freebsd-hackers@freebsd.org
Subject:   Re: Is it possible to use the libthr.a file on a Redhat Linux?
Message-ID:  <49D28F67.7010802@elischer.org>
In-Reply-To: <2e566b9e0903310239x15b53d1av2f45453cb35a8898@mail.gmail.com>
References:  <fc5047010903310140u2952cfdfo27c97e9cc59a6c7b@mail.gmail.com> <2e566b9e0903310239x15b53d1av2f45453cb35a8898@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Shaowei Wang (wsw) wrote:
> On Tue, Mar 31, 2009 at 4:40 PM, Srinivas Ganji <srinivasganji@gmail.com>wrote:
> 
>> Dear All,
>>
>> I have tried to use the libthr.a library for compiling an application which
>> is working fine on Redhat system with libpthread library. However, I end up
>> with the following errors.
>>
>>
>>
>> ../lib/linux/libthr.a(thr_sem.o): In function `_sem_init':
>>
>> thr_sem.c:(.text+0x100): undefined reference to `ksem_init'
>>
>> thr_sem.c:(.text+0x115): undefined reference to `ksem_destroy'
>>
>> ../lib/linux/libthr.a(thr_sem.o): In function `_sem_destroy':
>>
>> thr_sem.c:(.text+0x216): undefined reference to `ksem_destroy'
>>
>> ../lib/linux/libthr.a(thr_sem.o): In function `_sem_timedwait':
>>
>> thr_sem.c:(.text+0x2ad): undefined reference to `ksem_timedwait'
>>
>> ../lib/linux/libthr.a(thr_sem.o): In function `_sem_wait':
>>
>> ....
>>
>> ....
>>
>> ....
>>
>>
>>
>> collect2: ld returned 1 exit status
>>
>> make: *** [target] Error 1
>>
>>
>>
>> So, I have also mentioned the libc.so.7(This is also a FreeBSD libc
>>
>> library) library in our application to remove the above undefined
>> references. So, at that time I got the following errors.
>>
>>
>>
>> /usr/bin/ld: errno@@FBSD_1.0: TLS definition in /lib/libc.so.6 section
>> .tbss
>> mismatches non-TLS definition in ../lib/linux/libc.so section .bss
>>
>> /lib/libc.so.6: could not read symbols: Bad value
>>
>>
>>
>> Here, the lib/libc.so.6 is a Redhat libc library where as
>> ../lib/linux/libc.so is a FreeBSD library (libc.so.7).
>>
>>
>>
>> My question is: Is it possible to use the FreeBSD libthr.a library on a
>> Redhat Linux distribution?
>>
> 
> As I known, it's not possible unless you port the libthr to Linux system.
> 
> Linux use clone() system call to implement thread library and FreeBSD use a
> different way(KSE).

no, KSE was an experimental system that was removed..
FreeBSD threads are created using the thr_create() call

There is some siliarity to the way that libthr and linux make threads
as they are both 1:1 models.

> 
> 
>>
>>
>> Thanks in advance.
>>
>>
>>
>> With Regards,
>>
>> Srinivas G
>> _______________________________________________
>> freebsd-hackers@freebsd.org mailing list
>> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
>> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
>>
> _______________________________________________
> freebsd-hackers@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?49D28F67.7010802>