Welcome to FreeBSDFreaks.net!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Linux compatibility: is it possible to link freebsd code t..

 
   FreeBSD Hosting (Home) -> FreeBSD vs Linux RSS
Next:  NYC LOCAL: Tuesday 10 August 2004 Lisp NYC: Gnume..  
Author Message
Olivier Boudry

External


Since: Aug 12, 2004
Posts: 1



(Msg. 1) Posted: Thu Aug 12, 2004 12:26 am
Post subject: Linux compatibility: is it possible to link freebsd code to a linux library?
Archived from groups: comp>unix>bsd>freebsd>misc (more info?)

Hello,

Linux compatibility works fine to run linux binaries, but I'm
wondering if it's possible to compile code on FreeBSD and link it to a
linux library?

I want to compile SAP-Rfc, a perl module, to perform RFC to an SAP
server. The code must be linked to librfc.a, a library I can get only
in binary format for linux (no source available).

When I try to compile it I get the following error:
> make
cp lib/SAP/Config.pm blib/lib/SAP/Config.pm
cp Rfc.pm blib/lib/SAP/Rfc.pm
cp Iface.pm blib/lib/SAP/Iface.pm
/usr/local/bin/perl /usr/local/lib/perl5/5.8.5/ExtUtils/xsubpp
-typemap /usr/local/lib/perl5/5.8.5/ExtUtils/typemap Rfc.xs > Rfc.xsc
&& mv Rfc.xsc Rfc.c
cc -c -I/usr/sap/rfcsdk/include
-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.5/BSDPAN" -DHAS_FPSETMASK
-DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -I/usr/local/include
-O -pipe -DVERSION=\"1.32\" -DXS_VERSION=\"1.32\" -DPIC -fPIC
"-I/usr/local/lib/perl5/5.8.5/mach/CORE" -DSUMITELSE Rfc.c
Running Mkbootstrap for SAP::Rfc ()
chmod 644 Rfc.bs
rm -f blib/arch/auto/SAP/Rfc/Rfc.so
LD_RUN_PATH="/compat/linux/lib" cc -shared -L/usr/local/lib Rfc.o
-o blib/arch/auto/SAP/Rfc/Rfc.so -L/compat/linux/lib -lm -ldl
-lpthread -L/usr/sap/rfcsdk/lib -lrfc
/usr/libexec/elf/ld: cannot find -ldl
*** Error code 1

I added /compat/linux/lib to the library search path. The library is
found at configuration time, but not at link time.

So my first questions is: Is it possible to compile code on FreeBSD
and link it to a precompiled linux library.

And the second question: If yes, is there something I can do so ld
finds the needed libld and libpthread needed by librfc.a?

Best regards,

Olivier Boudry.

 >> Stay informed about: Linux compatibility: is it possible to link freebsd code t.. 
Back to top
Login to vote
Steve O'Hara-Smith

External


Since: Sep 10, 2003
Posts: 42



(Msg. 2) Posted: Thu Aug 12, 2004 1:43 pm
Post subject: Re: Linux compatibility: is it possible to link freebsd code to a [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 12 Aug 2004 00:26:34 -0700
(Olivier Boudry) wrote:

> Hello,
>
> Linux compatibility works fine to run linux binaries, but I'm
> wondering if it's possible to compile code on FreeBSD and link it to a
> linux library?

From /usr/ports/devel/linux-devtools/pkg-descr

The linux_devtools port contains a selection of packages necessary
for doing development in Linux mode.

--
C:>WIN | Directable Mirror Arrays
The computer obeys and wins. | A better way to focus the sun
You lose and Bill collects. | licences available see
| http://www.sohara.org/

 >> Stay informed about: Linux compatibility: is it possible to link freebsd code t.. 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Linux and FreeBSD Compatibility - Hello all, I wanted to know how is the compatibility of Linux and FreeBSD ?? Can i run the software on linux if i have the code which was developed using FreeBSD ?? What are the advantages of FreeBSD over linux ?? Any kind of help will be appreciated ...

Linux Compatibility - Hi I have a freeBSD 5.2-CURRENT version running on a intel dual processor machine. I need to turn the LINUX COMPATBILITY ON, but unfortunately the source code for this version is not on the system. If I do a sysinstall to obtain the source code, the....

Linux compatibility ? - Hello all, I am trying to compile a Linux program but have many issues with it. I tried to install linux_base to avoid some problems but this doesn't seem to help at all or maybe I should tell the compiler what libs to use (dunno how to that btw). Here...

Linux compatibility - Hi, How is linux compatibility in freebsd ? Can we really run all linux application, including linux games, in freebsd ? Thanks :)

Enabling linux compatibility - When I installed my system, it asked if I wanted to enable linux compatibility, and I said no. Now I think I may need it, and am wondering if I need to do anything special to enable it, other than setting linux_enable="YES" in /etc/rc.conf....
   FreeBSD Hosting (Home) -> FreeBSD vs Linux All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]