Skip to content

improve llvm cross-compilation#6471

Merged
waruqi merged 3 commits intodevfrom
llvm
May 21, 2025
Merged

improve llvm cross-compilation#6471
waruqi merged 3 commits intodevfrom
llvm

Conversation

@waruqi
Copy link
Member

@waruqi waruqi commented May 18, 2025

  1. Fix Cross Compilation for Windows #6461
> xmake f -p cross --cross=x86_64-pc-linux-gnu --toolchain=llvm --sdk=C:\xxx\llvm -cvD

std header has been not supported yet

  1. fix target/arch on macos Arm64

@waruqi waruqi added this to the v3.0.0 milestone May 18, 2025
@SekaiArendelle
Copy link

What if I cross compiling to x86_64-w64-mingw32 target, can't I use is_plat("mingw") to detect platform?

@SekaiArendelle
Copy link

That means, can we infer target arch and target platform according to --cross?

@waruqi
Copy link
Member Author

waruqi commented May 20, 2025

What if I cross compiling to x86_64-w64-mingw32 target, can't I use is_plat("mingw") to detect platform?

why not use llvm-mingw + mingw toolchain. not llvm toolchain

@waruqi waruqi merged commit 25b22ca into dev May 21, 2025
41 of 44 checks passed
@waruqi waruqi deleted the llvm branch May 21, 2025 00:30
@SekaiArendelle
Copy link

why not use llvm-mingw + mingw toolchain. not llvm toolchain

I do use llvm-mingw toolchain. The reason why I leave that comments is that clang does not distinguish between local compilation and cross compilation. Therefore, compiling with clang's default target and a sysroot clang detected automatically should be the same behavior when I specify the target and sysroot path. Last but not least, I use 24bit-xjkp's script so that I can use triplet+sysroot style cross compilation. If xmake use triplet+sysroot at the begging, xjkp's hundreds of lines of script should not start with supporting --sysroot flag during configuration. And I think that -rtlib and -unwindlib flag should also be supported by xmake.

@SekaiArendelle
Copy link

Can we use -arch and -plat to infer target triplet instead of using -p cross and --cross=? That means, xmake also not distinguish native compilation and cross compilation. I am a beginner of xmake, so, please correct me if somewhere is wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants