libyal / libfvde

Library and tools to access FileVault Drive Encryption (FVDE) encrypted volumes
GNU Lesser General Public License v3.0
339 stars 34 forks source link

Can't run (cross-)compiled binary on Windows #31

Closed Rob--W closed 2 years ago

Rob--W commented 6 years ago

I cross-compiled for Windows on Linux based on the instructions at https://github.com/libyal/libfvde/wiki/Building. Instead of MinGW32 I used MinGW-W64, with the following command:

./configure --host=i686-w64-mingw32 --enable-winapi=yes

The above produces a binary (e.g. fvdeinfo.exe), but when I run it on Windows 7, I get the following error:

The program can't start because libgcc_s_sjlj-1.dll is missing from your computer. Try reinstalling the program to fix this problem.

It seems that libvfde-1.dll is dynamically linked against libgcc_s_sjlj-1.dll, which is not present on Windows 7 by default. I tried --enable-static-executables=yes as suggested by the wiki, but that didn't compile at all. I also tried overriding CFLAGS and LDFLAGS, but that had no effect.

Ultimately I got a working binary with:

CC=/usr/bin/i686-w64-mingw32-gcc\ -static-libgcc ./configure --host=i686-w64-mingw32 --enable-winapi=yes
joachimmetz commented 2 years ago

Unclear if this is an issue or an FYI. Documentation mentions that cygwin builds are dependent on other DLLs. Documentation cannot account for every edge case possible, closing issue.