Library problem installing Xilinx: ELF file OS ABI invalid

Installing and maintaining the FreeBSD Ports Collection or FreeBSD Packages (i.e. third party software).

Library problem installing Xilinx: ELF file OS ABI invalid

Postby caesius » 15 Sep 2010, 07:32

I am following the FreeBSD wiki instructions for installing Xilinx ISE form here.

When I try to execute xinfo or xsetup I get the error:

Code: Select all
> ./bin/lin/xinfo
/usr/home/benjamin/Desktop/xilinx/bin/lin/_xinfo: error while loading shared libraries: /usr/X11R6/lib/libXrender.so.1: ELF file OS ABI invalid


Code: Select all
> ./bin/lin/xsetup
/usr/home/benjamin/Desktop/xilinx/bin/lin/_xsetup: error while loading shared libraries: /usr/X11R6/lib/libX11.so.6: ELF file OS ABI invalid
>


I obviously have x11/libX11 installed. What is this error referring to? Is it something to do with brandelf?

Cheers, Benjamin
caesius
Member
 
Posts: 277
Joined: 16 Nov 2008, 03:23
Location: New Zealand

Postby SIFE » 15 Sep 2010, 10:23

trt to look in linux emulation folder for libX11.so.6, libXrender.so.1 and the from console :
Code: Select all
brandelf -t Linux libX11.so.6
brandelf -t LinuxlibXrender.so.1
SIFE
Member
 
Posts: 472
Joined: 02 Feb 2009, 20:00
Location: When ever where ever

Postby caesius » 16 Sep 2010, 21:06

Thanks, yes I've already tried brandelf'ing things. It made no difference.

Why is it trying to use [FILE]/usr/X11R6/lib/[/FILE]? Shouldn't it be looking in [FILE]/compat/usr/local[/FILE]?
caesius
Member
 
Posts: 277
Joined: 16 Nov 2008, 03:23
Location: New Zealand

Postby SIFE » 15 Nov 2010, 14:00

I have the some problem and question of you.
SIFE
Member
 
Posts: 472
Joined: 02 Feb 2009, 20:00
Location: When ever where ever

Postby cederom » 18 Jun 2011, 23:43

I had the same problem. I will try to describe how to solve it.. maybe it will be a good source for Wojtek's wiki page update :-)

One thing before we start - Linux emulation on FreeBSD uses [file]/usr/compat/linux[/file] as the root directory of the emulated Linux system, so all Linux dynamic libraries are referenced to that place (just as chroot) therefore if you need to edit [file]ld.so.conf[/file] or similar, remember to pass directories without heading [file]/usr/compat/linux[/file] and pass MANDATORY [file]-r /usr/compat/linux[/file] to [FILE]/usr/compat/linux/sbin/ldconfig[/FILE].

I am working on a version Xilinx_ISE_DS_13.1_O.40d.1.1. There is a [file]lib/lin[/file] subdirectory on top of the installation tarball. Copy its content into [file]/usr/compat/linux/usr/lib/xilinx[/file] and then append the line [file]/usr/lib/xilinx[/file] into [file]/etc/ld.so.conf[/file], or write that line into a new file [file]/usr/compat/linux/etc/ld.so.conf.d/xilinx.conf[/file]. This will provide some libraries necessary to run [FILE]xilinx[/FILE] binaries for Linux. Although [FILE]xilinx[/FILE] developers provided all dynamic libraries required for binaries to work, the do not anymore, so we need to add them manually...

To refresh the dynamic library cache for Linux run [cmd=]/usr/compat/linux/sbin/ldconfig -r /usr/compat/linux -i[/cmd] Remember to make a backup of that file first - it may come handy to restore/compare dynamic configuration when something goes wrong.

The problem mentioned in this thread about [file]/usr/X11R6/lib/libX11.so.6[/file] can be solved relatively easy - as this library is available in [file]/usr/lib[/file] (looking from linux-emulation perspective) and the [file]/usr/X11R6/lib[/file] is empty, simply create a symlink that will provide a library at the reuqired location: [cmd=]ln -s /usr/compat/linux/usr/lib /usr/compat/linux/usr/X11R6/lib[/cmd] (how did the [FILE]xilinx[/FILE] developers build the binary that it looks for a dyamic library only in a specific location totally ignoring its existence in other valid location?!). At this point [FILE]xilinx[/FILE] should not complain about [FILE]libX11.so.6[/FILE].

But it will still complain about
Code: Select all
/usr/X11R6/lib/libgthread-2.0.so.0: ELF file OS ABI invalid
and later
Code: Select all
/usr/X11R6/lib/libglib-2.0.so.0: ELF file OS ABI invalid
Those files are located in [file]/usr/compat/linux/lib[/file], so create symlinks of those files where [FILE]xilinx[/FILE] binaries want to have them and this will make Xilinx ISE work :-)

Why those Linux [FILE]xilinx[/FILE] binaries need to have dynamic libraries at a specific location, although they are available in other valid locations?

Example patching script, started from [FILE]xilinx[/FILE] [FILE]ise[/FILE] installation directory, can look as follows:
Code: Select all
#!/bin/sh
mkdir /usr/compat/linux/usr/lib/xilinx
cp lib/lin/* /usr/compat/linux/usr/lib/xilinx/
echo "/usr/compat/linux/usr/lib/xilinx" >> /usr/compat/linux/etc/ld.so.conf.d/xilinx.conf
mv /usr/compat/linux/usr/X11R6/lib /usr/compat/linux/usr/X11R6/lib_orig
echo "/usr/compat/linux/usr/X11R6/lib_orig" >> /usr/compat/linux/etc/ld.so.conf.d/x11r6_orig.conf
ln -s /usr/compat/linux/usr/lib /usr/compat/linux/usr/X11R6/lib
ln -s /usr/compat/linux/lib/libgthread-2.0.so.0 /usr/compat/linux/usr/X11R6/lib/libgthread-2.0.so.0
ln -s /usr/compat/linux/lib/libglib-2.0.so.0 /usr/compat/linux/usr/X11R6/lib/libglib-2.0.so.0


Maybe the script can be simpler and only link necessary files, but there will be much more of them located either in [file]/usr/compat/linux/lib[/file] or [file]/usr/compat/linux/usr/lib[/file] so I have decided to simply link the whole directory.

Good luck! :-)
cederom
Junior Member
 
Posts: 10
Joined: 29 Mar 2009, 21:44

Postby caesius » 19 Jun 2011, 00:30

Thanks for that info cederom, I'll give it another shot once I start doing HDL again next semester. I recall trying to get the Linux version of Xilinx going at a place I was working and I ended up having to delete the X11 libraries it supplied and force it to use the system's.

Would be great to have robust and stable HDL tools on FreeBSD :\
caesius
Member
 
Posts: 277
Joined: 16 Nov 2008, 03:23
Location: New Zealand

Postby cederom » 19 Jun 2011, 09:28

Yeah, it's working fine. The libraries are on the system but in a different place than the binary expects, so simply they need to be linked. It has nothing to do with binary branding. It's about location :-) I will send an update soon on installing cable drivers, as this part failed for me at the end of installation and I have a USB Platform cable and a Spartan 3A-DSP develkit to test it on.

You can also try open source GHDL: http://ghdl.free.fr/ - there is no port yet for this software, I will prepare one after my diploma thesis is ready (around October).
cederom
Junior Member
 
Posts: 10
Joined: 29 Mar 2009, 21:44


Return to Installation and Maintenance of FreeBSD Ports or Packages

Who is online

Users browsing this forum: martino and 3 guests