Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Kernel & Hardware
  • Search

Rebuild your kernel after upgrading GCC to 7.3!

Kernel not recognizing your hardware? Problems with power management or PCMCIA? What hardware is compatible with Gentoo? See here. (Only for kernels supported by Gentoo.)
Post Reply
Advanced search
14 posts • Page 1 of 1
Author
Message
nsoveiko
n00b
n00b
Posts: 53
Joined: Sat Dec 04, 2004 9:18 pm
Location: somewhere over the rainbow

Rebuild your kernel after upgrading GCC to 7.3!

  • Quote

Post by nsoveiko » Tue Jul 03, 2018 7:32 pm

today i decided to update the system and ended up with an unloadable nvidia-drivers module:

Code: Select all

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.
Top
asturm
Developer
Developer
Posts: 9496
Joined: Thu Apr 05, 2007 4:07 pm

  • Quote

Post by asturm » Tue Jul 03, 2018 7:43 pm

Looks like an nvidia-driver specialty.
Top
nsoveiko
n00b
n00b
Posts: 53
Joined: Sat Dec 04, 2004 9:18 pm
Location: somewhere over the rainbow

  • Quote

Post by nsoveiko » Tue Jul 03, 2018 8:24 pm

i'm willing to bet that this affects other external modules too (e.g. app-emulation/virtualbox-modules)
Top
Marcih
Apprentice
Apprentice
User avatar
Posts: 213
Joined: Mon Feb 19, 2018 6:16 pm

  • Quote

Post by Marcih » Wed Jul 04, 2018 8:19 am

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.
Top
Josef.95
Advocate
Advocate
Posts: 4857
Joined: Mon Sep 03, 2007 9:46 am
Location: Germany

Rebuild your kernel after major GCC upgrade!

  • Quote

Post by Josef.95 » Sun Jul 08, 2018 7:37 am

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.
Top
asturm
Developer
Developer
Posts: 9496
Joined: Thu Apr 05, 2007 4:07 pm

  • Quote

Post by asturm » Sun Jul 08, 2018 7:57 am

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.
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56104
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Sun Jul 08, 2018 8:14 am

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.
Top
krinn
Watchman
Watchman
User avatar
Posts: 7476
Joined: Fri May 02, 2003 6:14 am

  • Quote

Post by krinn » Sun Jul 08, 2018 11:09 am

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.
Top
asturm
Developer
Developer
Posts: 9496
Joined: Thu Apr 05, 2007 4:07 pm

  • Quote

Post by asturm » Sun Jul 08, 2018 11:19 am

That is a good explanation for us not seeing such reports after every GCC update...
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56104
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Sun Jul 08, 2018 12:17 pm

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: Select all

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.
Top
nsoveiko
n00b
n00b
Posts: 53
Joined: Sat Dec 04, 2004 9:18 pm
Location: somewhere over the rainbow

  • Quote

Post by nsoveiko » Mon Jul 09, 2018 7:58 pm

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 viewtopic-t-1077132-highlight-vlc.html for a similar problem
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56104
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Mon Jul 09, 2018 8:07 pm

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.
Top
nsoveiko
n00b
n00b
Posts: 53
Joined: Sat Dec 04, 2004 9:18 pm
Location: somewhere over the rainbow

  • Quote

Post by nsoveiko » Mon Jul 09, 2018 8:16 pm

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?
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56104
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Mon Jul 09, 2018 8:48 pm

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.
Top
Post Reply

14 posts • Page 1 of 1

Return to “Kernel & Hardware”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic