<div dir="ltr"><div dir="ltr"><div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">Le mar. 11 sept. 2018 à 16:10, <<a href="mailto:world@masterdevops.eu">world@masterdevops.eu</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
thank you for your reply. I could solve the problem. The part I didn't <br>
knew was that static libraries also needed to be compiled with -fPIC. <br>
I've found a good summary of this topic at <br>
<a href="https://lists.debian.org/debian-devel/2016/05/msg00309.html" rel="noreferrer" target="_blank">https://lists.debian.org/debian-devel/2016/05/msg00309.html</a><br>
I want to share it for those, who also stumble upon this problem.<br></blockquote><div><br></div><div><br></div><div>And for project using CMake as build system one can use, POSITION_INDEPENDENT_CODE</div><div>target property:</div><div><a href="https://cmake.org/cmake/help/latest/prop_tgt/POSITION_INDEPENDENT_CODE.html#prop_tgt:POSITION_INDEPENDENT_CODE">https://cmake.org/cmake/help/latest/prop_tgt/POSITION_INDEPENDENT_CODE.html#prop_tgt:POSITION_INDEPENDENT_CODE</a></div><div>or globally:</div><div><a href="https://cmake.org/cmake/help/latest/variable/CMAKE_POSITION_INDEPENDENT_CODE.html#variable:CMAKE_POSITION_INDEPENDENT_CODE">https://cmake.org/cmake/help/latest/variable/CMAKE_POSITION_INDEPENDENT_CODE.html#variable:CMAKE_POSITION_INDEPENDENT_CODE</a><br></div><div><br></div><div>in order to enable such flags.</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<br>
On 2018-09-11 13:47, Rolf Eike Beer wrote:<br>
> <a href="mailto:world@masterdevops.eu" target="_blank">world@masterdevops.eu</a> wrote:<br>
>> Hi,<br>
>> <br>
>> I am trying to compile the project libgd<br>
>> (<a href="https://github.com/libgd/libgd" rel="noreferrer" target="_blank">https://github.com/libgd/libgd</a>) with the option ENABLE_JPEG enabled.<br>
>> <br>
>> I.e. first I downloaded the source code of libjpeg-turbo from<br>
>> <a href="https://sourceforge.net/projects/libjpeg-turbo/files/2.0.0/" rel="noreferrer" target="_blank">https://sourceforge.net/projects/libjpeg-turbo/files/2.0.0/</a>, compiled <br>
>> it<br>
> <br>
> You need to make sure that this compile includes -fPIC in the <br>
> compileflags of<br>
> libjpeg.<br>
> <br>
>> But I get several errors like this one:<br>
>> > /usr/bin/ld: .../libjpeg-turbo-2.0.0/libjpeg.a(jcmainct.c.o):<br>
>> > relocation R_X86_64_32S against `.text' can not be used when making a<br>
>> > shared object; recompile with -fPIC<br>
> <br>
> As said here.<br>
> <br>
> Eike<br>
> --<br>
<br>
-- <br>
German DevPos site: <a href="https://www.masterdevops.eu" rel="noreferrer" target="_blank">https://www.masterdevops.eu</a><br>
-- <br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://cmake.org/mailman/listinfo/cmake" rel="noreferrer" target="_blank">https://cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Eric<br></div></div></div></div></div></div></div></div>