Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: VirtualBox-6.0.6 fails build under 8.99.39



On Fri, 31 May 2019 at 02:07, Joerg Sonnenberger <joerg%bec.de@localhost> wrote:
>
> On Thu, May 30, 2019 at 09:32:24PM +0100, Chavdar Ivanov wrote:
> > error: 'asm' undeclared (first use in this function)
> >   asm volatile ("pause");
> >   ^~~
> > ...............
> >
> > (I had to revert to the original cpufunc.h as the cvs update was failing).
> >
> > What is the solution here - should I continue to locally modify
> > cpufunc.h from the NetBSD src/sys/arch/x86/include/ ? What is the
> > purpose of having 'asm volatile' if __asm__ does the job (and volatile
> > is a NOP anyway, according to the gcc manual, it is considered
> > volatile without the keyword)?
>
> volatile is *not* a nop. It prevents the statement from being optimised
> away as having no side effects.

Yes. I meant I saw discussions stating that the compiler treats all
basic asm blocks as having the volatile keyword anyway.

Perhaps it may depend on the gcc version as well.

The query was about what is the right thing to do - should VirtualBox
change the gcc command line ( it uses '-std=c99', as I understand it
this is the reasxon it does not work ), should cpufunc.h be modified
to allow for such treatment, or should I simply maintain a second copy
of cpufunc.h to put in place only when building VirtualBox extensions
( which is what I do now, kinda stupid ).

>
> Joerg



-- 
----


Home | Main Index | Thread Index | Old Index