Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Rebuild your kernel after upgrading GCC to 7.3!
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
nsoveiko
n00b
n00b


Joined: 04 Dec 2004
Posts: 47
Location: somewhere over the rainbow

PostPosted: Tue Jul 03, 2018 7:32 pm    Post subject: Rebuild your kernel after upgrading GCC to 7.3! Reply with quote

today i decided to update the system and ended up with an unloadable nvidia-drivers module:
Code:
Jul  3 14:19:21 alerik kernel: nvidia: Unknown symbol __x86_indirect_thunk_edx (err 0)
Jul  3 14:19:21 alerik kernel: nvidia: Unknown symbol __x86_indirect_thunk_ecx (err 0)
Jul  3 14:19:21 alerik kernel: nvidia: Unknown symbol __x86_indirect_thunk_edi (err 0)
Jul  3 14:19:21 alerik kernel: nvidia: Unknown symbol __x86_indirect_thunk_ebp (err 0)
Jul  3 14:19:21 alerik kernel: nvidia: Unknown symbol __x86_indirect_thunk_esi (err 0)
Jul  3 14:19:21 alerik kernel: nvidia: Unknown symbol __x86_indirect_thunk_eax (err 0)

these types of errors usually indicate that modules were built against the wrong kernel version. in my case kernel has not changed in a couple of months, and the sources were current. after much soul searching i recalled that since then system gcc was upgraded from sys-devel/gcc-6.4.0-r1 to 7.3.0-r3. que procedure outlined in https://wiki.gentoo.org/wiki/Upgrading_GCC and warnings about ABI incompatibility. :idea:

the problem was resolved by recompiling kernel with gcc-7.3 and rebooting into the new kernel. after that modules loaded fine.

note that revdep-rebuild will not catch this as kernel sources are not compiled nor installed by emerge.

i guess gcc upgrade guide could have mentioned this.

this concludes today's public service announcement.


Last edited by nsoveiko on Mon Jul 09, 2018 8:52 pm; edited 1 time in total
Back to top
View user's profile Send private message
asturm
Developer
Developer


Joined: 05 Apr 2007
Posts: 6995
Location: Austria

PostPosted: Tue Jul 03, 2018 7:43 pm    Post subject: Reply with quote

Looks like an nvidia-driver specialty.
_________________
backend.cpp:92:2: warning: #warning TODO - this error message is about as useful as a cooling unit in the arctic
Back to top
View user's profile Send private message
nsoveiko
n00b
n00b


Joined: 04 Dec 2004
Posts: 47
Location: somewhere over the rainbow

PostPosted: Tue Jul 03, 2018 8:24 pm    Post subject: Reply with quote

i'm willing to bet that this affects other external modules too (e.g. app-emulation/virtualbox-modules)
Back to top
View user's profile Send private message
Marcih
Apprentice
Apprentice


Joined: 19 Feb 2018
Posts: 152

PostPosted: Wed Jul 04, 2018 8:19 am    Post subject: Reply with quote

Thanks for the heads up and although I've recompiled my kernel after 7.3.0 got stabilised because I wanted full support for retpoline and few days after 4.14 got stabilised too (yay!), it's still useful for others to know, especially since there most likely is a number of people like you (or me) running Novideo with proprietary drivers.
_________________
Bones McCracker wrote:
It wouldn't be so bad, if it didn't suck.

===
I refuse to move on from GTK+2.
Back to top
View user's profile Send private message
Josef.95
Advocate
Advocate


Joined: 03 Sep 2007
Posts: 3628
Location: Germany

PostPosted: Sun Jul 08, 2018 7:37 am    Post subject: Rebuild your kernel after major GCC upgrade! Reply with quote

asturm wrote:
Looks like an nvidia-driver specialty.
No, this is not driver specialty.
Ideally, the kernel image and modules should always be created with the same toolchain and compiler version.
Back to top
View user's profile Send private message
asturm
Developer
Developer


Joined: 05 Apr 2007
Posts: 6995
Location: Austria

PostPosted: Sun Jul 08, 2018 7:57 am    Post subject: Reply with quote

Yes, other missing modules are less fatal though. :)

In this case however it means that nvidia-drivers module must have been rebuilt after GCC switch, without rebuilding the kernel +modules. That information is missing from the first post. That stuff does not break automatically, and rebuilding the kernel without rebuilding nvidia-drivers would be equally fatal.

It is thus not an advice applicable for everyone, mostly for those relying on external kernel modules to print stuff on their screens. Maybe also ZFS users, but I suspect they are aware of the issue.
_________________
backend.cpp:92:2: warning: #warning TODO - this error message is about as useful as a cooling unit in the arctic


