Repository: godot
Issue: [cross compile] gcc/llvm + aarch64/riscv64 embree intrinsics
Labels: bug,topic:buildsystem,topic:thirdparty

### Tested versions

4.3-stable

### System information

Yocto `scarthgap` running on Fedora 40

### Issue description

Incorrect embree intrinsics used with RaspberryPi 5 on Yocto build system

```
-mcpu=cortex-a76+crypto
```

```
Compiling modules/navigation/2d/nav_mesh_generator_2d.cpp ...
In file included from thirdparty/embree/common/sys/../simd/arm/emulation.h:12,
                 from thirdparty/embree/common/sys/intrinsics.h:13,
                 from thirdparty/embree/common/sys/alloc.cpp:5:
thirdparty/embree/common/sys/../simd/arm/sse2neon.h: In function '__m128i _mm_aesdeclast_si128(__m128i, __m128i)':
thirdparty/embree/common/sys/../simd/arm/sse2neon.h:9918:69: error: invalid operands to binary ^ (have '__Int64x2_t' and '__Uint8x16_t')
 9918 |                vaesdq_u8(vreinterpretq_u8_m128i(a), vdupq_n_u8(0))) ^
      |                                                                     ^
Compiling modules/navigation/editor/navigation_mesh_editor_plugin.cpp ...
In file included from thirdparty/embree/common/sys/../math/../sys/../simd/arm/emulation.h:12,
                 from thirdparty/embree/common/sys/../math/../sys/intrinsics.h:13,
                 from thirdparty/embree/common/sys/../math/emath.h:7,
                 from thirdparty/embree/common/sys/../math/vec2.h:6,
                 from thirdparty/embree/common/sys/estring.h:7,
                 from thirdparty/embree/common/sys/estring.cpp:4:
thirdparty/embree/common/sys/../math/../sys/../simd/arm/sse2neon.h: In function '__m128i _mm_aesdeclast_si128(__m128i, __m128i)':
thirdparty/embree/common/sys/../math/../sys/../simd/arm/sse2neon.h:9918:69: error: invalid operands to binary ^ (have '__Int64x2_t' and '__Uint8x16_t')
 9918 |                vaesdq_u8(vreinterpretq_u8_m128i(a), vdupq_n_u8(0))) ^
      |                                                                     ^
Compiling modules/navigation/nav_map.cpp ...
In file included from thirdparty/embree/common/sys/../simd/arm/emulation.h:12,
                 from thirdparty/embree/common/sys/intrinsics.h:13,
                 from thirdparty/embree/common/sys/sysinfo.cpp:11:
thirdparty/embree/common/sys/../simd/arm/sse2neon.h: In function '__m128i _mm_aesdeclast_si128(__m128i, __m128i)':
thirdparty/embree/common/sys/../simd/arm/sse2neon.h:9918:69: error: invalid operands to binary ^ (have '__Int64x2_t' and '__Uint8x16_t')
 9918 |                vaesdq_u8(vreinterpretq_u8_m128i(a), vdupq_n_u8(0))) ^
      |                                                                     ^
```

