|
Hi!!! Im developing an aplication using libavcodec, libavformat and
libavutil. Im trying to make a shared library and for that I have to get libavs compiled with -fPIC ... I was trying to do it by setting --enable-pic in the configure file, however Im still have the same error: /usr/local/lib/libavcodec.a(lpc_mmx.o): relocation R_X86_64_PC32 against symbol `ff_pd_1' can not be used when making a shared object; recompile with -fPIC could somebody give me a hint please?? :) dayana _______________________________________________ Libav-user mailing list [hidden email] http://ffmpeg.org/mailman/listinfo/libav-user |
|
Dayana <dribas@...> writes:
> Im trying to make a shared library and for that I > have to get libavs compiled with -fPIC ... I was > trying to do it by setting --enable-pic in the > configure file, however Im still have the same error: > > /usr/local/lib/libavcodec.a(lpc_mmx.o) You are (still) trying to link a static library - /usr/local/lib/libavcodec.a - with a shared object compiled with -fpic which cannot work. Carl Eugen _______________________________________________ Libav-user mailing list [hidden email] http://ffmpeg.org/mailman/listinfo/libav-user |
|
In reply to this post by Dayana
On Wed, May 1, 2013 at 7:41 AM, Dayana <[hidden email]> wrote:
Hi!!! Im developing an aplication using libavcodec, libavformat and libavutil. Im trying to make a shared library and for that I have to get libavs compiled with -fPIC ... I was trying to do it by setting --enable-pic in the configure file, however Im still have the same error:
_______________________________________________ _______________________________________________ Libav-user mailing list [hidden email] http://ffmpeg.org/mailman/listinfo/libav-user |
|
On Wed, May 1, 2013 at 8:00 AM, Ratin <[hidden email]> wrote:
_______________________________________________ Libav-user mailing list [hidden email] http://ffmpeg.org/mailman/listinfo/libav-user |
|
In reply to this post by Ratin-2
Ratin <ratin3@...> writes:
> ./configure --extra-cflags="-fPIC" This is not a good idea since an equivalent option exists (that may set additional settings). Carl Eugen _______________________________________________ Libav-user mailing list [hidden email] http://ffmpeg.org/mailman/listinfo/libav-user |
|
In reply to this post by Ratin-2
On 05/01/2013 11:03 AM, Ratin wrote:
_______________________________________________ Libav-user mailing list [hidden email] http://ffmpeg.org/mailman/listinfo/libav-user |
|
In reply to this post by Carl Eugen Hoyos
On Wed, May 1, 2013 at 8:04 AM, Carl Eugen Hoyos <[hidden email]> wrote:
Ratin <ratin3@...> writes: Agreed, if the equivalent option works. _______________________________________________ Libav-user mailing list [hidden email] http://ffmpeg.org/mailman/listinfo/libav-user |
|
I tried with > ./configure
--extra-cflags="-fPIC" and I still have the same error:
/usr/local/lib/libavcodec.a(lpc_mmx.o): relocation R_X86_64_PC32 against symbol `ff_pd_1' can not be used when making a shared object; recompile with -fPIC :( On 05/01/2013 12:05 PM, Ratin wrote:
_______________________________________________ Libav-user mailing list [hidden email] http://ffmpeg.org/mailman/listinfo/libav-user |
|
In reply to this post by Dayana
On Wednesday 01 May 2013 15:41:48 Dayana wrote:
> Hi!!! Im developing an aplication using libavcodec, libavformat and > libavutil. Im trying to make a shared library and for that I have to get > libavs compiled with -fPIC ... I was trying to do it by setting > --enable-pic in the configure file, however Im still have the same error: > > /usr/local/lib/libavcodec.a(lpc_mmx.o): relocation R_X86_64_PC32 against > symbol `ff_pd_1' can not be used when making a shared object; recompile > with -fPIC If you are trying to combine several ffmpeg libraries into a single shared library as I have seen some apps try to do then you need to use the following linker flag on the final library build step. -shared -Wl,-Bsymbolic -- Gavin Kinsey AD Holdings Plc -------------------------------------------------------- This email and any files transmitted with it are CONFIDENTIAL and intended solely for the use of the individual or entity to whom they are addressed. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system; you may not copy this message or disclose its contents to anyone. The recipient should check this email and any attachments for the presence of viruses. The Company accepts no liability for any damage caused by any virus transmitted by this email. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the Company. Contact Customer Services for details [hidden email] _______________________________________________ Libav-user mailing list [hidden email] http://ffmpeg.org/mailman/listinfo/libav-user |
|
Hi Gavin!!
I set -shared -Wl,-Bsymbolic in the linker flags of my library, that depends of libavcodec, libavutil, libavformat... However when Im going to call av_register_all(); I get the same error: /usr/local/lib/libavcodec.a(lpc_mmx.o): relocation R_X86_64_PC32 against symbol `ff_pd_1' can not be used when making a shared object; recompile with -fPIC /////// I think that I have to set the flag -fPIC for compiling the libavcodec, libavutil, libavformat, so I added: enable pic , in the configure file of the ffmpeg project: # OS specific case $target_os in linux) add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 enable pic enable dv1394 Therefore when ffmpeg is compiled, libavcodec, libavutil, libavformat were compiled with -fPIC.... then when should be ok If I want to use them in my libx.so ... but It is not, I have the same error: /usr/local/lib/libavcodec.a(lpc_mmx.o): relocation R_X86_64_PC32 against symbol `ff_pd_1' can not be used when making a shared object; recompile with -fPIC I dont know wish is the problem with ffmpeg and -fPIC... On 05/03/2013 06:32 AM, Gavin Kinsey wrote: > On Wednesday 01 May 2013 15:41:48 Dayana wrote: >> Hi!!! Im developing an aplication using libavcodec, libavformat and >> libavutil. Im trying to make a shared library and for that I have to get >> libavs compiled with -fPIC ... I was trying to do it by setting >> --enable-pic in the configure file, however Im still have the same error: >> >> /usr/local/lib/libavcodec.a(lpc_mmx.o): relocation R_X86_64_PC32 against >> symbol `ff_pd_1' can not be used when making a shared object; recompile >> with -fPIC > If you are trying to combine several ffmpeg libraries into a single shared > library as I have seen some apps try to do then you need to use the > following linker flag on the final library build step. > > -shared -Wl,-Bsymbolic > _______________________________________________ Libav-user mailing list [hidden email] http://ffmpeg.org/mailman/listinfo/libav-user |
|
On Mon, May 6, 2013 at 6:18 AM, Dayana <[hidden email]> wrote: Hi Gavin!! I am a little confused, do you get this error when you are trying to use libavcodec.a into another of your projects or during compilation of libavcodec itself? In the latter case why are you building a static library (i.e. libavcodec.a instead of a libavcodec.so ) ? You need to build libavcodec as a shared object library by specifying --enable-shared --disable-static or something to that effect
_______________________________________________ Libav-user mailing list [hidden email] http://ffmpeg.org/mailman/listinfo/libav-user |
|
I am a little confused, do you get this
error when you are trying to use libavcodec.a into another of your
projects or during compilation of libavcodec itself? In the latter
case why are you building a static library (i.e. libavcodec.a
instead of a libavcodec.so ) ? You need to build libavcodec as a
shared object library by specifying --enable-shared
--disable-static or something to that effect
I get the error: /usr/local/lib/libavcodec.a(lpc_mmx.o): relocation R_X86_64_PC32 against symbol `ff_pd_1' can not be used when making a shared object; recompile with -fPIC when Im trying to use the function av_register_all(), belonging to libavcodec, in a library that I am programing (libmylibrary.so) For compiling libavcodec, I am doing ./configure, make, make install in the directory of ffmpeg-0.11.1, wish contains libavcodec, libavutil, etc... the result of this is libavcodec.a, libavutil.a, etc... :) On 05/06/2013 10:56 AM, Ratin wrote:
_______________________________________________ Libav-user mailing list [hidden email] http://ffmpeg.org/mailman/listinfo/libav-user |
|
In reply to this post by Dayana
> Date: Mon, 6 May 2013 09:18:58 -0400
> From: [hidden email] > To: [hidden email] > Subject: Re: [Libav-user] compiling ffmpeg with -fPIC > > Hi Gavin!! > > I set > > -shared -Wl,-Bsymbolic > > in the linker flags of my library, that depends of libavcodec, libavutil, libavformat... > > However when Im going to call av_register_all(); I get the same error: > /usr/local/lib/libavcodec.a(lpc_mmx.o): relocation R_X86_64_PC32 against > symbol `ff_pd_1' can not be used when making a shared object; recompile > with -fPIC > > /////// > > I think that I have to set the flag -fPIC for compiling the libavcodec, libavutil, libavformat, so I added: enable pic , in the configure file of the ffmpeg project: > > # OS specific > case $target_os in > linux) > add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 > enable pic > enable dv1394 > > > Therefore when ffmpeg is compiled, libavcodec, libavutil, libavformat were compiled with -fPIC.... then when should be ok If I want to use them in my libx.so ... but It is not, I have the same error: > > /usr/local/lib/libavcodec.a(lpc_mmx.o): relocation R_X86_64_PC32 against > symbol `ff_pd_1' can not be used when making a shared object; recompile > with -fPIC > > > I dont know wish is the problem with ffmpeg and -fPIC... Hello, I'm new to the list. If you want to link objects in a static library into a shared library, I think you need to compile the static library using -mcmode=large. As .so can be loaded at an address above 4gig, 32-bit code pointers don't work. The linker can neither create 64-bit relocations from 32-bit relocations or change function calls from non-PIC to PIC. So it throws an error. Someone correct me if I'm wrong. _______________________________________________ Libav-user mailing list [hidden email] http://ffmpeg.org/mailman/listinfo/libav-user |
|
Let me correct myself. The problematic symbol in the situation here is "ff_pd_1", a global variable. It's declared with the attribute visibility("hidden"). The symbol isn't exported. Knowing this, gcc apparently doesn't generate PIC code for accessing it even when you add -fPIC.
By default, gcc assumes your executable isn't going to be larger than 2 gig. Executables are normally loaded within the first 2 gig of the address space, so any global variable ought to be reachable by a 32-bit address. This doesn't work for shared libraries. The address needs to be 64-bit. _______________________________________________ Libav-user mailing list [hidden email] http://ffmpeg.org/mailman/listinfo/libav-user |
|
In reply to this post by Dayana
Hi,
did you solve the problem? I experienced it when I was trying to include static ffmpeg libraries (libavcodec.a, libavformat.a ...) in my shared lib (mylib.so) on a 64 bit linux platform, but I don't know how to solve, can you help me please? Il 01/05/2013 16:41, Dayana ha scritto:
_______________________________________________ Libav-user mailing list [hidden email] http://ffmpeg.org/mailman/listinfo/libav-user |
|
Zanelli Franco <fzanelli@...> writes:
> I experienced it when I was trying to include static ffmpeg > libraries (libavcodec.a, libavformat.a ...) in my shared lib > (mylib.so) on a 64 bit linux platform, but I don't know how to > solve, can you help me please? Could you explain (FFmpeg version, configure line, etc.) how to reproduce your problem? That may allow us to help. Carl Eugen _______________________________________________ Libav-user mailing list [hidden email] http://ffmpeg.org/mailman/listinfo/libav-user |
|
Ok,
I'd like to make a shared library called mylib.so that include static ffmpeg libraries libavcodec.a libavformat.a ..etc. in order to have just one shared library I'm working on a linux machine 64 bit (ubuntu 12.04). I've built ffmpeg libraries from ffmpeg 2.0.1 sources with this configuration: --prefix="$HOME/ffmpeg_build" --extra-cflags="-m64 -I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --bindir="$HOME/bin" --extra-libs="-ldl" --enable-gpl --enable-libmp3lame --enable-libx264 --enable-pic When I link the avlibs in mine, with this command: gcc -m64 -o mylib.so -L../ffmpeg_build/lib /home/uts/ffmpeg_build/lib/libavcodec.a -Wl,-R. -shared -s -fPIC I always get this error: /usr/bin/ld: /home/uts/ffmpeg_build/lib/libavcodec.a(deinterlace.o): relocation R_X86_64_PC32 against symbol `ff_pw_4' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: Bad value The same procedure on a x86 linux platform succeded. This is the same problem experienced from Dayana in this mailing list the 1st may 2013, I read the answers but they were not helpful Can you help me please? thank you Il 28/10/2013 12:37, Carl Eugen Hoyos ha scritto:
--
Ing. Franco
Zanelli TECNOSENS S.P.A.
_______________________________________________ Libav-user mailing list [hidden email] http://ffmpeg.org/mailman/listinfo/libav-user |
|
On Oct 28, 2013 3:21 PM, "Zanelli Franco" <[hidden email]> wrote: Have you tried > When I link the avlibs in mine, with this command: Alex Cohn _______________________________________________ Libav-user mailing list [hidden email] http://ffmpeg.org/mailman/listinfo/libav-user |
|
Il 28/10/2013 16:58, Alex Cohn ha
scritto:
Yes I did. I got the same response that using --enable-pic. I tried also to use -mcmodel=large, but in that case ffmpeg compilation didn't success
--
Ing. Franco
Zanelli TECNOSENS S.P.A.
_______________________________________________ Libav-user mailing list [hidden email] http://ffmpeg.org/mailman/listinfo/libav-user |
|
In reply to this post by fzanelli
Hello again,
Did someone experienced the same problem and can help me to understand what is wrong please? Thank you Franco Il 28/10/2013 14:20, Zanelli Franco ha scritto:
_______________________________________________ Libav-user mailing list [hidden email] http://ffmpeg.org/mailman/listinfo/libav-user |
| Free forum by Nabble | Edit this page |
