Add a cmake option to force libstdc++ when building with clang
commitcc07cb59c0a15b535a2b7f11652d421e7856fbea
authorYen Chi Hsuan <yan12125@gmail.com>
Tue, 4 Aug 2015 23:27:54 +0000 (4 16:27 -0700)
committerhhvm-bot <hhvm-bot@fb.com>
Tue, 4 Aug 2015 23:32:58 +0000 (4 16:32 -0700)
tree9d6d5d0259760600a075737c865a2559fb73b5a6
parentd266eddd4f8bfc90dd12cbb2915253a0863a23bf
Add a cmake option to force libstdc++ when building with clang

Summary: Rationales:
1. Some Linux distributions (for example [Arch Linux](https://www.archlinux.org/packages/core/x86_64/gcc/) and [Fedora 22+](http://pkgs.fedoraproject.org/cgit/gcc.git/)) now default GCC to version 5.x. However, GCC 5.x is buggy (see #5343, #5184, #5219)
2. Clang is good, but libc++ support is far from complete (see #4444 and #5344)

On Linux, an option is building HHVM with clang and libstdc++. This patch enables this feature.

Tested with:
OS: Arch Linux
GCC: 5.2.0
Clang: 3.6.2

Command line options:
```
$ CC=clang CXX=clang++ cmake \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DCMAKE_INSTALL_LIBDIR=lib \
        -DCMAKE_PREFIX_PATH="$srcdir" \
        -DMYSQL_UNIX_SOCK_ADDR=/run/mysqld/mysqld.sock \
        -DCLANG_FORCE_LIBSTDCXX=ON \
        .
```

The generated binaries failed in 38 'all' tests
```
./run --threads 2 all
```
Here's the verbose log: https://gist.github.com/yan12125/86bcefd469d21abfdab9
Closes https://github.com/facebook/hhvm/pull/5789

Reviewed By: @jwatzman

Differential Revision: D2282475
CMake/FollySetup.cmake
CMake/HPHPCompiler.cmake
CMake/Options.cmake