Last edited by asturm on Sun Jul 08, 2018 8:21 am; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43195
Location: 56N 3W

PostPosted: Sun Jul 08, 2018 8:14 am    Post subject: Reply with quote

nsoveiko,

To generaise your topic title, the kernel and all of its modules must be built with the same gcc version.
Modules built with a different gcc won't load and the module loader will leave an error message in dmesg.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7071

PostPosted: Sun Jul 08, 2018 11:09 am    Post subject: Reply with quote

are you sure neddy? i didn't test it, but this would mean binary modules must match kernel version and gcc version ; making virtually almost impossible to have binary modules working no?

i think the real issue with what user has done is that he have build gcc with reptoline and rebuild nvidia-drivers with reptoline, and rebuild (or not) the kernel with reptoline, but didn't install that kernel.

And you endup with nvidia-drivers trying to use a symbol (x86_indirect_thunk) over a kernel that doesn't provide that symbol.
Back to top
View user's profile Send private message
asturm
Developer
Developer


Joined: 05 Apr 2007
Posts: 6995
Location: Austria

PostPosted: Sun Jul 08, 2018 11:19 am    Post subject: Reply with quote

That is a good explanation for us not seeing such reports after every GCC update...
_________________
backend.cpp:92:2: warning: #warning TODO - this error message is about as useful as a cooling unit in the arctic
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43195
Location: 56N 3W

PostPosted: Sun Jul 08, 2018 12:17 pm    Post subject: Reply with quote

krinn,

I thought that the gcc version was in the "version magic" that that module loader checks.
Looking at a random module, it not there.
Code:
retpoline:      Y
intree:         Y
name:           snd_hda_intel
vermagic:       4.17.1-gentoo SMP preempt mod_unload modversions


Good call.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
nsoveiko
n00b
n00b


Joined: 04 Dec 2004
Posts: 47
Location: somewhere over the rainbow

PostPosted: Mon Jul 09, 2018 7:58 pm    Post subject: Reply with quote

krinn wrote:
i think the real issue with what user has done is that he have build gcc with reptoline and rebuild nvidia-drivers with reptoline, and rebuild (or not) the kernel with reptoline, but didn't install that kernel.

i didn't do any particular configuration for gcc, if 7.3 was built with reptoline, then it must have been the new defaults.

what actually happened was:
  • kernel was updated to gentoo-sources-4.4.128 on april 26 with current system compiler (which at the time was sys-devel/gcc-6.4.0-r1); nvidia-drivers were rebuilt for the new kernel at the same time
  • sys-devel/gcc was updated to 7.3.0-r3 on june 28, everything done by the book
  • on luly 3, a @world update saw there's a newer version of nvidia-drivers in the tree and installed it
  • after trying to modprobe the new nvidia module onto kernel compiled with gcc 6.4.0 got errors posted at the beginning of this thread

and i'm sorry i did not make it clear in the original post

btw, today i encountered another case of ABI incompatibility: media-video/vlc-3.0.3-r1 refused to build until i've rebuilt dev-libs/libebml-1.3.5 with gcc-7.3, see https://forums.gentoo.org/viewtopic-t-1077132-highlight-vlc.html for a similar problem
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43195
Location: 56N 3W

PostPosted: Mon Jul 09, 2018 8:07 pm    Post subject: Reply with quote

nsoveiko,

The kernel builds with reptoline by default, when gcc supports it.
reptoline was new in gcc-7.3

Here you have your old kernel and out of tree modules built with gcc-6.x, (no reptoline)
Then your out of tree nvidia module was built with reptoline (gcc-7.x)
Thats the kernel build system applying reptoline when it can.

There are some options that must be common between the kernel and all of its modules, reptoline must be one of those.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
nsoveiko
n00b
n00b


Joined: 04 Dec 2004
Posts: 47
Location: somewhere over the rainbow

PostPosted: Mon Jul 09, 2018 8:16 pm    Post subject: Reply with quote

NeddySeagoon wrote:
The kernel builds with reptoline by default, when gcc supports it.
reptoline was new in gcc-7.3

so the topic title should refer to gcc 7.3 only, not to any major gcc upgrade, right?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43195
Location: 56N 3W

PostPosted: Mon Jul 09, 2018 8:48 pm    Post subject: Reply with quote

nsoveiko,

In this case yes. It was only an issue for you as you updated an out of tree module (without the rest of the kernel) and happened to get an updated gcc meanwhile.
The reptoline capability was introduced in gcc-7.3. The kernel build system changed at about 4.15.0 but the reptoline patches have been back ported too.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum