Skip to content

Commit 9a5a611

Browse files
build: Suppress stupid MSVC linker warning
... and use correct format to pass linker flags
1 parent 739c53b commit 9a5a611

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.cirrus.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ task:
258258
# Set non-essential options that affect the CLI messages here.
259259
# (They depend on the user's taste, so we don't want to set them automatically in configure.ac.)
260260
CFLAGS: -nologo -diagnostics:caret
261-
LDFLAGS: -XCClinker -nologo -XCClinker -diagnostics:caret
261+
LDFLAGS: -Xlinker -Xlinker -Xlinker -nologo
262262
matrix:
263263
- name: "x86_64 (MSVC): Windows (Debian stable, Wine)"
264264
- name: "x86_64 (MSVC): Windows (Debian stable, Wine, int128_struct)"

configure.ac

+6
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,12 @@ AC_DEFUN([SECP_TRY_APPEND_DEFAULT_CFLAGS], [
115115
if test x"$GCC" != x"yes" && test x"$build_windows" = x"yes"; then
116116
SECP_TRY_APPEND_CFLAGS([-W2 -wd4146], $1) # Moderate warning level, disable warning C4146 "unary minus operator applied to unsigned type, result still unsigned"
117117
SECP_TRY_APPEND_CFLAGS([-external:anglebrackets -external:W0], $1) # Suppress warnings from #include <...> files
118+
# We pass -ignore:4217 to the MSVC linker to suppress warning 4217 when
119+
# importing variables from a statically linked secp256k1.
120+
# (See the libtool manual, section "Windows DLLs" for background.)
121+
# Unfortunately, libtool tries to be too clever and strips "-Xlinker arg"
122+
# into "arg", so this will be " -Xlinker -ignore:4217" after stripping.
123+
LDFLAGS="-Xlinker -Xlinker -Xlinker -ignore:4217 $LDFLAGS"
118124
fi
119125
])
120126
SECP_TRY_APPEND_DEFAULT_CFLAGS(SECP_CFLAGS)

0 commit comments

Comments
 (0)