Skip to content

Commit

Permalink
Link gcc helpers statically on MinGW (#488)
Browse files Browse the repository at this point in the history
When compiling a 32bit dll with the mingw-w64 compiler, some 64bit
integer arithmetic operations are implemented using functions from
libgcc (e.g. __udivdi3 and __umoddi3 from libgcc_s_dw2-1.dll). This
unexpected dependency is inconvenient for applications.

The run-time dependency can be avoid by linking statically.
  • Loading branch information
jefdriesen authored Dec 12, 2022
1 parent 3973449 commit 663f1a7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,15 @@ case $host in
os="windows"
threads="windows"
win_implementation="mingw"
LDFLAGS="${LDFLAGS} -static-libgcc"
;;
*-msys*)
AC_MSG_RESULT([ (Windows back-end, using MSYS2)])
backend="windows"
os="windows"
threads="windows"
win_implementation="mingw"
LDFLAGS="${LDFLAGS} -static-libgcc"
;;
*-cygwin*)
AC_MSG_RESULT([ (Windows back-end, using Cygwin)])
Expand Down

0 comments on commit 663f1a7

Please sign in to comment.