Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 May 2002 17:13:37 -0700
From:      tlb@trevorblackwell.com
To:        freebsd-questions@FreeBSD.ORG
Subject:   Re: linking commercial linux library 
Message-ID:  <200205290013.g4T0Dcd48186@tlb.blackwells.net>
In-Reply-To: Your message of "Tue, 28 May 2002 14:31:26 PDT."

next in thread | raw e-mail | index | archive | help

I got it to work by chainsawing out the version information:

   objcopy -R .gnu.version Linux/libisense.so Freebsd/libisense.so

then it happily linked against the unversioned functions in libc.


> I have a commercial library (without source) compiled for Linux that I
> want to use in a FreeBSD application. It refers to symbols with a
> version node of GLIBC_2.0:
> 
>   Linux/libisense.so: undefined reference to `strcpy@GLIBC_2.0'
> 
> I could link my entire application against glibc and the Linux
> libraries, but because I make subtle use of some regular BSD
> libraries, I don't want to do this. It should be able to use the BSD
> versions of everything it needs.
> 
> I tried various linking with:
> 
>   --defsym 'strcpy@GLIBC_2.0=strcpy'
> 
> to make it use the regular libc functions, but ld gives a syntax error
> on the @. I've been able to make an assembler file that defines the
> function, but I can't seem to refer to the original libc functions
> from it.
> 
> Any suggestions? I would consider using glibc versions of just the
> offending functions if I could avoid it getting used anywhere else.

--
Trevor Blackwell       tlb@trevorblackwell.com        (650) 776-7870


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




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