Skip to content

Commit 4d0c189

Browse files
committed
Fixes for Windows cross-compilation
These days mingw by default produces binaries that depend on libgcc-sjlj-1.dll, which defeats the whole historical point of mingw (produce vanilla win32 binaries with no GNU stuff). Add a hack to link with -static-libgcc, which avoids the problem.
1 parent a17d44e commit 4d0c189

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

Makefile.am

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,10 @@ libfftw3@PREC_SUFFIX@_la_LIBADD = \
131131

132132
if QUAD
133133
# cannot use -no-undefined since dependent on libquadmath
134-
libfftw3@PREC_SUFFIX@_la_LDFLAGS = -version-info @SHARED_VERSION_INFO@
134+
libfftw3@PREC_SUFFIX@_la_LDFLAGS = -version-info @SHARED_VERSION_INFO@ $(ENVIRONMENT_LIBFFTW3_LDFLAGS)
135135
else
136136
libfftw3@PREC_SUFFIX@_la_LDFLAGS = -no-undefined -version-info \
137-
@SHARED_VERSION_INFO@
137+
@SHARED_VERSION_INFO@ $(ENVIRONMENT_LIBFFTW3_LDFLAGS)
138138
endif
139139

140140
fftw3@PREC_SUFFIX@.pc: fftw.pc

support/BUILD-MINGW32.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
set -e
22

33
confflags="--prefix=`pwd`/mingw32 --host=i686-w64-mingw32 --with-our-malloc --with-windows-f77-mangling --enable-shared --disable-static --enable-threads --with-combined-threads --with-incoming-stack-boundary=2"
4+
export ENVIRONMENT_LIBFFTW3_LDFLAGS='-Wc,-static-libgcc'
45

56
rm -rf mingw32
67

support/BUILD-MINGW64.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
set -e
22

33
confflags="--prefix=`pwd`/mingw64 --host=x86_64-w64-mingw32 --disable-alloca --with-our-malloc --with-windows-f77-mangling --enable-shared --disable-static --enable-threads --with-combined-threads"
4+
export ENVIRONMENT_LIBFFTW3_LDFLAGS='-Wc,-static-libgcc'
45

56
rm -rf mingw64
67

0 commit comments

Comments
 (0)