missing some c++11 support for clang in FreeBSD

Alexander K. Beros alex at 154cm.com
Tue May 14 00:35:56 UTC 2013


I have just started using clang (on FreeBSD 9.1 AMD64) and encountered a
couple problems.  I have worked around these points, but in case they
represent something unintentional (as opposed to some error on my part while
building from the port) I would like to mention them.  I am using

FreeBSD clang version 3.1 (branches/release_31 156863) 20120523
Target: x86_64-unknown-freebsd9.0
Thread model: posix

A key element in solving both problems was the installation of gcc47.  That
was unexpected since I initially installed clang under the assumption that
FBSD is moving from gcc to clang and since gcc42 doesn't support c++11.

1.. 
Symptom:

	%>  clang++ -std=c++11 -stdlib=libstdc++ refparms.c++
	initListTest.cpp:43:10: fatal error: 'initializer_list' file not
found
	#include <initializer_list>

I had included initializer_list.

Temporary Solution:
	I built gcc47 from the port and then added the following to my
.cshrc file
	alias clang11 'clang++ -std=c++11 -I/usr/local/lib/gcc47/include/c++
-I/usr/local/lib/gcc47/include/c++/x86_64-portbld-	freebsd9.1'

Alternate solution, compile using g++47.

2..
Symptom:
	/usr/lib/libstdc++.so.6: version GLIBCXX_3.4.14 required by
/usr/home/../binaries/a.out  not found

Solution:
	I added the following line to /etc/libmap.conf
	libstdc++.so.6  gcc47/libstdc++.so.6

	again compiling with g++47 had no such problem.
	
Best regards,
Alexander





More information about the freebsd-toolchain mailing list