Transition to Clang/C+11/libc++ - A status update
So far the transition to C++11 has been relatively straight forward. This post might help others who are planning to do the same to understand pitfalls and potential problems.
So far the transition to C++11 has been relatively straight forward. This post might help others who are planning to do the same to understand pitfalls and potential problems.
ZeroC Ice (devel/ice) is an important part of the infrastructure of our internal services, therefore naturally it's the first major C++ port I'm trying to compile and run using Clang/C++11/libc++ on FreeBSD 9.1 RC1 as part of my project of migrating to FreeBSD 9.1, Clang, C++11 and libc++.
Earlier this year I made an effort to make Ice compile and run using Clang (and gcc47), but this was still using C++03 and gcc's libstdc++. I encountered a couple of obstacles while making this compile and run correctly using clang++ -std=c++11 -stdlib=libc++.
Last year C++0x turned into C++11 and finally it's becoming a viable option for C++ programmers. At the same time, FreeBSD had been stuck with gcc 4.2.1 - the last version of gcc under the more permissive GPLv2 - for about half a decade, so the announcement that Clang will be in the base system was pretty amazing. Until recently the new libc++ (which replaces GNU libstdc++) was not part of the base system, so compiling C++11 code with Clang wasn't possible on a stable FreeBSD system. Finally 9.1 RC1 adds the bits necessary, so I decided to upgrade one of our 9.0 systems to 9.1 RC1 and build a Clang only system, using C++11 and Clangs libc++ to compile all C++ code in the required ports, so we'll end up with a complete C++11 tool chain and finally compile our own code base using Clang.
I already identified problematic ports, so this endeavor will definitely require some time, effort and patching. I'll keep posting about milestones and obstacles I encountered in the process.