From: Timo Rothenpieler <timo@rothenpieler.org>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] configure doesn't seem to use pkg-config flags?
Date: Thu, 18 Jan 2024 14:31:10 +0100
Message-ID: <db23a46d-4253-44c0-b88c-5a863041150f@rothenpieler.org> (raw)
In-Reply-To: <CAL1QdWedVy1jAVM5nr-4fCn_5oG076BzxgWZ2N4j+XT+ut+bbQ@mail.gmail.com>
On 18/01/2024 04:38, Roger Pack wrote:
> Hello.
> After compiling libx265 as a "static library" (mingw cross compiling
> targeting win64)
>
> $ pkg-config --libs --static x265
> -L/home/rdp/new/sandbox/win64_static/build_files/lib -lx265
> /usr/lib/gcc/x86_64-w64-mingw32/10-win32/libstdc++.a -lgcc
>
> I get this failure at configure time:
>
> ./configure --enable-libx265 --arch=x86_64 --target-os=mingw32
> --cross-prefix=x86_64-w64-mingw32- --pkg-config=pkg-config
> --pkg-config-flags=--static
>
> ERROR: x265 not found using pkg-config
>
> config.log (sorry it's verbose, first compile passes, second one fails linking)
>
> ...
> 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/home/rdp/new/sandbox/win64_static/build_files/include
> -L/home/rdp/new/sandbox/win64_static/build_files/lib -lx265
> /usr/lib/gcc/x86_64-w64-mingw32/10-win32/libstdc++.a -lgcc
> test_ld cc -I/home/rdp/new/sandbox/win64_static/build_files/include
> -L/home/rdp/new/sandbox/win64_static/build_files/lib -lx265
> /usr/lib/gcc/x86_64-w64-mingw32/10-win32/libstdc++.a -lgcc
> test_cc -I/home/rdp/new/sandbox/win64_static/build_files/include
> -L/home/rdp/new/sandbox/win64_static/build_files/lib
> /usr/lib/gcc/x86_64-w64-mingw32/10-win32/libstdc++.a
> BEGIN /tmp/ffconf.L9GhKESq/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.L9GhKESq/test.c
> x86_64-w64-mingw32-gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64
> -D_LARGEFILE_SOURCE -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
> -D__printf__=__gnu_printf__ -D_WIN32_WINNT=0x0600
> -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -DPIC -std=c11
> -fomit-frame-pointer
> -I/home/rdp/new/sandbox/win64_static/build_files/include
> -L/home/rdp/new/sandbox/win64_static/build_files/lib
> /usr/lib/gcc/x86_64-w64-mingw32/10-win32/libstdc++.a -c -o
> /tmp/ffconf.L9GhKESq/test.o /tmp/ffconf.L9GhKESq/test.c
> /tmp/ffconf.L9GhKESq/test.c: In function 'check_x265_api_get':
> /tmp/ffconf.L9GhKESq/test.c:3:40: warning: cast from pointer to
> integer of different size [-Wpointer-to-int-cast]
> 3 | long check_x265_api_get(void) { return (long) x265_api_get; }
> | ^
> x86_64-w64-mingw32-gcc: warning:
> /usr/lib/gcc/x86_64-w64-mingw32/10-win32/libstdc++.a: linker input
> file unused because linking not done
> x86_64-w64-mingw32-gcc -Wl,--nxcompat,--dynamicbase
> -Wl,--high-entropy-va -Wl,--as-needed -Wl,--image-base,0x140000000
> -I/home/rdp/new/sandbox/win64_static/build_files/include
> -L/home/rdp/new/sandbox/win64_static/build_files/lib
> /usr/lib/gcc/x86_64-w64-mingw32/10-win32/libstdc++.a -o
> /tmp/ffconf.L9GhKESq/test.exe /tmp/ffconf.L9GhKESq/test.o -lx265 -lgcc
> /usr/bin/x86_64-w64-mingw32-ld:
> /home/rdp/new/sandbox/win64_static/build_files/lib/libx265.a(api.cpp.obj):api.cpp:(.text+0xfb5):
> undefined reference to `operator new(unsigned long long)'
> /usr/bin/x86_64-w64-mingw32-ld:
> /home/rdp/new/sandbox/win64_static/build_files/lib/libx265.a(api.cpp.obj):api.cpp:(.text+0x1303):
> undefined reference to `operator delete(void*)'
> ...
>
> So it seems to be linking it not using the output of pkg-config --libs
> --static for linking or something?
It's passing the pkg-config flags just fine.
The x265 .pc file is just broken and does not state its dependency on
libstdc++.
> Workaround is --extra-libs=-lstdc++ but something seems confusing to me here.
> Advice welcome. Or if I should file something let me know, thank you :)
>
> -=roger
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next prev parent reply other threads:[~2024-01-18 13:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-18 3:38 Roger Pack
2024-01-18 13:31 ` Timo Rothenpieler [this message]
2024-01-31 4:31 ` Roger Pack
2024-01-31 12:03 ` Timo Rothenpieler
2024-01-31 13:07 ` epirat07
2024-01-31 13:47 ` Timo Rothenpieler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=db23a46d-4253-44c0-b88c-5a863041150f@rothenpieler.org \
--to=timo@rothenpieler.org \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git