[vbox-dev] Building Virtualbox using clang/llvm on Linux

Raghavan Santhanam raghavanil4m at gmail.com
Sun Apr 22 09:33:53 GMT 2018


I took a look, a month back, at the changes over there. Though it gave
something to start, at that point in
time, I saw there were more things to work upon to be able to build
VirtualBox using clang/LLVM
on Linux(Ubuntu) and resolve the dependencies with Qt. So, thereafter, I
started my effort from scratch for this
independent effort of mine.

Eventually, as of now, I have been able to successfully build VirtualBox
using clang/LLVM and bring it up
on Ubuntu 17.10 x86_64 with host clang-built kernel v4.16.3, along with
Qt5.10.1
which as well I built using clang/LLVM for VirtualBox GUI. For that, I had
to fix
a whole lot of issues around VirtualBox 5.2.8 and Qt 5.10.1. I will be
sharing the report next.

Cheers.

On Fri, Mar 16, 2018 at 3:05 AM, Bernhard Fröhlich <decke at bluelife.at>
wrote:

> On Fri, Mar 16, 2018 at 8:52 AM, Raghavan Santhanam
> <raghavanil4m at gmail.com> wrote:
> > Hello All,
> >
> > I wanted to know the feasibility of VirtualBox source to be built with
> > Clang/LLVM on Linux. As far as I researched, tried
> > and experimented so far, it turned out that there are many hard-coded
> > gcc/g++-specific Makefile variables, etc which I tried
> > to update beforehand via configure script. And also tried to work upon
> some
> > of the code that used non-standard VLAIS
> > that gcc supports as an extension but clang doesn't. With that, I was
> able
> > to some of the code with Clang/LLVM and still
> > there are some more to build that are likely to throw some more
> compilation
> > errors, etc due to gcc/clang extensions differences.
> > I also tried to reuse the MacOS/darwin settings(as an experiment) as it
> > seems to use Clang/LLVM as the compiler - but
> > appeared to require more effort than using Linux(OS) specific Makefile
> > settings to point to Clang/LLVM and get the build
> > going. So, before proceeding further, I wanted to know if there have been
> > attempts to build Virtualbox using Clang/LLVM
> > on Linux for Linux. I saw an old thread discussing about the same being
> > possible for FreeBSD. So, I tried to set the OS to
> > be FreeBSD and get going to see how far the build can go - it failed in
> the
> > first few steps when it didn't find some FreeBSD
> > specific settings which I had expected to happen as I am using Ubuntu
> 17.10
> > x86_64 as the host to build Virtualbox using
> > Clang/LLVM. So, any thoughts on this?
> >
> > By the way, I was successful in building all of the Virtualbox kernel
> > modules(vboxpci, vboxnetadp, vboxnetfltm, vboxdrv),
> > using Clang/LLVM and they are completely working as expected as I
> verified
> > the same by running Ubuntu 17.10 x86_64
> > as the guest within the installed Virtualbox(v5.2.8) on the same host
> Ubuntu
> > 17.10 x86_64 I am using for the above
> > Clang/LLVM/Virtualbox/Linux building process. Below are the metadata
> > embedded within these kernel modules showing
> > the compiler used to build them to be Clang/LLVM along with the other
> > details of host and VirtualBox guest to give a
> > better context in this regard.
> >
> > Cheers,
> > Raghavan Santhanam
>
> Yeah, we are building (most parts) with clang on FreeBSD since around
> virtualbox
> 4.3.10 so almost 4 years now. The commit back then which might give you a
> good
> summary of the changes is here:
>
> https://svnweb.freebsd.org/ports?view=revision&revision=349473
>
> Beware that also includes patches that are not clang relevant.
>
> --
> Bernhard Fröhlich
> http://www.bluelife.at/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.virtualbox.org/pipermail/vbox-dev/attachments/20180422/cb6b64e1/attachment.html>


More information about the vbox-dev mailing list