From: "Martin Storsjö" <martin@martin.st>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH] tools: Don't include the direct library names when linking
Date: Mon, 2 Oct 2023 14:24:30 +0300 (EEST)
Message-ID: <72f9c42d-4854-ab9c-4679-1a3c63f58756@martin.st> (raw)
In-Reply-To: <20230928094609.3744767-1-martin@martin.st>
On Thu, 28 Sep 2023, Martin Storsjö wrote:
> When linking the main tools, the object files to link are set up
> via the variable OBJS-<name>, but for the tools, we've only
> used the target's list of dependencies.
>
> In most cases, this has been fine, but it has caused specifying
> the libraries to link in a duplicate fashion; the linking command
> has looked like this:
>
> $CC -Llibavutil ... tools/tool.o libavutil/libavutil.a -lavutil
>
> Normally, the libraries to link are handled with "-Llibavutil -lavutil";
> when linking the main fftools, this is how they are linked.
>
> In the case of the binaries under the "tools" directory (within the
> make variable TOOLS), we've passed the full set of dependencies
> to the linker, via $^, which does contain the names of the
> dependency libraries as well.
>
> When libraries are built as regular static libraries, or shared
> unix libraries, this has all worked fine. When libraries are
> built as DLLs for Windows, though, the norm is not to pass the
> actual DLL to the linker, but an import library.
>
> Mingw tools generally can handle linking directly against a DLL
> as well, but MSVC tools don't support that, and error out with
> a very cryptic error message:
>
> libavdevice\avdevice.dll : fatal error LNK1107: invalid or corrupt file: cannot read at 0x2D8
>
> By omitting these parts of the dependencies, linking of these tool
> executables succeed in MSVC builds with shared libraries enabled.
> ---
> Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Acked by Hendrik on irc (last week, referenced by Andreas), will push
later today.
// Martin
_______________________________________________
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".
prev parent reply other threads:[~2023-10-02 11:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-28 9:46 Martin Storsjö
2023-10-02 11:24 ` Martin Storsjö [this message]
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=72f9c42d-4854-ab9c-4679-1a3c63f58756@martin.st \
--to=martin@martin.st \
--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