# /usr/src/lib/clang/libllvmsupport  error, error and error



## bryn1u (Jan 3, 2014)

Hi,

I'm fighting with FreeBSD 9.2 64-bit. I tried everything, *I* can't `make buildworld`.

I did:

`screen svn co [url=svn://svn.freebsd.org/base/releng/9.2]svn://svn.freebsd.org/base/releng/9.2[/url] /usr/src`
`screen make buildworld`
And got:

```
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/raw_os_ostream.cpp:14:41: error: llvm/Support/raw_os_ostream.h: No such file or directory
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/raw_ostream.cpp:14:38: error: llvm/Support/raw_ostream.h: No such file or directory
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/raw_ostream.cpp:15:32: error: llvm/ADT/STLExtras.h: No such file or directory
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/raw_ostream.cpp:16:34: error: llvm/ADT/SmallVector.h: No such file or directory
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/raw_ostream.cpp:17:35: error: llvm/ADT/StringExtras.h: No such file or directory
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/raw_ostream.cpp:18:32: error: llvm/Config/config.h: No such file or directory
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/raw_ostream.cpp:19:35: error: llvm/Support/Compiler.h: No such file or directory
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/raw_ostream.cpp:20:40: error: llvm/Support/ErrorHandling.h: No such file or directory
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/raw_ostream.cpp:21:33: error: llvm/Support/Format.h: No such file or directory
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/raw_ostream.cpp:22:34: error: llvm/Support/Process.h: No such file or directory
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/raw_ostream.cpp:23:34: error: llvm/Support/Program.h: No such file or directory
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/raw_ostream.cpp:24:39: error: llvm/Support/system_error.h: No such file or directory
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/system_error.cpp:14:39: error: llvm/Support/system_error.h: No such file or directory
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/system_error.cpp:15:32: error: llvm/Support/Errno.h: No such file or directory
mkdep: compile failed
*** [.depend] Error code 1

Stop in /usr/src/lib/clang/libllvmsupport.
*** [bootstrap-tools] Error code 1

Stop in /usr/src.
*** [_bootstrap-tools] Error code 1

Stop in /usr/src.
*** [buildworld] Error code 1

Stop in /usr/src.

[screen is terminating]
root@ks3360102:/usr/src #
```
Next step:

```
cd /usr/src
rm -rf *
svn cleanup
make clean
screen svn co svn://svn.freebsd.org/base/releng/9.2 /usr/src
screen make buildwrold
```
And of course got f... an error:

```
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/raw_os_ostream.cpp:14:41: error: llvm/Support/raw_os_ostream.h: No such file or directory
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/raw_ostream.cpp:14:38: error: llvm/Support/raw_ostream.h: No such file or directory
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/raw_ostream.cpp:15:32: error: llvm/ADT/STLExtras.h: No such file or directory
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/raw_ostream.cpp:16:34: error: llvm/ADT/SmallVector.h: No such file or directory
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/raw_ostream.cpp:17:35: error: llvm/ADT/StringExtras.h: No such file or directory
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/raw_ostream.cpp:18:32: error: llvm/Config/config.h: No such file or directory
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/raw_ostream.cpp:19:35: error: llvm/Support/Compiler.h: No such file or directory
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/raw_ostream.cpp:20:40: error: llvm/Support/ErrorHandling.h: No such file or directory
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/raw_ostream.cpp:21:33: error: llvm/Support/Format.h: No such file or directory
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/raw_ostream.cpp:22:34: error: llvm/Support/Process.h: No such file or directory
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/raw_ostream.cpp:23:34: error: llvm/Support/Program.h: No such file or directory
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/raw_ostream.cpp:24:39: error: llvm/Support/system_error.h: No such file or directory
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/system_error.cpp:14:39: error: llvm/Support/system_error.h: No such file or directory
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/system_error.cpp:15:32: error: llvm/Support/Errno.h: No such file or directory
mkdep: compile failed
*** [.depend] Error code 1

Stop in /usr/src/lib/clang/libllvmsupport.
*** [bootstrap-tools] Error code 1

Stop in /usr/src.
*** [_bootstrap-tools] Error code 1

Stop in /usr/src.
*** [buildworld] Error code 1

Stop in /usr/src.

[screen is terminating]
root@ks3360102:/usr/src #
```

What's wrong people? I'm so angry! I read the tutorial, handbook and nothing helped.

My /etc/make.conf

```
root@ks3360102:/usr/src # cat /etc/make.conf
WITH_PKGNG=yes

# added by use.perl 2012-01-18 18:20:28
PERL_VERSION=5.14.1
CFLAGS=-fstack-protector-all
CXXFLAGS=-fstack-protector-all
WITHOUT_GUI=YES
WITHOUT_X11=YES
WITHOUT_XPM=YES
```


----------



## kpa (Jan 3, 2014)

*Re: /usr/src/lib/clang/libllvmsupport  error, error and erro*

You are overriding CFLAGS and CXXFLAGS unconditionally, you are not supposed to do that with the system sources since the system sources depend on very finely tailored settings for those variables.


----------



## bryn1u (Jan 3, 2014)

*Re: /usr/src/lib/clang/libllvmsupport  error, error and erro*



			
				kpa said:
			
		

> You are overriding CFLAGS and CXXFLAGS unconditionally, you are not supposed to do that with the system sources since the system sources depend on very finely tailored settings for those variables.



Ehh, you are right. Now it's compiling very well. Thanks for the advice.


----------



## kpa (Jan 3, 2014)

*Re: /usr/src/lib/clang/libllvmsupport  error, error and erro*

If you want to enable the stack protector for ports (the world is already using it), this is the way to do it in make.conf(5):


```
.if ${.CURDIR:M/usr/ports/*}
CFLAGS+=-fstack-protector
.endif
```

Adding the option to only CFLAGS is enough, CXXFLAGS picks it up automatically from CFLAGS.

Be warned that this may not work if you mix ports compiled with different compilers, GCC and Clang.


----------



## bryn1u (Jan 3, 2014)

*Re: /usr/src/lib/clang/libllvmsupport  error, error and erro*

Thanks again 

Entry has been added. 

 I would like to take this opportunity to ask about PIE and ALSR. Can I add some entry to make.conf like stack protector?


----------