Configuration
```
scons p=linuxbsd target=editor arch=arm64 use_static_cpp=yes optimize=speed progress=yes no_editor_splash=yes num_jobs=32 alsa=yes dbus=yes debug_symbols=no fontconfig=yes libdecor=yes use_llvm=no LINK='aarch64-poky-linux-g++  -mcpu=cortex-a76+crypto -mbranch-protection=standard -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/mnt/raid10/yocto/master/raspberry-pi5/tmp/work/cortexa76-poky-linux/godot/4.3/recipe-sysroot -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fcanon-prefix-map  -fmacro-prefix-map=/mnt/raid10/yocto/master/raspberry-pi5/tmp/work/cortexa76-poky-linux/godot/4.3/git=/usr/src/debug/godot/4.3  -fdebug-prefix-map=/mnt/raid10/yocto/master/raspberry-pi5/tmp/work/cortexa76-poky-linux/godot/4.3/git=/usr/src/debug/godot/4.3  -fmacro-prefix-map=/mnt/raid10/yocto/master/raspberry-pi5/tmp/work/cortexa76-poky-linux/godot/4.3/git=/usr/src/debug/godot/4.3  -fdebug-prefix-map=/mnt/raid10/yocto/master/raspberry-pi5/tmp/work/cortexa76-poky-linux/godot/4.3/git=/usr/src/debug/godot/4.3  -fdebug-prefix-map=/mnt/raid10/yocto/master/raspberry-pi5/tmp/work/cortexa76-poky-linux/godot/4.3/recipe-sysroot=  -fmacro-prefix-map=/mnt/raid10/yocto/master/raspberry-pi5/tmp/work/cortexa76-poky-linux/godot/4.3/recipe-sysroot=  -fdebug-prefix-map=/mnt/raid10/yocto/master/raspberry-pi5/tmp/work/cortexa76-poky-linux/godot/4.3/recipe-sysroot-native=  -Wl,-z,relro,-z,now' opengl3=yes openxr=no pulseaudio=yes use_sowrap=no builtin_brotli=no builtin_freetype=no builtin_graphite=no builtin_harfbuzz=no builtin_icu4c=no builtin_libogg=no builtin_libpng=no builtin_libtheora=no builtin_libvorbis=no builtin_libwebp=no builtin_zlib=no builtin_zstd=no touch=yes udev=yes vulkan=yes use_volk=yes wayland=yes x11=no CC="aarch64-poky-linux-gcc  -mcpu=cortex-a76+crypto -mbranch-protection=standard -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/mnt/raid10/yocto/master/raspberry-pi5/tmp/work/cortexa76-poky-linux/godot/4.3/recipe-sysroot" cflags=" -O2 -pipe -g -feliminate-unused-debug-types -fcanon-prefix-map  -fmacro-prefix-map=/mnt/raid10/yocto/master/raspberry-pi5/tmp/work/cortexa76-poky-linux/godot/4.3/git=/usr/src/debug/godot/4.3  -fdebug-prefix-map=/mnt/raid10/yocto/master/raspberry-pi5/tmp/work/cortexa76-poky-linux/godot/4.3/git=/usr/src/debug/godot/4.3  -fmacro-prefix-map=/mnt/raid10/yocto/master/raspberry-pi5/tmp/work/cortexa76-poky-linux/godot/4.3/git=/usr/src/debug/godot/4.3  -fdebug-prefix-map=/mnt/raid10/yocto/master/raspberry-pi5/tmp/work/cortexa76-poky-linux/godot/4.3/git=/usr/src/debug/godot/4.3  -fdebug-prefix-map=/mnt/raid10/yocto/master/raspberry-pi5/tmp/work/cortexa76-poky-linux/godot/4.3/recipe-sysroot=  -fmacro-prefix-map=/mnt/raid10/yocto/master/raspberry-pi5/tmp/work/cortexa76-poky-linux/godot/4.3/recipe-sysroot=  -fdebug-prefix-map=/mnt/raid10/yocto/master/raspberry-pi5/tmp/work/cortexa76-poky-linux/godot/4.3/recipe-sysroot-native= " CXX="aarch64-poky-linux-g++  -mcpu=cortex-a76+crypto -mbranch-protection=standard -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/mnt/raid10/yocto/master/raspberry-pi5/tmp/work/cortexa76-poky-linux/godot/4.3/recipe-sysroot" cxxflags=" -O2 -pipe -g -feliminate-unused-debug-types -fcanon-prefix-map  -fmacro-prefix-map=/mnt/raid10/yocto/master/raspberry-pi5/tmp/work/cortexa76-poky-linux/godot/4.3/git=/usr/src/debug/godot/4.3  -fdebug-prefix-map=/mnt/raid10/yocto/master/raspberry-pi5/tmp/work/cortexa76-poky-linux/godot/4.3/git=/usr/src/debug/godot/4.3  -fmacro-prefix-map=/mnt/raid10/yocto/master/raspberry-pi5/tmp/work/cortexa76-poky-linux/godot/4.3/git=/usr/src/debug/godot/4.3  -fdebug-prefix-map=/mnt/raid10/yocto/master/raspberry-pi5/tmp/work/cortexa76-poky-linux/godot/4.3/git=/usr/src/debug/godot/4.3  -fdebug-prefix-map=/mnt/raid10/yocto/master/raspberry-pi5/tmp/work/cortexa76-poky-linux/godot/4.3/recipe-sysroot=  -fmacro-prefix-map=/mnt/raid10/yocto/master/raspberry-pi5/tmp/work/cortexa76-poky-linux/godot/4.3/recipe-sysroot=  -fdebug-prefix-map=/mnt/raid10/yocto/master/raspberry-pi5/tmp/work/cortexa76-poky-linux/godot/4.3/recipe-sysroot-native=  -fvisibility-inlines-hidden" AS="aarch64-poky-linux-as " AR="aarch64-poky-linux-gcc-ar" RANLIB="aarch64-poky-linux-gcc-ranlib" import_env_vars=PATH,PKG_CONFIG_DIR,PKG_CONFIG_DISABLE_UNINSTALLED,PKG_CONFIG_LIBDIR,PKG_CONFIG_PATH,PKG_CONFIG_SYSROOT_DIR,PKG_CONFIG_SYSTEM_INCLUDE_PATH,PKG_CONFIG_SYSTEM_LIBRARY_PATH
```
Full Compile Log
[log.do_compile_rpi5.txt](https://github.com/user-attachments/files/16737027/log.do_compile_rpi5.txt)


### Steps to reproduce

Yocto scarthgap OS image using meta-raspberrypi, meta-godot:  https://github.com/jwinarske/meta-godot
`MACHINE ?= "raspberrypi5"`

Run `bitbake godot` to build the recipe: https://github.com/jwinarske/meta-godot/blob/scarthgap/recipes-graphics/godot/godot_4.3.bb

### Minimal reproduction project (MRP)

build only issue