Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Dec 2018 02:00:00 -0800
From:      <soralx@cydem.org>
To:        <jkim@FreeBSD.org>, <adamw@FreeBSD.org>
Cc:        <vbox@FreeBSD.org>
Subject:   Re: [virtualbox-ose] Build failure: global register variable
Message-ID:  <20181205020000.644a2776@mscad14>
In-Reply-To: <efc31521-4095-8752-dd10-ab7fa5777c0e@FreeBSD.org>
References:  <20170917195419.431341e7@mscad14> <20170920191710.58d335df@mscad14> <20170921160000.689755f8@mscad14> <5c68323f-5fed-342b-ad92-e74d178f9daf@FreeBSD.org> <20170924180619.23e149be@mscad14> <6b02f95f-207b-0f55-8e30-11512979804e@FreeBSD.org> <20170928025555.032ce67a@mscad14> <efc31521-4095-8752-dd10-ab7fa5777c0e@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

 I see that 'pkg-help' was added to devel/kBuild explaining the new
 GCC option.

 I think that the help text can be expanded to say that kBuild and
 virtualbox-ose can be compiled with clang (i.e., without using gcc)
 when the virtual machines use hardware virtualization (VT-x/AMD-V)
 exclusively. Jung-uk's patches would have to be included for the
 emulators/virtualbox-ose port & an option added, but this set-up
 works for those who would like to avoid using gcc for VirtualBox.

P.S.: I've been forced to use the old VirtualBox 5.1.30 for quite a
      while now, because of the annoying Linux dbus dependency. But
      recently I've managed to compile and run the latest port with
      out dbus. Perhaps I can submit the patches, if there is some
      interest in cleaning them up and adding a DBUS option?

> >>>>> [0] clang/lib/Basic/Targets/X86.h:
> >>>>>   860   bool validateGlobalRegisterVariable(StringRef RegName,
> >>>>> unsigned RegSize, 861                                       bool
> >>>>> &HasSizeMismatch) const override { 862     // rsp and rbp are the
> >>>>> only 64-bit registers the x86 backend can currently 863     //
> >>>>> handle. 864     if (RegName.equals("rsp") ||
> >>>>> RegName.equals("rbp")) { 865       // Check that the register
> >>>>> size is 64-bit. 866       HasSizeMismatch = RegSize != 64;
> >>>>>   867       return true;
> >>>>>   868     }      
> >>>>
> >>>> Please try the attached patch.    
> >>>
> >>> Thanks for the patch! I gave it a quick try (not an extensive test),
> >>> and VirtualBox, compiled fully with clang, seems to work as
> >>> usual.    
> >>
> >> Committed (r450636), thanks!  
> > 
> > Sadly, I forgot to disable VT-x when testing. My bad.
> > 
> > I tested again, and found that, on unpatched VBox, the virtual
> > machine boots and works fine with both VT-x on and off, while
> > patched version fails to start the VM when VT-x is turned off:
> >   VBoxManage: error: No error info
> >   VBoxManage: error: Details: code NS_ERROR_CALL_FAILED (0x800706be),
> >                      component ProgressProxy, interface IProgress
> > 
> > How would one go about debugging this?  
> 
> Hmm...  Unfortunately, I don't think we can "fix" it easily.  I'll take
> a look but I just reverted it for now.
> 
> Jung-uk Kim
> 
> >> For more detailed information, please read the commit log.
> >>
> >> https://svnweb.freebsd.org/changeset/ports/45063  

-- 
[SorAlx]  ridin' VN2000 Classic LT



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