Some code in one of my projects has a significant performance regression and outright fails (compiles, no errors) when using clang 16.0.6 (arch linux & raspberry pi os), but works as expected when running on dev machine (iMac 2019, Sonoma 14.3.1, Xcode 15.3 & VSCode 1.87.0) with Apple clang version 15.0.0 (clang-1500.3.9.4).
Been trying to fix this problem moving the code around, using different machines (2 x86_64 [AMD: threadripper 1900x; 7800x3D], 2 arm [raspberry pi 4B & 5]), different swift versions (5.7, 5.9, 5.10), but no luck. Everything just works on my dev machine, but completely fails when using non-Apple compiler (for production use).
Upgrading or downgrading clang/gcc/llvm is not possible on the production machines. I've started writing the program in Rust to avoid this inconsistency, but that will take a lot more time than just try adding compile/execution flags or changing configurations somewhere.
What other options can I try? Swift is my go-to language for everything, but this is a dealbreaker.