From nobody Mon Feb 27 22:58:44 2023 X-Original-To: emulation@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PQbXQ3qmZz3tHK7 for ; Mon, 27 Feb 2023 22:59:02 +0000 (UTC) (envelope-from kob6558@gmail.com) Received: from mail-yw1-x112e.google.com (mail-yw1-x112e.google.com [IPv6:2607:f8b0:4864:20::112e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PQbXQ1pvLz3t1M; Mon, 27 Feb 2023 22:59:02 +0000 (UTC) (envelope-from kob6558@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-yw1-x112e.google.com with SMTP id 00721157ae682-536be69eadfso221725547b3.1; Mon, 27 Feb 2023 14:59:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=/cV1OviTvRswe69mvftejq5Op2kK5NnLQ2mDyCckLac=; b=njLRZgJHOsHsF2WOOfrgACv9Q3OeT/mJzKj+8xUm/VoRTZQNyKomzxoTvnWx21w/OV oA2IV7N8tWkJgJdK53A7baNS65Q8L+Wi6kJi43J8+nYusnuOESKwI7J1KVnnFFMCdfwt FK3SBpOEyNicA1TvpmYYPjR6JCZZyukxveQJuGCIuNdherVIwKta63EDVu0Z2pag4bUp T6sTpshZE4v+jaFY56BSfvItB/CdkzudDFcxpDwTt1qcff6q2etd7KApEKbhLDft0tjw uR52Q8FUwQDavjWhliIcCd893lwSW8TmKVhIwrCvPvX56V0aopBQjd3PDiqtopoyNpeL DNwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/cV1OviTvRswe69mvftejq5Op2kK5NnLQ2mDyCckLac=; b=4zHsfX5AhbNzWnhAfpDeBBGgCBxfGEMYwu9QMZIphOvRtsucVdPGE3KaYEazepIKOZ KsNfrSWZo0wuAuo1U1Yayimf9bZgxGs/Umx4eYw+AoPOW9XwA+jygodgsTmF4f8hrQQl z5cbdgijatlEiURgezV4poPeVnnIa1YcYhZ7gU/b+0bdIYK+crSqezct2ORVza05Kpf2 EM3D6t6+r+IvZFYiCrmTzovXDMJ/XelAnAOdp6dhwuuyWrG6875Nr0zpLrJfF8XFUgVD mhpaQmcLh5JPFKTd/bfo9lZ9f9FGCVmY2gM3N233kb5axmrzWyrRt5cr67qxvN3LQpG0 DOvA== X-Gm-Message-State: AO0yUKUgY3mWkDfUj1aay8mC7RWlRMgx1h0wGd1QtdaMav4I4r8uoIG9 Dw2ft4veGCCKK2F7M5dt576YE1t1kzAxdP+Dgz3F1k7rjes= X-Google-Smtp-Source: AK7set+bk3+KKZh4YkTC+eyxOi38zuiboVVg9W9qqt9rWsHC79rab1tp0sGYry8FN9sGXD5ettEhBMZGx726juCqFaU= X-Received: by 2002:a05:6902:4c2:b0:8ea:3d09:b125 with SMTP id v2-20020a05690204c200b008ea3d09b125mr220381ybs.0.1677538740242; Mon, 27 Feb 2023 14:59:00 -0800 (PST) List-Id: Development of Emulators of other operating systems List-Archive: https://lists.freebsd.org/archives/freebsd-emulation List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-emulation@freebsd.org MIME-Version: 1.0 References: In-Reply-To: From: Kevin Oberman Date: Mon, 27 Feb 2023 14:58:44 -0800 Message-ID: Subject: Re: virtualbon-ose-kmod build fails with 14-CURRENT and llvm15 To: Brooks Davis Cc: "freebsd-emulation@freebsd.org" Content-Type: multipart/alternative; boundary="000000000000b58b6b05f5b66c56" X-Rspamd-Queue-Id: 4PQbXQ1pvLz3t1M X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --000000000000b58b6b05f5b66c56 Content-Type: text/plain; charset="UTF-8" On Mon, Feb 27, 2023 at 10:27 AM Brooks Davis wrote: > 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-kmod. > > 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" > with > > the proper build option. > > > > Here is the command and error that I see: > > > > 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/freebsd.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=./machine=/usr/src/sys/amd64/include > > -fdebug-prefix-map=./x86=/usr/src/sys/x86/include > > -fdebug-prefix-map=./i386=/usr/src/sys/i386/include -MD > > -MF.depend.SUPDrv-freebsd.o -MTSUPDrv-freebsd.o -mcmodel=kernel > > -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__=__freebsd_kprintf__ -Wmissing-include-dirs > > -fdiagnostics-show-option -Wno-unknown-pragmas > > -Wno-error=tautological-compare -Wno-error=empty-body > > -Wno-error=parentheses-equality -Wno-error=unused-function > > -Wno-error=pointer-sign -Wno-error=shift-negative-value > > -Wno-address-of-packed-member -Wno-error=array-parameter > > -Wno-error=deprecated-non-prototype -Wno-error=strict-prototypes > > -Wno-error=unused-but-set-variable -Wno-format-zero-length -mno-aes > > -mno-avx -std=iso9899:1999 -c > > > /usr/ports/emulators/virtualbox-ose-kmod/work/VirtualBox-6.1.36/out/freebsd.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/freebsd.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' > > > > 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 > Thanks to both of you. Fixing the code seems preferable to patching and rebuilding llvm15, so I tried, but it made no difference, other than the cast, but I may have truncated the error message too soon. Here is the complete message after the patch: /usr/ports/emulators/virtualbox-ose-kmod/work/VirtualBox-6.1.36/out/freebsd.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, (void *)(uintptr_t)pvUser, sizeof(Hdr)))) ^~~~~~~~~~~~~~~~~~~~~~~~~ include/iprt/errcore.h:99:58: note: expanded from macro 'RT_FAILURE' #define RT_FAILURE(rc) ( RT_UNLIKELY(!RT_SUCCESS_NP(rc)) ) ^~ include/iprt/errcore.h:80:38: note: expanded from macro 'RT_SUCCESS_NP' # define RT_SUCCESS_NP(rc) ( (int)(rc) >= VINF_SUCCESS ) ^~ include/iprt/cdefs.h:1826:53: note: expanded from macro 'RT_UNLIKELY' # define RT_UNLIKELY(expr) __builtin_expect(!!(expr), 0) ^~~~ include/iprt/mem.h:756:56: note: passing argument to parameter 'R3PtrSrc' here RTR0DECL(int) RTR0MemUserCopyFrom(void *pvDst, RTR3PTR R3PtrSrc, size_t cb); ^ Please understand that I am not a C programmer. Looking at this leaves me a bit lost. -- Kevin Oberman, Part time kid herder and retired Network Engineer E-mail: rkoberman@gmail.com PGP Fingerprint: D03FB98AFA78E3B78C1694B318AB39EF1B055683 --000000000000b58b6b05f5b66c56 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, Feb 27, 2023 at 10:27 A= M Brooks Davis <brooks@freebsd.org= > wrote:
On Sun, Feb 26, 2023 at 09:45:34AM -0800, Kevi= n Oberman wrote:
> I updated my system yesterday. I then tried to rebuild virtualbox-ose-= kmod.
> This fails under llvm15. The same source code built successfully with<= br> > llvm14, so I assume that the code has a problem with 15. I suspect tha= t 15
> changed some default and declared this as an error, but may be "f= ixed" with
> the proper build option.
>
> Here is the command and error that I see:
>
> cc=C2=A0 -O2 -pipe -fno-strict-aliasing -DRT_OS_FREEBSD -DIN_RING0 -DI= N_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=C2=A0= -Werror
> -D_KERNEL -DKLD_MODULE -nostdinc=C2=A0 -Iinclude -I. -Ir0drv -include<= br> > /usr/ports/emulators/virtualbox-ose-kmod/work/VirtualBox-6.1.36/out/fr= eebsd.amd64/release/bin/src/vboxdrv/opt_global.h
> -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -fno-common
>=C2=A0 -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=C2=A0 =C2=A0 = =C2=A0-MD
>=C2=A0 -MF.depend.SUPDrv-freebsd.o -MTSUPDrv-freebsd.o -mcmodel=3Dkerne= l
> -mno-red-zone -mno-mmx -mno-sse -msoft-float
>=C2=A0 -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-p= rotector
> -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=C2=A0 =C2= =A0-mno-aes
> -mno-avx=C2=A0 -std=3Diso9899:1999 -c
> /usr/ports/emulators/virtualbox-ose-kmod/work/VirtualBox-6.1.36/out/fr= eebsd.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/fr= eebsd.amd64/release/bin/src/vboxdrv/freebsd/SUPDrv-freebsd.c:433:50:
> error: incompatible pointer to integer conversion passing 'void *&= #39; to
> parameter of type 'RTR3PTR' (aka 'unsigned long') [-Wi= nt-conversion]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (RT_FAILURE(RTR0MemUserCopyFrom(&a= mp;Hdr, pvUser, sizeof(Hdr))))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^~~~~~
> include/iprt/errcore.h:99:58: note: expanded from macro 'RT_FAILUR= E'
>
> 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
=C2=A0
Thanks to both o= f you. Fixing the code seems preferable to patching and rebuilding llvm15, = so I tried, but it made no difference, other than the cast, but I may have = truncated the error message too soon. Here is the complete message after th= e patch:
/usr/ports/emulators/virtualbox-ose-kmod/work/Virtu= alBox-6.1.36/out/freebsd.amd64/release/bin/src/vboxdrv/freebsd/SUPDrv-freeb= sd.c:433:50: error: incompatible pointer to integer conversion passing '= ;void *' to parameter of type 'RTR3PTR' (aka 'unsigned long= ') [-Wint-conversion]
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 if (RT_FAILURE(RTR0MemUserCopyFrom(&Hdr, (void *)(= uintptr_t)pvUser, sizeof(Hdr))))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0^~~~~~~~~~~~~= ~~~~~~~~~~~~
include/iprt/errcore.h:99:58: note: expanded from macro = 9;RT_FAILURE'
#define RT_FAILURE(rc) =C2=A0 =C2=A0 =C2=A0( RT_UNLIKE= LY(!RT_SUCCESS_NP(rc)) )
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0^~
include/iprt/errcore.h:80:38: note: expanded from macro = 9;RT_SUCCESS_NP'
# define RT_SUCCESS_NP(rc) =C2=A0 ( (int)(rc) >= =3D VINF_SUCCESS )
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0^~
include/iprt/cdefs.h:1826:53: note: expanded from macro 'RT= _UNLIKELY'
# =C2=A0define RT_UNLIKELY(expr) =C2=A0 =C2=A0 __builtin_= expect(!!(expr), 0)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^~~~
include/ipr= t/mem.h:756:56: note: passing argument to parameter 'R3PtrSrc' here=
RTR0DECL(int) RTR0MemUserCopyFrom(void *pvDst, RTR3PTR R3PtrSrc, size_t= cb);
=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 ^

Please understand that I am not a C programmer.=C2=A0 Looking at this = leaves me a bit lost.
--
Kevin Oberman, Part time kid herder and= retired Network Engineer
E-mail: rkoberman@gmail.com
PGP Fingerprint: D= 03FB98AFA78E3B78C1694B318AB39EF1B055683
=
--000000000000b58b6b05f5b66c56--