[vlc-commits] configure: Don't explicitly add -ladvapi32 to linker flags

Martin Storsjö git at videolan.org
Thu Apr 26 01:15:58 CEST 2018


vlc | branch: master | Martin Storsjö <martin at martin.st> | Thu Apr 26 01:12:49 2018 +0300| [4319ab8d6645082ab68db34c9edc4d763bc84630] | committer: Martin Storsjö

configure: Don't explicitly add -ladvapi32 to linker flags

This flag was originally not added because of crypto functions,
but together with -lssp in 460879.

Advapi32 is one of the libs that are automatically linked in by
the mingw compiler/linker driver.

Adding it manually here causes issues with linking libupnp_plugin.la
with lld. Libupnp contains md5 functions, and advapi32 also contains
functions with the same names. If -ladvapi32 is specified early in the
link command, before -lupnp, the conflicts arise. (The same conflicts
don't occur with binutils ld though, since it searches libraries
in a slightly different order than lld.)

The conflict can be avoided by fixing one inconsistency in mingw-w64
though, but then libupnp will use MD5 functions from advapi32.dll
(with an ABI not guaranteed to match the ones it expected) instead
of the ones bundled in libupnp.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4319ab8d6645082ab68db34c9edc4d763bc84630
---

 configure.ac | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index bffa7fe1c0..e507d31694 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1140,9 +1140,8 @@ AS_IF([test "${enable_ssp}" != "no" -a "${enable_optimizations}" != "no"], [
 ])
 
 AS_IF([test "${SYS}" = "mingw32"], [
-    dnl library for Crypt/BCrypt APIs
-    AS_IF([test "${vlc_winstore_app}" != 1],
-          [LDFLAGS="${LDFLAGS} -ladvapi32"],
+    dnl library for BCrypt APIs
+    AS_IF([test "${vlc_winstore_app}" = 1],
           [LDFLAGS="${LDFLAGS} -lbcrypt"])
 ])
 



More information about the vlc-commits mailing list