Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

Text relocations with IPP merged libraries

fk
Beginner
452 Views
Hello,

Apologies for cross posting, I replied to this post (http://software.intel.com/en-us/forums/showthread.php?t=56758#52320) by mistake and now I can't delete it.

We have a similar problem here. We are building a shared library linked against the following:

IPPLibs = ['ippiemerged', 'ippcvemerged', 'ippsemerged', 'ippccemerged', 'ippmemerged', 'ippimerged', 'ippcvmerged', 'ippsmerged', 'ippccmerged', 'ippmmerged', 'ippcore']

However eu-findtextrel return a whole list of problems of the following type:
"the file containing the function 'ippiAdd_8u_C1IRSfs' is not compiled with -fpic/-fPIC"
etc.

SELinux then will not allow our .so to be loaded at runtime.

Is this a problem with the way the ipp merged libraries were compiled or something I am doing wrong?
If its any use we found we had to use -fpic and also define PIC (-DPIC) when compiling our other libraries (using gcc).

Regards,
Francis.
0 Kudos
6 Replies
Vladimir_Dudnik
Employee
452 Views

Hi Francis,

did you notice that we provide both variants (PIC and non-PIC) for IPP static libraries? Please see nonpic subfolder in lib folder.

Regards,
Vladimir

0 Kudos
fk
Beginner
452 Views
Hi Vladimir,

Yes I did notice that. I tried setting the library path to
"-L /opt/intel/ipp/5.3.1.062/ia32/lib/nonpic" but unfortunately to no avail. Again if I run eu-findtextrel on the .so that I build it outputs pages of results stating "the file containing the function *** is not compiled with -fpic/-fPIC" where all the *** are ipp functions.

Thanks,
Francis.
0 Kudos
Vladimir_Dudnik
Employee
452 Views

could you please provide OS version and ld command line you use?

Vladimir

0 Kudos
fk
Beginner
452 Views
Hi Vladimir,

The OS is Fedora Core 8, version 2.6.23.9-85.fc8
The gcc version is: gcc version 4.1.2 20070925 (Red Hat 4.1.2-33)
We use scons for our build managment. Here is the command used to build our IPP shared library:

g++ -o BuildProducts/Release/MediaIO_build/GPPIPAPI_IPP/libGPPIPAPI_IPP.so -L/opt/intel/ipp/5.3.1.062/ia32/lib -shared BuildProducts/Release/MediaIO_build/GPPIPAPI_IPP/IPPConversion.os BuildProducts/Release/MediaIO_build/GPPIPAPI_IPP/GPPIPAPI_IPP_fourier.os BuildProducts/Release/MediaIO_build/GPPIPAPI_IPP/GPPIPAPIFuncs.os BuildProducts/Release/MediaIO_build/GPPIPAPI_IPP/GPPIPAPI_IPP.os -LThirdParty/i686 -LBuildProducts/GPP -LThirdParty -lVideoFrame -lVideoFileIO -lVideoFrame -lGPPSystem -lDeInterlacer -lbz2 -ltiff -lz -ljpeg -lippiemerged -lippcvemerged -lippsemerged -lippccemerged -lippmemerged -lippimerged -lippcvmerged -lippsmerged -lippccmerged -lippmmerged -lippcore

Thanks,
Francis
0 Kudos
Pavel_B_Intel1
Employee
452 Views

Hi!

I've built thecustom shared library from IPP libraries without any problesm:

ld -shared -zdefs -o libtest.so library.script lib/libippvcemerged.a lib/libippvcmerged.a lib/libippacemerged.a lib/libippacmerged.a lib/libippjemerged.a lib/libippjmerged.a lib/libippdcemerged.a lib/libippdcmerged.a lib/libippccemerged.a lib/libippccmerged.a lib/libippcpemerged.a lib/libippcpmerged.a lib/libippscemerged.a lib/libippscmerged.a lib/libippsremerged.a lib/libippsrmerged.a lib/libippvmemerged.a lib/libippvmmerged.a lib/libippchemerged.a lib/libippchmerged.a lib/libippremerged.a lib/libipprmerged.a lib/libippmemerged.a lib/libippmmerged.a lib/libippcvemerged.a lib/libippcvmerged.a lib/libippiemerged.a lib/libippimerged.a lib/libippsemerged.a lib/libippsmerged.a lib/libippcore.a -L/usr/lib/gcc/i386-redhat-linux/4.1.2 -lgcc -lm -lc

OS:

Fedora release 8 (Werewolf)
Linux2.6.23.1-42.fc8 #1 SMP Tue Oct 30 13:55:12 EDT 2007 i686 i686 i386 GNU/Linux

GCC:

gcc (GCC) 4.1.2 20070925 (Red Hat 4.1.2-33)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

LD:

GNU ld version 2.17.50.0.18-1 20070731
Copyright 2007 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.

Note: it is very important to point libraries in link string in right order because ld has only 1 pass and can resolve symbols only from left to right. For you the right order:

-lippcvemerged -lippcvmerged -lippccemerged -lippccmerged -lippiemerged -lippimerged -lippmemerged -lippmmerged -lippsemerged -lippsmerged-lippcore

Please try to point the IPP libraries in such order and do you use the IA32 OS?

Pavel

0 Kudos
fk
Beginner
452 Views
Hi Pavel,

I'm not sure if you read my previous posts or not. The problem is not in trying to build the shared library, I can do that without error. The problem is that if I use the static libraries in either "-L/opt/intel/ipp/5.3.1.062/ia32/lib/" or "-L /opt/intel/ipp/5.3.1.062/ia32/lib/nonpic" I get a shared library which has text relocations. SELinux then does not allow this to be loaded. And yes I am using IA32 OS.

Francis.
0 Kudos
Reply