Repository: godot
Issue: Cannot compile Godot with Address Sanitizer with default features
Labels: bug,topic:buildsystem

### Tested versions

Git 4.4 - 4364ed6ccd001cbfe7cb781d074100695c878d90

### System information

Ubuntu 22.04 CI

### Issue description

https://github.com/qarmin/GodotBuilds/actions/runs/12363022765

When trying to compile Godot with Address Sanitizer on Ubuntu 22.04 CI,  then I got this error when linking
```
modules/libmodule_raycast.linuxbsd.editor.dev.x86_64.san.a(rtcore.linuxbsd.editor.dev.x86_64.san.o): in function `_GLOBAL__sub_I_rtcNewDevice':
/usr/include/c++/11/iostream:74:(.text.startup+0x18): relocation truncated to fit: R_X86_64_PC32 against `.bss'
modules/libmodule_raycast.linuxbsd.editor.dev.x86_64.san.a(rtcore.linuxbsd.editor.dev.x86_64.san.o): in function `__static_initialization_and_destruction_0':
/home/runner/work/GodotBuilds/GodotBuilds/godot/thirdparty/embree/kernels/common/rtcore.cpp:20:(.text.startup+0x3d): relocation truncated to fit: R_X86_64_PC32 against `.bss'
modules/libmodule_raycast.linuxbsd.editor.dev.x86_64.san.a(scene.linuxbsd.editor.dev.x86_64.san.o): in function `_GLOBAL__sub_I__ZN6embree17missing_rtcCommitEv':
/usr/include/c++/11/iostream:74:(.text.startup+0xf): relocation truncated to fit: R_X86_64_PC32 against `.bss'
modules/libmodule_raycast.linuxbsd.editor.dev.x86_64.san.a(scene_verify.linuxbsd.editor.dev.x86_64.san.o): in function `_GLOBAL__sub_I__ZN6embree5Scene21checkIfModifiedAndSetEv':
/usr/include/c++/11/iostream:74:(.text.startup+0xf): relocation truncated to fit: R_X86_64_PC32 against `.bss'
modules/libmodule_raycast.linuxbsd.editor.dev.x86_64.san.a(geometry.linuxbsd.editor.dev.x86_64.san.o): in function `_GLOBAL__sub_I__ZN6embree8Geometry11gtype_namesE':
/usr/include/c++/11/iostream:74:(.text.startup+0xf): relocation truncated to fit: R_X86_64_PC32 against `.bss'
modules/libmodule_raycast.linuxbsd.editor.dev.x86_64.san.a(scene_triangle_mesh.linuxbsd.editor.dev.x86_64.san.o): in function `embree::RawBufferView::operator=(embree::RawBufferView const&)':
/home/runner/work/GodotBuilds/GodotBuilds/godot/thirdparty/embree/kernels/common/buffer.h:128:(.text.unlikely+0x17a): relocation truncated to fit: R_X86_64_PC32 against symbol `__ubsan_vptr_type_cache' defined in .dynbss section in /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/Scrt1.o
/home/runner/work/GodotBuilds/GodotBuilds/godot/thirdparty/embree/kernels/common/buffer.h:128:(.text.unlikely+0x196): relocation truncated to fit: R_X86_64_PC32 against symbol `__ubsan_vptr_type_cache' defined in .dynbss section in /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/Scrt1.o
modules/libmodule_raycast.linuxbsd.editor.dev.x86_64.san.a(scene_triangle_mesh.linuxbsd.editor.dev.x86_64.san.o): in function `embree::RawBufferView::RawBufferView(embree::RawBufferView&&)':
/home/runner/work/GodotBuilds/GodotBuilds/godot/thirdparty/embree/kernels/common/buffer.h:128:(.text.unlikely+0x1ca): relocation truncated to fit: R_X86_64_PC32 against symbol `__ubsan_vptr_type_cache' defined in .dynbss section in /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/Scrt1.o
/home/runner/work/GodotBuilds/GodotBuilds/godot/thirdparty/embree/kernels/common/buffer.h:128:(.text.unlikely+0x20a): relocation truncated to fit: R_X86_64_PC32 against symbol `__ubsan_vptr_type_cache' defined in .dynbss section in /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/Scrt1.o
modules/libmodule_raycast.linuxbsd.editor.dev.x86_64.san.a(scene_triangle_mesh.linuxbsd.editor.dev.x86_64.san.o): in function `_GLOBAL__sub_I__ZN6embree12TriangleMeshC2EPNS_6DeviceE':
/usr/include/c++/11/iostream:74:(.text.startup+0xf): relocation truncated to fit: R_X86_64_PC32 against `.bss'
modules/libmodule_raycast.linuxbsd.editor.dev.x86_64.san.a(bvh4_factory.linuxbsd.editor.dev.x86_64.san.o): in function `_GLOBAL__sub_I__ZN6embree27BVH4ColliderUserGeom_error2Ev':
/usr/include/c++/11/iostream:74:(.text.startup+0xf): additional relocation overflows omitted from the output
/usr/lib/gcc/x86_64-linux-gnu/11/libstdc++.a(cxx11-locale-inst.o): in function `_GLOBAL__sub_I_cxx11_locale_inst.cc':
(.text.startup._GLOBAL__sub_I_cxx11_locale_inst.cc+0x7): failed to convert GOTPCREL relocation against '_ZGVNSt7__cxx119money_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE2idE'; relink with --no-relax
(.text.startup._GLOBAL__sub_I_cxx11_locale_inst.cc+0x16): failed to convert GOTPCREL relocation against '_ZGVNSt7__cxx119money_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE2idE'; relink with --no-relax
(.text.startup._GLOBAL__sub_I_cxx11_locale_inst.cc+0x25): failed to convert GOTPCREL relocation against '_ZGVNSt7__cxx1110moneypunctIcLb0EE2idE'; relink with --no-relax
(.text.startup._GLOBAL__sub_I_cxx11_locale_inst.cc+0x34): failed to convert GOTPCREL relocation against '_ZGVNSt7__cxx1110moneypunctIcLb1EE2idE'; relink with --no-relax
(.text.startup._GLOBAL__sub_I_cxx11_locale_inst.cc+0x43): failed to convert GOTPCREL relocation against '_ZGVNSt7__cxx118numpunctIcE2idE'; relink with --no-relax
(.text.startup._GLOBAL__sub_I_cxx11_locale_inst.cc+0x52): failed to convert GOTPCREL relocation against '_ZGVNSt7__cxx118time_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE2idE'; relink with --no-relax
(.text.startup._GLOBAL__sub_I_cxx11_locale_inst.cc+0x61): failed to convert GOTPCREL relocation against '_ZGVNSt7__cxx118messagesIcE2idE'; relink with --no-relax
(.text.startup._GLOBAL__sub_I_cxx11_locale_inst.cc+0x70): failed to convert GOTPCREL relocation against '_ZGVNSt7__cxx117collateIcE2idE'; relink with --no-relax
collect2: error: ld returned 1 exit status
scons: *** [bin/godot.linuxbsd.editor.dev.x86_64.san] Error 1
scons: building terminated because of errors.
```

