Thanks for replying!
I added --disable-lib32 for x86_64 and it compiles.
But another problem is for i686:
Configure:
CC=clang CXX=clang++ CFLAGS="--target=i686-windows-gnu -fuse-ld=lld
--sysroot=/tmp/mingw/i686-windows-gnu"
CXXFLAGS="--target=i686-windows-gnu -fuse-ld=lld
--sysroot=/tmp/mingw/i686-windows-gnu"
configure --host=i686-w64-mingw32 --prefix=/tmp/mingw/i686-windows-gnu
--enable-lib32 LD=lld NM=llvm-nm RANLIB=llvm-ranlib AR=llvm-ar
DLLTOOL=llvm-dlltool AS=llvm-as STRIP=llvm-strip OBJDUMP=llvm-objdump
WINDRES=llvm-windres
The error is exactly the same as my last email.
About the --target option:
This is for clang only, not the configure script. Clang supports
multi-target compiling and the --target is to tell it what code it
should produce. It will produce linux code without this option.
And I have --host specified for the configure script.
On 10/23/25 10:02 PM, LIU Hao wrote:
在 2025-10-23 21:50, accelerator0099 写道:
Hello I encountered errors about inline assembly with clang 20.1
Configured with:
CC=clang CXX=clang++ CFLAGS="--target=x86_64-windows-gnu -fuse-ld=lld
--sysroot=/tmp/mingw/x86_64- windows-gnu" CXXFLAGS="--target=x86_64-
windows-gnu -fuse-ld=lld --sysroot=/tmp/mingw/x86_64-windows- gnu" /
mnt/src/mingw-w64/mingw-w64-crt/configure --host=x86_64-w64-mingw32 --
prefix=/tmp/mingw/x86_64- windows-gnu --enable-lib64 LD=lld NM=llvm-nm
RANLIB=llvm-ranlib AR=llvm-ar DLLTOOL=llvm-dlltool AS=llvm- as
STRIP=llvm-strip OBJDUMP=llvm-objdump WINDRES=llvm-windres
And it gives output:
/mnt/src/mingw-w64/mingw-w64-crt/misc/_invoke_watson.c:52:9: error:
inline assembly requires more registers than available
52 | "mov %%eax, %0\n\t"
| ^
1 error generated.
Note that if I replace line 50 in _invoke_watson.c to:
#if 0
It compiles with no error.
This code is for x86-32 only, so there seems to be something wrong in
your configuration.
`--target=` is seldom useful; when building a compiler it specifies the
target of the new compiler, and when building a non-compiler it mostly
means nothing. And the triplet seems incorrect.
When cross-compiling mingw-w64 you need to specify `--build=x86_64-pc-
linux-gnu --host=x86_64-w64-mingw32`.
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public