VirtualBox

Changeset 95409 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jun 28, 2022 5:23:38 PM (3 years ago)
Author:
vboxsync
Message:

Linux host and guest drivers: detect clang, bugref:10247.

Make rcvboxdrv and rcvboxadd to be able to detect if
kernel was build with clang and trigger kernel build
system to compile VBox modules with clang.

Location:
trunk/src/VBox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/linux/installer/vboxadd.sh

    r94308 r95409  
    290290    export KERN_VER
    291291    info "Building the modules for kernel $KERN_VER."
     292
     293    # Detect if kernel was built with clang.
     294    unset LLVM
     295    vbox_cc_is_clang=$(/lib/modules/"$KERN_VER"/build/scripts/config \
     296        --file /lib/modules/"$KERN_VER"/build/.config \
     297        --state CONFIG_CC_IS_CLANG 2>/dev/null)
     298    if test "${vbox_cc_is_clang}" = "y"; then
     299        info "Using clang compiler."
     300        export LLVM=1
     301    fi
    292302
    293303    log "Building the main Guest Additions $INSTALL_VER module for kernel $KERN_VER."
  • trunk/src/VBox/Installer/linux/vboxdrv.sh

    r93115 r95409  
    532532    begin_msg "Building VirtualBox kernel modules" console
    533533    log "Building the main VirtualBox module."
     534
     535    # Detect if kernel was built with clang.
     536    unset LLVM
     537    vbox_cc_is_clang=$(/lib/modules/"$KERN_VER"/build/scripts/config \
     538        --file /lib/modules/"$KERN_VER"/build/.config \
     539        --state CONFIG_CC_IS_CLANG 2>/dev/null)
     540    if test "${vbox_cc_is_clang}" = "y"; then
     541        log "Using clang compiler."
     542        export LLVM=1
     543    fi
     544
    534545    if ! myerr=`$BUILDINTMP \
    535546        --save-module-symvers /tmp/vboxdrv-Module.symvers \
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette