[vlc-devel] [PATCH] package: win32: Don't use linker script for import libraries

Steve Lhomme robux4 at ycbcr.xyz
Wed Oct 9 12:15:12 CEST 2019


Thanks for the clarification. I totally support not using .lib for files 
that aren't actually compatible with MSVC.

On 2019-10-09 11:56, Martin Storsjö wrote:
> On Wed, 9 Oct 2019, Steve Lhomme wrote:
> 
>> Aren't these .lib compatible with MSVC ? Meaning a program built in 
>> MSVC could link to libvlc even if VLC was not built with it.
> 
> Yes they are compatible with MSVC.
> 
> Currently, there's four files produced:
> 
> libvlc.lib
> libvlccore.lib
> vlc.lib
> vlccore.lib
> 
> The first two are import libs, produced by dlltool, which can be linked 
> by both MSVC and binutils.
> 
> The last two are linker scripts, not actual libraries, which only 
> contain the text "INPUT(libvlc.lib)", acting as a redirection. MSVC does 
> not support this, and lld in coff mode doesn't either. Only GNU ld 
> supports it.
> 
> When you specify -lvlc for linking, GNU ld doesn't look for 
> "libvlc.lib", it does look for "libvlc.a", "libvlc.dll.a" and "vlc.lib" 
> (and a number of other combinations). To fix this, 4ab7dfbf8fc added 
> "vlc.lib" in addition to "libvlc.lib", with the linker script redirection.
> 
> But I think this is bad for two reasons:
> 1) The name "vlc.lib" makes it sound like this also is a library for 
> MSVC (and how is an MSVC user going to know which to pick between 
> "libvlc.lib" and "vlc.lib"?), while it only works with GNU ld. By 
> renaming it from "vlc.lib" to "libvlc.dll.a" it's clearer what its 
> purpose is (to be picked up by mingw linkers)
> 2) lld/coff doesn't support linker script for the redirection, so we can 
> replace it with a copy instead of a linker script, to make it work with 
> lld as well.
> 
> // Martin
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list