kcat / openal-soft

OpenAL Soft is a software implementation of the OpenAL 3D audio API.
Other
2.22k stars 536 forks source link

[Possibly bug] Failed to compile on GCC 8.3.0 #987

Closed runlevel5 closed 6 months ago

runlevel5 commented 7 months ago

OS: Debian 8.3.0 GCC: gcc (Debian 8.3.0-6) 8.3.0 OpenAL source code: master branch at commit 9ecf3d076c1dd184760a6a40bb6a349db0f09f12

Compile option:

set(LIBTYPE STATIC)
option(FORCE_STATIC_VCRT "" ON)
option(ALSOFT_UTILS "" OFF)
option(ALSOFT_EXAMPLES "" OFF)
option(ALSOFT_UPDATE_BUILD_VERSION "" OFF)
option(ALSOFT_INSTALL "" OFF)
option(ALSOFT_INSTALL_CONFIG "" OFF)
option(ALSOFT_INSTALL_HRTF_DATA "" OFF)
option(ALSOFT_INSTALL_AMBDEC_PRESETS "" OFF)
option(ALSOFT_INSTALL_EXAMPLES "" OFF)
option(ALSOFT_INSTALL_UTILS "" OFF)

I ran into following errors:

[ 42%] Building C object extern/curl/lib/CMakeFiles/libcurl_static.dir/request.c.o

In file included from /__w/Q2RTX/Q2RTX/extern/openal-soft/common/ringbuffer.h:12,
                 from /__w/Q2RTX/Q2RTX/extern/openal-soft/common/ringbuffer.cpp:23:
/__w/Q2RTX/Q2RTX/extern/openal-soft/common/flexarray.h: In instantiation of 'struct al::FlexArrayStorage<std::byte, 16, true>':
/__w/Q2RTX/Q2RTX/extern/openal-soft/common/flexarray.h:78:51:   required from 'struct al::FlexArray<std::byte, 16>'
/__w/Q2RTX/Q2RTX/extern/openal-soft/common/ringbuffer.h:36:34:   required from here
/__w/Q2RTX/Q2RTX/extern/openal-soft/common/flexarray.h:20:59: error: requested alignment is not an integer constant
 struct alignas(std::max(alignment, alignof(al::span<T>))) FlexArrayStorage : al::span<T> {
                                                           ^~~~~~~~~~~~~~~~
[ 42%] Building C object extern/curl/lib/CMakeFiles/libcurl_static.dir/rtsp.c.o
[ 42%] Building C object extern/curl/lib/CMakeFiles/libcurl_static.dir/select.c.o
cc1plus: warning: unrecognized command line option '-Wno-interference-size'
cc1plus: warning: unrecognized command line option '-Wno-c++20-attribute-extensions'
make[2]: *** [extern/openal-soft/CMakeFiles/OpenAL.dir/build.make:178: extern/openal-soft/CMakeFiles/OpenAL.dir/common/ringbuffer.cpp.o] Error 1
runlevel5 commented 7 months ago

I reckon it might be related to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94929

runlevel5 commented 7 months ago

As you might have known, there are many games ported to the SteamOS which currently uses GCC 8.3.0 for its v2 runtime pack. Therefore IMHO it would be great if openal-soft could be backward-compatible with GCC 8. I am more than happy to contribute workaround patches.

kcat commented 7 months ago

That bug report suggests it was fixed in GCC 8. I guess SteamOS can't update to a fixed version of 8?

Though if the issue is with using std::max in alignas specifically, it shouldn't be too much of a problem to work around. If other fixes are needed, I'd be fine with accepting them as long as they're not too invasive.

runlevel5 commented 7 months ago

That bug report suggests it was fixed in GCC 8. I guess SteamOS can't update to a fixed version of 8?

The SteamOS v2 SDK uses Debian Jessie of which GCC is still on 8.3.0. I don't think I could convince Debian to bump GCC on that old version.

Though if the issue is with using std::max in alignas specifically, it shouldn't be too much of a problem to work around. If other fixes are needed, I'd be fine with accepting them as long as they're not too invasive.

I will make a new Pull Request

runlevel5 commented 6 months ago

On second thought I think devs should move to the SteamOS RT v3 instead, I am not a big fan of introducing extra codes to handle edge cases of legacy compilers