Opened 2 years ago

Closed 14 months ago

#13285 closed enhancement (fixed)

Incorporation of GCC 6

Reported by: korli Owned by: korli
Priority: normal Milestone: Unscheduled
Component: Build System Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

Provisioning ticket for GCC 6 to track activities and see if it works well. Current release is 6.3

Attachments (4)

syslog_gcc6.txt (21.9 KB) - added by mt 2 years ago.
hrev51266_gcc6 with VirtualBox 5.1.22
0003-Fix-gcc6-crash.patch (823 bytes) - added by mt 2 years ago.
0001-vfs.cpp-Fix-gcc6-crash.patch (1.2 KB) - added by mt 2 years ago.
0002-vfs.cpp-Fix-gcc6-crash.patch (1.2 KB) - added by mt 23 months ago.

Download all attachments as: .zip

Change History (21)

comment:1 Changed 2 years ago by korli

Should probably include binutils 2.28.

Last edited 2 years ago by korli (previous) (diff)

comment:2 Changed 2 years ago by korli

Current release is now 6.4

comment:3 Changed 2 years ago by mt

Hi, I think we need resolve two bugs to build with gcc6.

  • We need to update src/apps/serialconnect/libvterm/src/encoding.c to avoid -Werror=misleading-indentation at line 77-85.

http://cgit.haiku-os.org/haiku/tree/src/apps/serialconnect/libvterm/src/encoding.c#n77

https://github.com/neovim/libvterm/commit/224b8dcde1c9640c29a34aa60c0f0d56ad298449

  • We need to resolve -Werror=nonnull-compare in src/add-ons/kernel/file_systems/userlandfs/shared/ObjectTracker.cpp at line 80 and 93.

http://cgit.haiku-os.org/haiku/tree/src/add-ons/kernel/file_systems/userlandfs/shared/ObjectTracker.cpp#n80

http://cgit.haiku-os.org/haiku/tree/src/add-ons/kernel/file_systems/userlandfs/shared/ObjectTracker.cpp#n93

comment:4 Changed 2 years ago by korli

Hi mt, both issues should fixed in hrev51266. Thanks for pointing them!

comment:5 Changed 2 years ago by mt

I tested hrev51266, build succeeded with GCC 6.4.But haiku crashes at startup. Adding '-fno-delete-null-pointer-checks' to kernel flags may be workaround for it.

Changed 2 years ago by mt

Attachment: syslog_gcc6.txt added

hrev51266_gcc6 with VirtualBox 5.1.22

comment:6 Changed 2 years ago by mt

Has a Patch: set

Changed 2 years ago by mt

Attachment: 0003-Fix-gcc6-crash.patch added

comment:7 Changed 2 years ago by korli

Maybe better to try to "fix" the code: it seems KDiskDeviceManager::Default() can be NULL at https://github.com/haiku/haiku/blob/master/src/system/kernel/fs/vfs.cpp#L7784 and https://github.com/haiku/haiku/blob/master/src/system/kernel/fs/vfs.cpp#L7278

It seems that AutoLocker checks if fLockable isn't NULL... see https://github.com/haiku/haiku/blob/master/headers/private/shared/AutoLocker.h#L130

comment:8 in reply to:  7 Changed 2 years ago by mt

Replying to korli:

Maybe better to try to "fix" the code: it seems KDiskDeviceManager::Default() can be NULL

I added null check to vfs.cpp at line 7282 and 7784, then gcc6 build works. But, gcc5 build works without applying patch or kernel flags. So I think gcc6 deletes null pointer check somewhere in kernel.

Changed 2 years ago by mt

comment:9 Changed 2 years ago by korli

Applied in hrev51274. AutoLocker should probably panic in the kernel when used with a NULL Lockable.

comment:10 Changed 2 years ago by korli

Reverted hrev51274 and applied the workaround flag for GCC6 in hrev51277. The problematic code (DiskDeviceManager) isn't easy to fix because it tries to lock the default DDM when initializing the default one too.

comment:11 Changed 2 years ago by pulkomandy

@korli: please set the "obsolete" flag on patches when applying them and keeping the ticket open. Otherwise it's hard to track which are still waiting to be merged.

comment:12 Changed 23 months ago by mt

It seems null check need to be done before assigning the value [1], so I rewrite vfs.cpp patch. After that hrev51386 gcc6 build boots without '-fno-delete-null-pointer-checks' flag.

[1] https://isc.sans.edu/diary/A+new+fascinating+Linux+kernel+vulnerability/6820

Changed 23 months ago by mt

comment:13 Changed 23 months ago by korli

mt, I'm sorry but adding such checks didn't go through already with hrev51274. Why would it go in this place? The flag '-fno-delete-null-pointer-checks' is already effective anyway.

comment:14 Changed 23 months ago by mt

korli, sorry, I had forgotten that hrev51274 works, please ignore my previous comment.

comment:15 Changed 18 months ago by pulkomandy

Has a Patch: unset

comment:16 Changed 14 months ago by waddlesplash

There is another KDL with GCC 7.3, see #14160.

comment:17 Changed 14 months ago by waddlesplash

Resolution: fixed
Status: newclosed

GCC7 is now used by default in hrev51973.

Note: See TracTickets for help on using tickets.