Opened 8 years ago

Closed 7 years 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:
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 7 years ago.
hrev51266_gcc6 with VirtualBox 5.1.22
0003-Fix-gcc6-crash.patch (823 bytes ) - added by mt 7 years ago.
0001-vfs.cpp-Fix-gcc6-crash.patch (1.2 KB ) - added by mt 7 years ago.
0002-vfs.cpp-Fix-gcc6-crash.patch (1.2 KB ) - added by mt 7 years ago.

Download all attachments as: .zip

Change History (21)

comment:1 by korli, 8 years ago

Should probably include binutils 2.28.

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

comment:2 by korli, 7 years ago

Current release is now 6.4

comment:3 by mt, 7 years ago

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 by korli, 7 years ago

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

comment:5 by mt, 7 years ago

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.

by mt, 7 years ago

Attachment: syslog_gcc6.txt added

hrev51266_gcc6 with VirtualBox 5.1.22

comment:6 by mt, 7 years ago

patch: 01

by mt, 7 years ago

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

comment:7 by korli, 7 years ago

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

in reply to:  7 comment:8 by mt, 7 years ago

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.

comment:9 by korli, 7 years ago

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

comment:10 by korli, 7 years ago

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 by pulkomandy, 7 years ago

@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 by mt, 7 years ago

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

comment:13 by korli, 7 years ago

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 by mt, 7 years ago

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

comment:15 by pulkomandy, 7 years ago

patch: 10

comment:16 by waddlesplash, 7 years ago

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

comment:17 by waddlesplash, 7 years ago

Resolution: fixed
Status: newclosed

GCC7 is now used by default in hrev51973.

Note: See TracTickets for help on using tickets.