#14160 closed bug (fixed)
Haiku x86_64 built with GCC 7.3 KDLs on startup
Reported by: | waddlesplash | Owned by: | bonefish |
---|---|---|---|
Priority: | normal | Milestone: | Unscheduled |
Component: | Build System | Version: | R1/Development |
Keywords: | Cc: | korli, kallisti5 | |
Blocked By: | Blocking: | ||
Platform: | All |
Description
e.g. https://keybase.pub/kallisti5/Screenshots/gpe.png
kallisti5 says this happens on QEMU-KVM but not QEMU (without KVM.)
If you want to build your own GCC 7.3 Haiku:
- get GCC 7.3 buildtools from https://github.com/waddlesplash/buildtools (master)
- get
x86_64
HaikuPorts package listing, which is attached to this ticket
Attachments (3)
Change History (13)
by , 7 years ago
comment:1 by , 7 years ago
Linux kernel makefile has these:
# clang sets -fmerge-all-constants by default as optimization, but this # is non-conforming behavior for C and in fact breaks the kernel, so we # need to disable it here generally. KBUILD_CFLAGS += $(call cc-option,-fno-merge-all-constants) # for gcc -fno-merge-all-constants disables everything, but it is fine # to have actual conforming behavior enabled. KBUILD_CFLAGS += $(call cc-option,-fmerge-constants) # Make sure -fstack-check isn't enabled (like gentoo apparently did) KBUILD_CFLAGS += $(call cc-option,-fno-stack-check,)
Related?
comment:2 by , 7 years ago
Actually looking at https://gcc.gnu.org/gcc-6/porting_to.html it might be the lifetime-dse one, based on https://bugzilla.redhat.com/show_bug.cgi?id=1316999 and other comments about C++ code.
comment:4 by , 7 years ago
The culprit pass is rtl-stv1
. If you disable it using -fdisable-rtl-stv1
on the whole kernel, the KDL goes away.
comment:5 by , 7 years ago
Minimum patch/workaround:
diff --git a/src/system/kernel/Jamfile b/src/system/kernel/Jamfile index 7964320883..10f61bd224 100644 --- a/src/system/kernel/Jamfile +++ b/src/system/kernel/Jamfile @@ -75,6 +75,10 @@ KernelMergeObject kernel_core.o : : $(TARGET_KERNEL_PIC_CCFLAGS) ; +if $(HAIKU_GCC_VERSION_$(HAIKU_ARCH)[1]) >= 7 { + ObjectC++Flags commpage.o signal.o thread.o : -fdisable-rtl-stv1 ; +} + # Generate the header defining macros for C++ structure sizes. local kernelC++StructSizesHeader = [ FGristFiles kernel_c++_struct_sizes.h ] ; TARGET_HDRS_$(TARGET_PACKAGING_ARCH) on $(kernelC++StructSizesHeader)
I've tried a few permutations of those by themselves, but as far as I can tell, you need all 3 in order for the KDL to be fixed.
comment:6 by , 7 years ago
And the proposed comment for that if:
# With the rtl-stv1 pass on these files, the kernel panics towards the end # of the boot process with a "General Protection Exception", see # https://dev.haiku-os.org/ticket/14160. The pass itself vectorizes # a significant number of otherwise-scalar operations, which may be why # disabling it fixes the problem. # # At time of writing, GCC does not seem to have a way to disable # vectorization as a result of optimization without disabling # FPU usage altogether, which of course is not what we want and # breaks when using libstdc++'s headers anyway.
comment:8 by , 7 years ago
Please attach kdl screenshot to the bug tracker.
It would be nice to point to the documentation reference for the GCC flag.
comment:9 by , 7 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed (for now at least) by that commit.
should have sha256sum 79ad0dd02282cf4d06aeb3f0df7a91a053ca23c1bf676535c625f8992ef348bd