You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using the llvm-mingw project which combines CLang and mingw-64. I noticed when configuring a project that excluding -p mingw causes the linker to fail when compiling lua due to it attempting to link directly to the dll. So these configurations work:
xmake f -v -a $arch -p mingw --toolchain=clang --mrc="$triplet-windres.exe" --mingw=$stdlib_dir
xmake config -v -a $arch -p mingw --toolchain=clang --mrc="$triplet-windres.exe" --sdk=$stdlib_dir
but this does not:
xmake config -v -a $arch --toolchain=clang --mrc="$triplet-windres.exe" --sdk=$stdlib_dir
[ 97%]: linking.release lua51.exe
error: lld: error: lld doesn't support linking directly against build\windows\x86_64\release\lua51.dll, use an import library
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
Since the CLang lld linker cannot link against DLLs, the "Platform" should not matter, both mingw and windows should generate and use lib files for linking.
Expected behavior
The linker call generated by xmake should always use a lib file when building for platforms mingw and windows.
Feature Request
I would like to note that on *Nix and Windows, the LLVM-MinGW package always includes the sdk in a directory adjacent to bin in triplet form: <arch>-w64-migw32. It would be really slick if xmake could figure out the compiler path so one would only need to do:
xmake f -p mingw --toolchain=clang
which should default to x86_64, or optionally include an arch:
xmake f -a aarch64 -p mingw --toolchain=clang
I build the llvm-mingw toolchain on a FreeBSD host then cross compile my WinLua toolchain (which include llvm-mingw for windows) and then test the compiler in windows. The directory structure is identical on both platforms. Here is a screen shot of my WinLua install. It uses the "official" llvm-mingw build and I directly install the cmake install output.
Thanks!
Russ
The text was updated successfully, but these errors were encountered:
I am using the llvm-mingw project which combines CLang and mingw-64. I noticed when configuring a project that excluding -p mingw causes the linker to fail when compiling lua due to it attempting to link directly to the dll. So these configurations work:
? Do you want to use clang toolchain (compiler/linker) + mingw64 sdk (headers/libraries)? Or just want to use the llvm-mingw (https://github.com/mstorsjo/llvm-mingw) toolchain?
It appears that xmake f -a [x86_64|i386|arm64|arm] -p mingw --toolchain=clang does seem to work on my Windows laptop. I had tested on a different laptop previously and I was positive that the I needed the --mingw directory.
--toolchain=clang? Why not xmake f -a [x86_64|i386|arm64|arm] -p mingw --mingw=/xx/llvm-mingw ?
xmake/mingw platform will use toolchain(mingw) to support llvm-mingw. The clang toolchain is only used for the usual clang compiler. (for apt install clang)
Describe the bug
I am using the llvm-mingw project which combines CLang and mingw-64. I noticed when configuring a project that excluding
-p mingw
causes the linker to fail when compiling lua due to it attempting to link directly to the dll. So these configurations work:but this does not:
xmake config -v -a $arch --toolchain=clang --mrc="$triplet-windres.exe" --sdk=$stdlib_dir
Since the CLang lld linker cannot link against DLLs, the "Platform" should not matter, both mingw and windows should generate and use lib files for linking.
Expected behavior
The linker call generated by xmake should always use a lib file when building for platforms mingw and windows.
Feature Request
I would like to note that on *Nix and Windows, the LLVM-MinGW package always includes the sdk in a directory adjacent to bin in triplet form: <arch>-w64-migw32. It would be really slick if xmake could figure out the compiler path so one would only need to do:
xmake f -p mingw --toolchain=clang
which should default to x86_64, or optionally include an arch:
xmake f -a aarch64 -p mingw --toolchain=clang
I build the llvm-mingw toolchain on a FreeBSD host then cross compile my WinLua toolchain (which include llvm-mingw for windows) and then test the compiler in windows. The directory structure is identical on both platforms. Here is a screen shot of my WinLua install. It uses the "official" llvm-mingw build and I directly install the
cmake install
output.Thanks!
Russ
The text was updated successfully, but these errors were encountered: