Kernel – GCC 8 Tests – Not Quite Ready…

I decided to try updating a crash-and-burn test system to Fedora 28 (early-beta..) as this included GCC 8 (currently 8.0.1), to see how well the Kernel (4.16-rc6) compiled..

There were a lot of warnings generated:

........................
 CC [M] drivers/rtc/rtc-pcf8523.o
 CC drivers/usb/core/file.o
 CC drivers/video/hdmi.o
 CC [M] drivers/rtc/rtc-pcf8563.o
drivers/video/hdmi.c: In function ‘hdmi_spd_infoframe_init’:
drivers/video/hdmi.c:171:2: warning: ‘strncpy’ specified bound 8 equals destination size [-Wstringop-truncation]
 strncpy(frame->vendor, vendor, sizeof(frame->vendor));
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/video/hdmi.c:172:2: warning: ‘strncpy’ specified bound 16 equals destination size [-Wstringop-truncation]
 strncpy(frame->product, product, sizeof(frame->product));
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/core/file.o: warning: objtool: usb_register_dev()+0x1b3: sibling call from callable instruction with modified stack frame
drivers/usb/core/file.o: warning: objtool: usb_major_init()+0x24: sibling call from callable instruction with modified stack frame
 CC drivers/usb/core/buffer.o
 CC drivers/video/backlight/backlight.o
 CC [M] drivers/rtc/rtc-pcf8583.o
 CC drivers/usb/core/sysfs.o
.................................
 CC drivers/usb/host/ehci-pci.o
 CC drivers/video/fbdev/core/softcursor.o
drivers/video/fbdev/core/fbcon.o: warning: objtool: fbcon_prepare_logo()+0x218: sibling call from callable instruction with modified stack frame
drivers/video/fbdev/core/fbcon.o: warning: objtool: fbcon_init()+0x4ba: sibling call from callable instruction with modified stack frame
drivers/video/fbdev/core/fbcon.o: warning: objtool: fbcon_switch()+0x47f: sibling call from callable instruction with modified stack frame
drivers/video/fbdev/core/fbcon.o: warning: objtool: con2fb_release_oldinfo.isra.9()+0xd2: sibling call from callable instruction with modified stack frame
drivers/video/fbdev/core/fbcon.o: warning: objtool: set_con2fb_map()+0x151: sibling call from callable instruction with modified stack frame
drivers/video/fbdev/core/fbcon.o: warning: objtool: fbcon_event_notify()+0x195: sibling call from callable instruction with modified stack frame
drivers/video/fbdev/core/fbcon.o: warning: objtool: fbcon_prepare_logo.cold.21()+0x20: sibling call from callable instruction with modified stack frame
 CC [M] drivers/usb/image/mdc800.o
....................................

These were displayed throughout the compile, although the process completed successfully, and the resulting kernel booted OK:

................
Fedora 28 (Workstation Edition)
Kernel 4.16.0-rc6 on an x86_64 (ttyS0)
...................
[root@rgup ~]# uname -a
Linux rgup 4.16.0-rc6 #1 SMP Tue Mar 20 19:52:54 PDT 2018 x86_64 x86_64 x86_64 GNU/Linux

When I tried to run grub-customizer, it crashed:

....
*** initializing (w/o specified bootloader type)…
 * reading partition info…
/usr/include/c++/8/bits/basic_string.h:1048: std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator[](std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference = char&; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]: Assertion '__pos <= size()' failed.
Aborted (core dumped)

So, I had to use grub2-mkconfig instead..

I compiled the NVIDIA driver (384.111 patched for 4.16) and this also gave warnings, but the compile completed OK..

...............
 CC [M] /usb3/kernel/NVIDIA-Linux-x86_64-384.111-custom/kernel/nvidia-uvm/uvm8_pmm_test.o
 /usb3/kernel/NVIDIA-Linux-x86_64-384.111-custom/kernel/nvidia-uvm/uvm8_pmm_test.o: warning: objtool: chunk_alloc_check_common.isra.5()+0x3b: sibling call from callable instruction with modified stack frame
 /usb3/kernel/NVIDIA-Linux-x86_64-384.111-custom/kernel/nvidia-uvm/uvm8_pmm_test.o: warning: objtool: split_test_single()+0x66: sibling call from callable instruction with modified stack frame
 /usb3/kernel/NVIDIA-Linux-x86_64-384.111-custom/kernel/nvidia-uvm/uvm8_pmm_test.o: warning: objtool: basic_test_alloc()+0x2a: sibling call from callable instruction with modified stack frame
 /usb3/kernel/NVIDIA-Linux-x86_64-384.111-custom/kernel/nvidia-uvm/uvm8_pmm_test.o: warning: objtool: uvm8_test_pmm_sanity()+0x9cc: sibling call from callable instruction with modified stack frame
 CC [M] /usb3/kernel/NVIDIA-Linux-x86_64-384.111-custom/kernel/nvidia-uvm/uvm8_perf_events_test.o
 /usb3/kernel/NVIDIA-Linux-x86_64-384.111-custom/kernel/nvidia-uvm/uvm8_perf_events_test.o: warning: objtool: test_events()+0x4c: sibling call from callable instruction with modified stack frame
 ........................

This was all only for testing purposes, and – obviously – none of this is recommended for real use, yet!

There are several gcc8-related patches for the kernel, proposed, and these should eventually be included in later -rc versions, and 4.17..

Robert Gadsdon.   March 21, 2018


Leave a Reply

Your email address will not be published. Required fields are marked *