View previous topic :: View next topic |
Author |
Message |
nsoveiko n00b

Joined: 04 Dec 2004 Posts: 53 Location: somewhere over the rainbow
|
Posted: Tue Jul 03, 2018 7:32 pm Post subject: Rebuild your kernel after upgrading GCC to 7.3! |
|
|
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.
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 |
|
 |
asturm Developer

Joined: 05 Apr 2007 Posts: 9373
|
Posted: Tue Jul 03, 2018 7:43 pm Post subject: |
|
|
Looks like an nvidia-driver specialty. |
|
Back to top |
|
 |
nsoveiko n00b

Joined: 04 Dec 2004 Posts: 53 Location: somewhere over the rainbow
|
Posted: Tue Jul 03, 2018 8:24 pm Post subject: |
|
|
i'm willing to bet that this affects other external modules too (e.g. app-emulation/virtualbox-modules) |
|
Back to top |
|
 |
Marcih Apprentice


Joined: 19 Feb 2018 Posts: 213
|
Posted: Wed Jul 04, 2018 8:19 am Post subject: |
|
|
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. |
NeddySeagoon wrote: | The problem with leaving is that you can only do it once and it reduces your influence. |
|
|
Back to top |
|
 |
Josef.95 Advocate

Joined: 03 Sep 2007 Posts: 4730 Location: Germany
|
Posted: Sun Jul 08, 2018 7:37 am Post subject: Rebuild your kernel after major GCC upgrade! |
|
|
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 |
|
 |
asturm Developer

Joined: 05 Apr 2007 Posts: 9373
|
Posted: Sun Jul 08, 2018 7:57 am Post subject: |
|
|
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.
Last edited by asturm on Sun Jul 08, 2018 8:21 am; edited 1 time in total |
|
Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 55145 Location: 56N 3W
|
Posted: Sun Jul 08, 2018 8:14 am Post subject: |
|
|
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 |
|
 |
krinn Watchman


Joined: 02 May 2003 Posts: 7471
|
Posted: Sun Jul 08, 2018 11:09 am Post subject: |
|
|
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 |
|
 |
asturm Developer

Joined: 05 Apr 2007 Posts: 9373
|
Posted: Sun Jul 08, 2018 11:19 am Post subject: |
|
|
That is a good explanation for us not seeing such reports after every GCC update... |
|
Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 55145 Location: 56N 3W
|
Posted: Sun Jul 08, 2018 12:17 pm Post subject: |
|
|
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 |
|
 |
nsoveiko n00b

Joined: 04 Dec 2004 Posts: 53 Location: somewhere over the rainbow
|
Posted: Mon Jul 09, 2018 7:58 pm Post subject: |
|
|
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 |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 55145 Location: 56N 3W
|
Posted: Mon Jul 09, 2018 8:07 pm Post subject: |
|
|
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 |
|
 |
nsoveiko n00b

Joined: 04 Dec 2004 Posts: 53 Location: somewhere over the rainbow
|
Posted: Mon Jul 09, 2018 8:16 pm Post subject: |
|
|
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 |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 55145 Location: 56N 3W
|
Posted: Mon Jul 09, 2018 8:48 pm Post subject: |
|
|
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 |
|
 |
|