[Solved] Tools and Drivers do not compile on SL7

Discussions related to using VirtualBox on Linux hosts.
Post Reply
GZU
Posts: 6
Joined: 21. Dec 2015, 02:19

[Solved] Tools and Drivers do not compile on SL7

Post by GZU »

Hi,
With updated kernel in SL7 (and I assume CentOS7 and RHEL7) 3.10.0-693.21.1.el7.x86_64 drivers (and tools on linux guest) no longer compile.
Looks like it is due to REPTOLINE kernel changes.

make V=1 CONFIG_MODULE_SIG= -C /lib/modules/3.10.0-693.21.1.el7.x86_64/build SUBDIRS=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 -j12 modules
arch/x86/Makefile:166: *** CONFIG_RETPOLINE=y, but not supported by the compiler. Toolchain update recommended.. Stop.
make: *** [vboxdrv] Error 2

I can reboot in previous kernel as a workaround.
Any other suggestions.

Thanks,

GZU
Last edited by socratis on 13. May 2018, 17:53, edited 1 time in total.
Reason: Marked as [Solved].
andyp73
Volunteer
Posts: 1631
Joined: 25. May 2010, 23:48
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Assorted Linux, Windows Server 2012, DOS, Windows 10, BIOS/UEFI emulation

Re: Tools and Drivers do not compile on SL7

Post by andyp73 »

If you want to add modules into a kernel that is built with retpoline support then you will need to follow the advice of the error message and update your toolchain to a version that does.

-Andy.
My crystal ball is currently broken. If you want assistance you are going to have to give me all of the necessary information.
Please don't ask me to do your homework for you, I have more than enough of my own things to do.
denesberta
Posts: 1
Joined: 9. Mar 2018, 13:40

Re: Tools and Drivers do not compile on SL7

Post by denesberta »

I happen to have the same issue. I have just install SL7.4 I updated what came across but nothing changed.
GZU
Posts: 6
Joined: 21. Dec 2015, 02:19

Re: Tools and Drivers do not compile on SL7

Post by GZU »

Hi,

No Issues in SL6, there is a difference in the Makefile regarding SPECTRE.
SL6 reports issue and continues.

/lib/modules/3.10.0-693.21.1.el7.x86_64/build/arch/x86/Makefile

See commented out SL7 (at line 166) and inserted SL6, and rerun /sbin/vboxconfig.
This is a hack so on your own head be it (or use previous kernel).

Code: Select all

# Avoid indirect branches in kernel to deal with Spectre
#ifdef CONFIG_RETPOLINE
#    RETPOLINE_CFLAGS += $(call cc-option,-mindirect-branch=thunk-extern -mindirect-branch-register)
#    ifneq ($(RETPOLINE_CFLAGS),)
#        KBUILD_CFLAGS += $(RETPOLINE_CFLAGS) -DRETPOLINE
#    else
#        $(error CONFIG_RETPOLINE=y, but not supported by the compiler. Toolchain update recommended.)
#    endif
#endif


# Avoid indirect branches in kernel to deal with Spectre
ifdef CONFIG_RETPOLINE
    RETPOLINE_CFLAGS += $(call cc-option,-mindirect-branch=thunk-extern -mindirect-branch-register)
    ifneq ($(RETPOLINE_CFLAGS),)
        KBUILD_CFLAGS += $(RETPOLINE_CFLAGS) -DRETPOLINE
    else
        # Fail brew build, but let other users proceed with warning
        RETPOLINE_MSG := CONFIG_RETPOLINE=y, but not supported by the compiler. Toolchain update recommended.
        KBUILD_USER := $(shell id -un)
        ifeq ($(KBUILD_USER), mockbuild)
            $(error $(RETPOLINE_MSG))
        else
            $(warning $(RETPOLINE_MSG))
        endif
    endif
endif

GZU
Jim1742
Posts: 1
Joined: 13. May 2018, 17:20

Re: Tools and Drivers do not compile on SL7

Post by Jim1742 »

I'm running CentOS 7.4. Host is running windows 10 pro.

After a CentOS system update (automatic), display went back to low resolution. I tried to rebuild guest addition 5.2.8 and got the same error: CONFIG_RETPOLINE=y....upgrade compiler. I first upgraded make to v4.2.1 (was v3.8.2). This didn't help much.

I then upgraded the compiler to gcc v8.1 (was v6.1) and virtual box & guest addition to 5.2.12, the problem went away. There is a post saying RETPOLINE is supported by gcc v7.3 and later.

This took me quite a while. Hope it's useful to someone.
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Tools and Drivers do not compile on SL7

Post by socratis »

@Jim1742
Thank you for the feedback and the solution, hope someone finds it useful in the future. Marking as [Solved].
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Post Reply