Novum / vkQuake

Vulkan Quake port based on QuakeSpasm
GNU General Public License v2.0
1.81k stars 220 forks source link

Link warning when LTO is enabled #697

Closed bubbleguuum closed 3 months ago

bubbleguuum commented 3 months ago

vkQuake compiled with gcc 13.3.0 on openSUSE TW, using Meson this time, and lto enabled (-flto=auto) which is the default on that distro, makes the linker output this warning:

[   12s] ../Quake/mimalloc/segment.c: In function ‘mi_segment_span_free_coalesce’:
[   12s] ../Quake/mimalloc/segment.c:664:30: warning: ‘__atomic_load_8’ writing 8 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=]
[   12s]   664 |   const bool is_abandoned = (segment->thread_id == 0); // mi_segment_is_abandoned(segment);
[   12s]       |                              ^
[   12s] lto1: note: destination object is likely at address zero

Full compilation traces

The produced binary seems to be working fine (briefly tested) and this is probably benign but I'm mentioning this warning for reference or in case it denotes a real problem and it would be best to disable LTO.

vsonnier commented 3 months ago

This is in mimalloc so as long as it is just a warning I'm no going to support any OSS included in vkQuake, and simply assume 'they' know what they are doing :)

Worst case if real OSS bugs show up we are only going to mitigate them: ex. lowering optimizations, reverting to an old version ...etc. but I'm not going to the rabbit hole of 'fixing' them.