# clang build errors under VMware & VBox



## rihad (Feb 3, 2014)

After FreeBSD switched to clang as the system compiler building world/kernel either segfaults from time to time, or emits spurious errors:

```
/usr/src/lib/clang/libclangcodegen/../../../contrib/llvm/tools/clang/include/clang/Basic/ObjCRuntime.h:132:10: error: use of undeclared
      identifier 'Frage'
    case Frage;
```

Which in reality is     case FragileMacOSX: return false;

Running `make -DNOCLEAN buildworld` again usually stops later at some other point.

GCC never gave such errors on this same host's hardware. I could source upgrade FreeBSD 9.x to 10 with no problems.

At first I thought it was a VMware issue, so today I tried the same rebuild in VirtualBox - same strange errors. You may say my PC has got faulty RAM, but VM is the only place these errors are encountered in. I run Firefox with almost 1 gig memory footprint plus other software without problems, and can dual boot Windows 7 and play modern demanding 3D games like Assassin's Creed 3 without a hitch.

My host PC is a multiboot Debian Wheezy & Win7.


----------



## estrabd (Feb 4, 2014)

Are you upgrading from 9.x to 10?


----------



## rihad (Feb 5, 2014)

estrabd said:
			
		

> Are you upgrading from 9.x to 10?


Not only that, simply installing the 10.0 release distribution of FreeBSD (bare server, no desktop), fetching /usr/src with `svnlite` and trying to rebuild as outlined in the Makefile will sooner or later get you similar errors under VMware or VirtualBox. Haven't tried on a normal PC. I don't remember this happening even once when the system compiler was gcc. Is there a way to force the use of gcc?


----------



## estrabd (Feb 5, 2014)

Surely there is, I just don't know what knobs to hit.


----------



## junovitch@ (Feb 7, 2014)

I don't know about VMWare but there is a known issue with i386 and Virtualbox documented in the release notes.  `http://www.freebsd.org/releases/10.0R/errata.html`


----------



## rihad (Feb 7, 2014)

Thanks, junovitch, just did a rebuild with that setting enforced - no probems at all in VMware!
This is probably the bug: misc/185487: Corrupted files with vfs.unmapped_buf_allowed=1, detected when running under a VM and only in FreeBSD 10.0.
I wonder what the consequences of disabling this option are? Reduced disk performance? Doesn't really bother me on a VM used for testing purposes, but I hope this bug never makes it to the real hardware...


----------