when using 

```
scons dev_build=yes module_basis_universal_enabled=no module_bmp_enabled=no module_camera_enabled=no module_csg_enabled=no module_cvtt_enabled=no module_dds_enabled=no module_denoise_enabled=no module_enet_enabled=no module_etcpak_enabled=no module_glslang_enabled=no module_gltf_enabled=no module_gridmap_enabled=no module_hdr_enabled=no module_jpg_enabled=no module_jsonrpc_enabled=no module_lightmapper_rd_enabled=no module_mbedtls_enabled=no module_meshoptimizer_enabled=no module_minimp3_enabled=no module_mobile_vr_enabled=no module_multiplayer_enabled=no module_noise_enabled=no module_ogg_enabled=no module_openxr_enabled=no module_raycast_enabled=no module_regex_enabled=no module_squish_enabled=no module_tga_enabled=no module_theora_enabled=no module_tinyexr_enabled=no module_upnp_enabled=no module_vhacd_enabled=no module_vorbis_enabled=no module_webp_enabled=no module_webrtc_enabled=no module_websocket_enabled=no module_webxr_enabled=no module_xatlas_unwrap_enabled=no use_ubsan=yes use_asan=yes target=editor -j2
```
instead, then compilation succeed 

### Steps to reproduce

Compile Godot on Ubuntu 22.04.5
```
scons dev_build=yes use_ubsan=yes use_asan=yes tests=yes target=editor -j2
```

### Minimal reproduction project (MRP)

N/A