New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lld failing to cross-compile with libmingw32.a error #366
Comments
Your linker command contains |
I ran a linker command without |
To help further developers who came across from searching, I am leaving the exact cause and a workaround. WorkaroundWhen invoking wimlib $ cd /c/build/wimlib.1.14.3
$ ./configure --libdir=/c/build/wimlib-1.14.3 --host=aarch64-w64-mingw32 --disable-static Causelibtool was appending From libwim.la:
In Linux, executables refer to fixed rpath to search for .so files. I guess that is the reason why Finally, thanks again for your kind troubleshooting! |
Hello, first thanks for your excellent work.
I have come across a weird bug while cross-compiling wimlib with llvm-mingw.
Details
Symptoms
When cross-comping wimlib library with llvm-mingw,
ld.lld
successfully linkslibwim.dll
file.But the llvm linker fails to link
wimlib-imagex.exe
, statingmachine type x64 conflicts with x86
.This log is from linking i686 binaries from the x86_64 host. The same happens when I build aarch64 binaries from the same host.
The command line explicitly states to search
i686-w64-mingw32/lib
path for linking library files, where properlibmsvcrt.a
andlibmingw32.a
is located. It also states-m i386pe
to link 32bit x86 PE files. However, lld printsmachine type x64 conflicts with x86
error.I have tested other programs such as xz-utils, lz4, zlib with llvm-mingw, and lld succeeded in linking both DLL and EXE files.
wimlib-imagex.exe
is the only case where lld fails to link.I have conducted wimlib support forum for this, but we could not figure out the exact reason why.
What is weirder is that in some environments, LLVM linker successfully builds
wimlib-imagex.exe
.Its official Windows build link script uses llvm-mingw to build official ARM64 Windows binaries in CI environment, and it works.
Does ld.lld have a compatibility issue with GNU libtool, or is this a nasty bug?
Tested Environment
How to reproduce
pacman -S autotools base-devel nasm
wimlib-msys2-experiment.sh -a i686 -t $LLVM_MINGW_ROOT_PATH $WIMLIB_SOURCE_PATH
The text was updated successfully, but these errors were encountered: