-
Notifications
You must be signed in to change notification settings - Fork 452
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
-mfpmath=sse is not added in 32bits build #1133
Comments
Thanks for the report, I'll investigate. |
Hello, The errors in the referenced ticket don't seem to be related to enabling sse:
It's a warning about inlining which I already fixed in 4a08d8d (which is not in an official release yet). The If this is the 64-bit section you're referring to: Line 619 in d3c4e30
then what it is checking is |
Thanks for all the details! I will use your inline fix to try and see if it fixes the build on MinGW on macOS.
However I find this confusing, why is the processor compiling the code any relevant? Compilers running on 32bits system can produce 64bits binaries (and compilers running on 64bits system can produce 32bits binaries as well). Only the target architecture should matter. I find the CMake doc a bit confusing on that as well |
Yes, some of the cmake variables are unintuitive. How are you enabling the 32-bit build from cmake? If I simply add |
yes from what I see xmake passes -m32 and set the compiler path.
however, from the failed build log, there are also warnings about sse not being enabled
notice also that no SSE option is passed to the compiler:
Probably because in that case, CMAKE_SYSTEM_PROCESSOR is aarch64 (Apple M1), but the target arch is x86. it looks like detecting the target arch is not easy with cmake: https://stackoverflow.com/questions/11944060/how-to-detect-target-architecture-using-cmake Edit : I see your fix targets only debug compilation, but here it's compiling using release |
Cross compiling is indeed difficult using cmake. Can you place:
at the end of CMakeLists.txt to see what it is reporting? I'm hoping it's not aarch64, that would be really bad. |
Sure. I added MESSAGE(CMAKE_SYSTEM_PROCESSOR="${CMAKE_SYSTEM_PROCESSOR}") and the output is:
😓 https://github.com/xmake-io/xmake-repo/actions/runs/9489680619/job/26151521672?pr=4330#step:5:478 |
Ok, that was unexpected! I'm not really sure how to proceed now. I can probably blanket disable the Do we really need to cross compile from Apple M1 to a 32-bit x86 platform? (seems like a super fringe case) |
The problem is not 32-bit but target architecture detection, as CMAKE_SYSTEM_PROCESSOR is empty on MinGW 64bits on macOS too, and on MinGW 64bits on Windows too (I'm not sure why the error doesn't trigger). Notice that MinGW has no SSE option even on Windows when targeting 64bits
I suppose the best option would be to detect arch from compiler, or to expect the user to set I can submit a pull request to xmake to set CMAKE_SYSTEM_PROCESSOR quite easily, but that won't fix 32bits compilation as sse options are only added in the x86_64 check |
After some more research, it appears I will fix that on xmake side, and I think a fix is needed here: Lines 619 to 655 in 4cd5205
maybe just check if CMAKE_SYSTEM_PROCESSOR equals x86 too (and update the 32bits comment), as I don't think any of this is specific for 64bits. What do you think? |
Hi,
-mfpmath=sse is not added in 32bits build, and from a comment in Jolt.cmake this seems to be a mistake
JoltPhysics/Jolt/Jolt.cmake
Line 647 in 4cd5205
This block is still part of the 64bits check, same for EMIT_X86_INSTRUCTION_SET_DEFINITIONS.
Also, shouldn't -msse2 be added too in 32bits build? -mfpmath=sse is not enough
The text was updated successfully, but these errors were encountered: