Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Feb 2023 18:27:12 +0000
From:      Brooks Davis <brooks@freebsd.org>
To:        Kevin Oberman <rkoberman@gmail.com>
Cc:        "freebsd-emulation@freebsd.org" <emulation@freebsd.org>
Subject:   Re: virtualbon-ose-kmod build fails with 14-CURRENT and llvm15
Message-ID:  <Y/z2AGoKZ5gtu0Ks@spindle.one-eyed-alien.net>
In-Reply-To: <CAN6yY1td9cRtj3BzMw-eAHS4HCAv049w3rjOpmjq-fCpmfp2Pw@mail.gmail.com>
References:  <CAN6yY1td9cRtj3BzMw-eAHS4HCAv049w3rjOpmjq-fCpmfp2Pw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Feb 26, 2023 at 09:45:34AM -0800, Kevin Oberman wrote:
> I updated my system yesterday. I then tried to rebuild virtualbox-ose-kmo=
d.
> This fails under llvm15. The same source code built successfully with
> llvm14, so I assume that the code has a problem with 15. I suspect that 15
> changed some default and declared this as an error, but may be "fixed" wi=
th
> the proper build option.
>=20
> Here is the command and error that I see:
>=20
> cc  -O2 -pipe -fno-strict-aliasing -DRT_OS_FREEBSD -DIN_RING0 -DIN_RT_R0
> -DIN_SUP_R0 -DSUPDRV_WITH_RELEASE_LOGGER -DVBOX -DRT_WITH_VBOX -w
> -DVBOX_WITH_HARDENING -DVBOX_WITH_64_BITS_GUESTS -DRT_ARCH_AMD64  -Werror
> -D_KERNEL -DKLD_MODULE -nostdinc  -Iinclude -I. -Ir0drv -include
> /usr/ports/emulators/virtualbox-ose-kmod/work/VirtualBox-6.1.36/out/freeb=
sd.amd64/release/bin/src/vboxdrv/opt_global.h
> -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -fno-common
>  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer
> -fdebug-prefix-map=3D./machine=3D/usr/src/sys/amd64/include
> -fdebug-prefix-map=3D./x86=3D/usr/src/sys/x86/include
> -fdebug-prefix-map=3D./i386=3D/usr/src/sys/i386/include     -MD
>  -MF.depend.SUPDrv-freebsd.o -MTSUPDrv-freebsd.o -mcmodel=3Dkernel
> -mno-red-zone -mno-mmx -mno-sse -msoft-float
>  -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector
> -Wall -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes
> -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign
> -D__printf__=3D__freebsd_kprintf__ -Wmissing-include-dirs
> -fdiagnostics-show-option -Wno-unknown-pragmas
> -Wno-error=3Dtautological-compare -Wno-error=3Dempty-body
> -Wno-error=3Dparentheses-equality -Wno-error=3Dunused-function
> -Wno-error=3Dpointer-sign -Wno-error=3Dshift-negative-value
> -Wno-address-of-packed-member -Wno-error=3Darray-parameter
> -Wno-error=3Ddeprecated-non-prototype -Wno-error=3Dstrict-prototypes
> -Wno-error=3Dunused-but-set-variable -Wno-format-zero-length   -mno-aes
> -mno-avx  -std=3Diso9899:1999 -c
> /usr/ports/emulators/virtualbox-ose-kmod/work/VirtualBox-6.1.36/out/freeb=
sd.amd64/release/bin/src/vboxdrv/freebsd/SUPDrv-freebsd.c
> -o SUPDrv-freebsd.o
> /usr/ports/emulators/virtualbox-ose-kmod/work/VirtualBox-6.1.36/out/freeb=
sd.amd64/release/bin/src/vboxdrv/freebsd/SUPDrv-freebsd.c:433:50:
> error: incompatible pointer to integer conversion passing 'void *' to
> parameter of type 'RTR3PTR' (aka 'unsigned long') [-Wint-conversion]
>         if (RT_FAILURE(RTR0MemUserCopyFrom(&Hdr, pvUser, sizeof(Hdr))))
>                                                  ^~~~~~
> include/iprt/errcore.h:99:58: note: expanded from macro 'RT_FAILURE'
>=20
> Any help appreciated. I really need virtualbox. I think I may force it to
> build with llvm14, but I's prefer a fix to build with llvm15.

Assuming the code works in practice, it should just be a matter of
adding a cast (void *)(uintptr_t)pvUser.

-- Brooks



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Y/z2AGoKZ5gtu0Ks>