forked from pool/virtualbox
Fix building with GCC 15 [boo#1242085] #6
Reference in New Issue
Block a user
Delete Branch ":master"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add gentoo-C23.patch, taken from the corresponding gentoo package, to fix building with GCC 15 where the C language defaults to standard C23. [boo#1242085]
This breaks the build:
Note it is a KMP, so
-nostdinc. How comes this works with gcc 15?https://build.opensuse.org/package/live_build_log/Virtualization/virtualbox:kmp/openSUSE_Tumbleweed/x86_64
I admit I only tested the change locally (I don't know how to do this kind of remote build in the new git workflow) with:
oosc build --clean --no-service --alternative-project home:jamborm:gcc15fixes --no-verifyI did not know about the kmp flavor and so did not test that. It does fail with GCC 15 too.
I am testing replacing the patch with:
Is there something that would prevent from just unconditionally using <stdbool.h> at all times and killing off this hand-crafted
typedef _Bool bool?Well, that is what my patch tried to do, but when compiling with
-nostdincthat is not an option.Yeah you're right. But we can cheat and test for that, too :-D
True, but in the case of gcc-14 and
-nostdincwe need to keep the old typedef, I cannot see a way around that, so the result would have one more#if- one branch for a C23 compiler, one for a pre-C23 one with stdbool.h and one for a pre-C23 one without standard headers.But if that is what you prefer, you are the maintainer, I'll comply.
Maybe we can
#include <linux/types.h>if__KERNEL__? (Kernel uses old std and thetypedeffor both gcc 14 and 15, I guess.)Just including
#include <linux/types.h>does not work. Even with it I'm getting tons oferror: unknown type name 'bool'failures (using gcc-14).Doing the following works with gcc-15, because indeed the kernel compilations have
-std=gnu11on the command line:But I don't see the point of including
<linux/types.h>in this case. (I also have not verified non-kmp flavors and gcc-14 builds work but they should.)@jengelh, do you prefer the above over what I proposed two days ago?
No preference.
I was just throwing around suggestions. (Another might be to look at virtualbox-7.2.0-beta1 what it does.)
I have created #7 - even though I am not very good at testing all works in the new git workflow (yet), I have locally built this variant using both gcc14 and gcc15 and in both cases both the kmp flavor and the main package.
Sorry for the breakage and thanks for your patience.