From: Timo Rothenpieler <timo@rothenpieler.org>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] Weird cross platform support in ffmpeg
Date: Tue, 31 May 2022 16:14:38 +0200
Message-ID: <b2219e04-1ddb-8b22-2f69-4683e3dafd8f@rothenpieler.org> (raw)
In-Reply-To: <CAAeQ5L52wnWc9e1HkQ47zFJ1LAKnAmOUbaD1xNo+7bKFLxdHmg@mail.gmail.com>
On 31.05.2022 12:03, Александр wrote:
> I tried to build ffmpeg 4.4 library and link with it and I received
> multiple unresolved references. I came across on unusual architecture in
> ffmpeg for multiple platforms.The library has many places with code like
> this:
>
> void foo()
> {
> // DO SOMETHING
> if (ARCH_MIPS) // maybe #if ARCH_MIPS (...) #endif should be used instead?
> foo_mips(...);
> if (ARCH_PPC)
> foo_ppc(c);
> if (ARCH_ARM)
> foo_arm(...);
> if (ARCH_AARCH64)
> foo_aarch64(...);
> }
>
> This code leads to linker errors because there is no any stub methods for
> other platforms. I observed root MakeFile, it optionally includes platform
> dependent code for each library (path like $(LIB_SUBDIR)/$(ARCH)/MakeFile)
> where each foo_<arch> is defined.
>
> So, how does it work?
It relies on Compiler-Optimizations, namely Dead-Code-Elimination.
For that reason, FFmpeg does not support being built with -O0, since the
compiler won't eliminate the dead code, leading to a whole bunch of dead
references.
Hence, if you run into an issue like that, you need to look at your
compiler and figure out what the hell it's trying to do.
Or stop trying to build with -O0, which the build system should normally
never allow you to do in the first place unless you force it.
_______________________________________________
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:[~2022-05-31 14:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-31 10:03 Александр
2022-05-31 10:10 ` Nicolas George
2022-05-31 14:14 ` Timo Rothenpieler [this message]
2022-05-31 14:23 ` Andreas Rheinhardt
2022-05-31 14:33 ` Александр
2022-05-31 14:40 ` Nicolas George
2022-05-31 14:52 ` Александр
2022-05-31 16:38 ` Wang Bin
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=b2219e04-1ddb-8b22-2f69-4683e3dafd8f@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