[libav-api] problem compiling statically to make a shared lib

Andrew Kelley superjoe30 at gmail.com
Wed Sep 18 04:40:44 CEST 2013


I solved this by adding -Wl,-Bsymbolic. See the comments here:
https://bugzilla.libav.org/show_bug.cgi?id=561


On Sat, Sep 14, 2013 at 4:33 AM, Andrew Kelley <superjoe30 at gmail.com> wrote:

> I tried this against git master HEAD and I get a similar issue:
>
> c99 -I/home/andy/dev/libav/out/include -pedantic -Werror -Wall -g -O0
> -fPIC  -o src/decode.o -c src/decode.c
> c99 -shared -Wl,-soname,libgroove.so -o src/libgroove.so src/groove.o
> src/scan.o src/gain_analysis.o src/decode.o
> /home/andy/dev/libav/out/lib/libavfilter.a
> /home/andy/dev/libav/out/lib/libavformat.a
> /home/andy/dev/libav/out/lib/libavcodec.a
> /home/andy/dev/libav/out/lib/libavresample.a
> /home/andy/dev/libav/out/lib/libswscale.a
> /home/andy/dev/libav/out/lib/libavutil.a -lSDL -lbz2 -lz -lm -pthread
> /usr/bin/ld: /home/andy/dev/libav/out/lib/libavcodec.a(vc1dsp_mmx.o):
> relocation R_X86_64_PC32 against symbol `ff_pw_9' can not be used when
> making a shared object; recompile with -fPIC
> /usr/bin/ld: final link failed: Bad value
> collect2: error: ld returned 1 exit status
>
>
>
> On Wed, Sep 11, 2013 at 11:19 AM, Andrew Kelley <superjoe30 at gmail.com>wrote:
>
>> I have compiled libav 9.9 like this:
>>
>> ./configure --prefix=$(pwd)/out --enable-pic
>> make
>> make install
>>
>> I'm trying to make a shared lib which depends statically on libav, and I
>> get this:
>>
>> $ make LIBAV_PREFIX=/home/andy/Downloads/libav-9.9/out
>> c99 -Isrc -D_POSIX_C_SOURCE=200809L -pedantic -Werror -Wall -g -O0 -o
>> example/playlist.o -c example/playlist.c
>> c99 -I/home/andy/Downloads/libav-9.9/out/include -pedantic -Werror -Wall
>> -g -O0 -fPIC  -o src/groove.o -c src/groove.c
>> c99 -shared -Wl,-soname,libgroove.so -o src/libgroove.so src/groove.o
>> /home/andy/Downloads/libav-9.9/out/lib/libavfilter.a
>> /home/andy/Downloads/libav-9.9/out/lib/libavformat.a
>> /home/andy/Downloads/libav-9.9/out/lib/libavcodec.a
>> /home/andy/Downloads/libav-9.9/out/lib/libavresample.a
>> /home/andy/Downloads/libav-9.9/out/lib/libavutil.a -lSDL -lbz2 -lz -lm
>> -pthread
>> /usr/bin/ld: /home/andy/Downloads/libav-9.9/out/lib/libavcodec.a(lpc.o):
>> relocation R_X86_64_PC32 against symbol `ff_pd_1' can not be used when
>> making a shared object; recompile with -fPIC
>> /usr/bin/ld: final link failed: Bad value
>> collect2: error: ld returned 1 exit status
>> make: *** [src/libgroove.so] Error 1
>>
>> See my makefile here:
>> https://github.com/superjoe30/groove/blob/21622a2decef62f3a028a182a5ffbc96554407f7/Makefile
>>
>> system: Linux andy-xps 3.8.0-29-generic #42-Ubuntu SMP Tue Aug 13
>> 19:40:39 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
>>
>> Any ideas?
>>
>
>


More information about the libav-api mailing list