summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTormod Volden <debian.tormod@gmail.com>2022-09-04 18:36:57 +0200
committerTormod Volden <debian.tormod@gmail.com>2023-01-28 11:39:17 +0100
commitec4c3c4317f8d0574aaaabc09a2eb0d72ee3475d (patch)
treec872b675d69d1f85027fd075154e781f6cb5b0c9
parent9fb5e2edb2adf7f40597b01320c8cc926b4bb57f (diff)
downloadlibusb-ec4c3c4317f8d0574aaaabc09a2eb0d72ee3475d.tar.gz
windows: Only link with --add-stdcall-alias if supported by linker
E.g. the LLVM LLD doesn't support this option. Closes #1192 References #944 Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
-rw-r--r--configure.ac14
-rw-r--r--libusb/version_nano.h2
2 files changed, 14 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 0f3d79e..d5b50ab 100644
--- a/configure.ac
+++ b/configure.ac
@@ -224,7 +224,7 @@ sunos)
windows)
AC_CHECK_TYPES([struct timespec], [], [], [[#include <time.h>]])
AC_DEFINE([_WIN32_WINNT], [_WIN32_WINNT_VISTA], [Define to the oldest supported Windows version.])
- LT_LDFLAGS="${LT_LDFLAGS} -avoid-version -Wl,--add-stdcall-alias"
+ LT_LDFLAGS="${LT_LDFLAGS} -avoid-version"
;;
emscripten)
AC_SUBST(EXEEXT, [.html])
@@ -402,6 +402,18 @@ if test "x$backend" = xwindows; then
CFLAGS="${saved_CFLAGS}"
fi
+dnl Some linkers do not support the '--add-stdcall-alias' option so check for it here
+if test "x$backend" = xwindows; then
+ saved_CFLAGS="${CFLAGS}"
+ CFLAGS="-Wl,--add-stdcall-alias"
+ AC_MSG_CHECKING([if linker supports --add-stdcall-alias])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
+ [AC_MSG_RESULT([yes])
+ LT_LDFLAGS="${LT_LDFLAGS} -Wl,--add-stdcall-alias"],
+ [AC_MSG_RESULT([no])])
+ CFLAGS="${saved_CFLAGS}"
+fi
+
SHARED_CFLAGS="-Wall -Wextra -Wshadow -Wunused -Wwrite-strings -Werror=format-security -Werror=implicit-function-declaration -Werror=implicit-int -Werror=init-self -Werror=missing-prototypes -Werror=strict-prototypes -Werror=undef -Werror=uninitialized"
AM_CPPFLAGS="${EXTRA_CPPFLAGS}"
diff --git a/libusb/version_nano.h b/libusb/version_nano.h
index a346258..cf38400 100644
--- a/libusb/version_nano.h
+++ b/libusb/version_nano.h
@@ -1 +1 @@
-#define LIBUSB_NANO 11780
+#define LIBUSB_NANO 11781