[FFmpeg-user] 4.3.1 configure error

Carl Eugen Hoyos ceffmpeg at gmail.com
Sat Oct 31 13:26:29 EET 2020


Am Fr., 30. Okt. 2020 um 18:10 Uhr schrieb MediaStream <mediastream at gmail.com>:

> $ CFLAGS=-I/usr/local/include LDFLAGS="-L/usr/local/lib -L/usr/local/lib64"
> PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig
> LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64         ./configure
> --prefix=/usr/local --enable-avfilter --enable-gpl --enable-nonfree
> --enable-postproc --enable-pthreads --enable-runtime-cpudetect
> --enable-static --enable-swscale --enable-version3 --disable-decoder=libgsm
> --disable-encoder=libgsm --disable-doc --pkg-config-flags=--static
> --extra-ldflags=-static '--extra-libs=-lx264  -lmp3lame -lpthread -lvpx
> -lx265 -lfdk-aac -laom' --x86asmexe=/usr/local/bin/nasm    --enable-openssl
>  --enable-libmp3lame --enable-libvpx --enable-libx264 --enable-libx265
> --enable-libfdk-aac --enable-libaom

Not necessarily related to your question:
The following have no effect, remove them to ease debugging (making
useful answers to your original question more likely):
--enable-avfilter
--enable-postproc
--enable-pthreads
--enable-runtime-cpudetect (in addition to not having an effect, the option
does not do what you think it does)
--enable-static
--enable-swscale
--disable-decoder=libgsm
--disable-encoder=libgsm

If the --extra-libs command made a difference in your configure line,
this would indicate a bug in our configure script that I would like to
know about.

On my system, --x86asmexe=/usr/local/bin/nasm would not make
a difference, I don't know if this is also true for your system.

> $  tail -24 ffbuild/config.log
>
> require_pkg_config libx265 x265 x265.h x265_api_get
> check_pkg_config libx265 x265 x265.h x265_api_get
> test_pkg_config libx265 x265 x265.h x265_api_get
> pkg-config --exists --print-errors x265
> check_func_headers x265.h x265_api_get -I/usr/local/include
> -L/usr/local/lib -lx265 -lstdc++ -lm -lgcc_s -lgcc -lrt -ldl -lnuma
> test_ld cc -I/usr/local/include -L/usr/local/lib -lx265 -lstdc++ -lm
> -lgcc_s -lgcc -lrt -ldl -lnuma
> test_cc -I/usr/local/include -L/usr/local/lib
> BEGIN /tmp/ffconf.CRuBCdXG/test.c
>     1   #include <x265.h>
>     2   #include <stdint.h>
>     3   long check_x265_api_get(void) { return (long) x265_api_get; }
>     4   int main(void) { int ret = 0;
>     5    ret |= ((intptr_t)check_x265_api_get) & 0xFFFF;
>     6   return ret; }
> END /tmp/ffconf.CRuBCdXG/test.c
> gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
> -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -I/usr/local/include -std=c11
> -fomit-frame-pointer -pthread -I/usr/local/include -I/usr/local/include
> -I/usr/local/include -I/usr/local/include -I/usr/local/include
> -I/usr/local/include -I/usr/local/include -I/usr/local/include
> -I/usr/local/include -L/usr/local/lib -c -o /tmp/ffconf.CRuBCdXG/test.o
> /tmp/ffconf.CRuBCdXG/test.c
> gcc -L/usr/local/lib -L/usr/local/lib64 -static -Wl,--as-needed
> -Wl,-z,noexecstack -I/usr/local/include -L/usr/local/lib -o
> /tmp/ffconf.CRuBCdXG/test /tmp/ffconf.CRuBCdXG/test.o -lx265 -lstdc++ -lm
> -lgcc_s -lgcc -lrt -ldl -lnuma -lx264 -lmp3lame -lpthread -lvpx -lx265
> -lfdk-aac -laom
> /usr/bin/ld: cannot find -lgcc_s
> /usr/local/lib/libx265.a(api.cpp.o): In function `x265_api_get_192':
> api.cpp:(.text+0x2ac3): warning: Using 'dlopen' in statically linked
> applications requires at runtime the shared libraries from the glibc
> version used for linking
> /usr/local/lib/libnuma.a(affinity.o): In function `affinity_ip':
> affinity.c:(.text+0x8f6): warning: Using 'getaddrinfo' in statically linked
> applications requires at runtime the shared libraries from the glibc
> version used for linking
> collect2: error: ld returned 1 exit status
> ERROR: x265 not found using pkg-config

What does the following return?
$ pkg-config --static --libs x265

It apparently contains "-lgcc_s" which is not available on your
system with "-static". I don't know if it helps to edit
/usr/lib/pkgconfig/x265.pc
or if your toolchain does not allow you to build static binaries like above.
Your toolchain could of course be broken, does compilation without -static
work?

Consider using musl to build static binaries.

Carl Eugen


More information about the ffmpeg-user mailing list