vid.stab icon indicating copy to clipboard operation
vid.stab copied to clipboard

FindSSE.cmake causes false positives when cross compiling

Open PureTryOut opened this issue 3 years ago • 4 comments

On Alpine Linux we're currently porting the system to riscv64. While building vid.stab, it appeared the build system was trying to use the -msse2 compiler option, while this option is not supported on this architecture.

Looking at the CMake code this is because CMake checks the output of /proc/cpuinfo for mentions of SSE support. However, this assumes that the architecture of the CPU building the package is also the target architecture, which in this case is not true as we're cross compiling it.

So it sees that the CPU building the package is x86_64 and supports SSE, even though the target architecture is riscv64 which does not support SSE. This obviously breaks compilation.

Adding -DSSE2_FOUND=False to the CMake options for this particular architecture fixes the problem.

PureTryOut avatar Jun 14 '21 08:06 PureTryOut

I am not so familiar with the CMake stuff. If you have a fix that would solve it in a good way and allow for the option of cross-platform compilation I would be happy for a merge request.

georgmartius avatar Jun 14 '21 09:06 georgmartius

@PureTryOut thank you!

wildone avatar Jan 27 '22 14:01 wildone

it is similar to https://github.com/Framstag/libosmscout/pull/1198 , it is necessary to try_compile sse code to verify availability...

Karry avatar Jan 27 '22 16:01 Karry

If I read correctly this was fixed by https://github.com/georgmartius/vid.stab/pull/114 already, so can be resolved.

thinrope avatar Feb 11 '24 01:02 thinrope