From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id BEFC147B1F for ; Mon, 2 Oct 2023 11:24:43 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A07E268CE24; Mon, 2 Oct 2023 14:24:39 +0300 (EEST) Received: from mail8.parnet.fi (mail8.parnet.fi [77.234.108.134]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8CF5F68CE23 for ; Mon, 2 Oct 2023 14:24:32 +0300 (EEST) Received: from mail9.parnet.fi (mail9.parnet.fi [77.234.108.21]) by mail8.parnet.fi with ESMTP id 392BOVk6027919-392BOVk7027919 for ; Mon, 2 Oct 2023 14:24:31 +0300 Received: from foo.martin.st (host-97-144.parnet.fi [77.234.97.144]) by mail9.parnet.fi (Postfix) with ESMTPS id 5F0F9A1448 for ; Mon, 2 Oct 2023 14:24:31 +0300 (EEST) Date: Mon, 2 Oct 2023 14:24:30 +0300 (EEST) From: =?ISO-8859-15?Q?Martin_Storsj=F6?= To: ffmpeg-devel@ffmpeg.org In-Reply-To: <20230928094609.3744767-1-martin@martin.st> Message-ID: <72f9c42d-4854-ab9c-4679-1a3c63f58756@martin.st> References: <20230928094609.3744767-1-martin@martin.st> MIME-Version: 1.0 X-FE-Policy-ID: 3:14:2:SYSTEM X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [FFmpeg-devel] [PATCH] tools: Don't include the direct library names when linking X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-15"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Thu, 28 Sep 2023, Martin Storsj=F6 wrote: > When linking the main tools, the object files to link are set up > via the variable OBJS-, 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 fil= e: 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".