I had to compile the same library with code in C to two different platforms
- amd64
- arm64 Luckily I had some unit tests covering functions in the library.
Found out that some floating point calculation were different between amd64 & arm64 architectures.
Initial GCC compiler flags were
- amd64
-x c -m64 -Qn -O2 -fPIC
- arm64
x c -Qn -O2 -fPIC
After some tests additional flag -ffp-contract=off
was added to arm64 compilation that solved the problem
Final arm64 compiler flags -x c -Qn -O2 -fPIC -ffp-contract=off