Open AndreRH opened 4 weeks ago
I worked around it by reverting FEX CRT related commits: https://github.com/AndreRH/FEX/commits/hangover-9.15
@bylaws did you build with "regular" clang, or why didn't you get those errors?
Oh i am building with a msvcrt based toolchain rather than a ucrt one so I never ran into this. (Or see the msvcrt tagged ones on official repo) https://github.com/bylaws/llvm-mingw/releases/tag/20240630
I think most of these errors should be fixable with just some UCRT ifdefs to implement e.g. _fseeki64 instead of fseeko64. Note that with new crt fex you can drop all of the wine patches it used to need (just need the dll path one (upstream as of yesterday), suspend one and CPU register one for now (new, see wine MRs))
If we want to support ucrt based toolchains ideally they can be set up for CI as well, though I'm not sure it makes sense to support both over than just msvcrt though
I understand msvcrt as legacy, especially for aarch64. Your toolchains also say ucrt btw, likely unintentionally I guess.
Ifdefs won't be enough it seems. I removed some functions like fseeko64 and friends and it compiled, but the linker complained about a lot of missing functions like for example fprintf...
In this case fex isn't even using the crt so legacy doesn't really matter, it's just there's a different set of funcs implemented in headers between the two. Originally we used msvcrt because games can ship their own ucrt and that broke back when fex didn't ship it's own.
If things are more complex with ucrt though I'd be inclined to just support msvcrt, perhaps I can see some way to force msvcrt usage on an UCRT toolchain for FEX.
Good plan, so I prepared to do my builds with msvcrt based toolchains instead and got:
[100%] Linking CXX shared library ../../../Bin/libwow64fex.dll clang: warning: argument unused during compilation: '-static-libgcc' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-static-libstdc++' [-Wunused-command-line-argument] ld.lld: error: undefined symbol: __guard_check_icall_fptr
referenced by libc++.a(stdlib_new_delete.cpp.obj):(.weak._Znwy.default.clang_call_terminate) referenced by libc++.a(stdlib_new_delete.cpp.obj):(.weak._Znwy.default.__clang_call_terminate) referenced by libc++.a(stdlib_new_delete.cpp.obj):(.weak._ZnwySt11align_val_t.default.clang_call_terminate) referenced 2242 more times
This was with:
cmake -DCMAKE_TOOLCHAIN_FILE=../toolchain_mingw.cmake -DMINGW_TRIPLE=aarch64-w64-mingw32 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTS=False -DENABLE_LTO=False -DENABLE_ASSERTIONS=True ..
as my original cmake settings failed even harder with missing jemalloc symbols
Toolchain: llvm-mingw-20240619-msvcrt-ubuntu-20.04-x86_64
Ah... I also disable cfguard for my toolchain because it's broken for arm64ec. Can fix this easy enough though will do.
If you wanna fix yourself just need to copy the load config from the arm64ec module and add back the cfguard sums - see mingw crt
Used toolchain: llvm-mingw-20240518-ucrt-ubuntu-20.04-aarch64
How I tried to build:
Problems:
... and