FORTIFY_SOURCE produces a broken libc++

I recently built libc++ (with clang 3.3, against libsupc++ from gcc
4.8.1). The library was produced without error and building a test
program with clang++ -stdlib=libc++ appeared to work. Unfortunately,
those appearances were deceiving: the libc++ I had built was broken,
and when I ran the test program it locked up during program termination
(i.e., the program ran, but instead of terminating as normal it got
stuck somewhere; the stack trace indicates that it got stuck in
std::__1::codecvt::do_unshift when calling wcrtomb).

I eventually determined that these problems were caused by having
-D_FORTIFY_SOURCE=2 in my C(XX)FLAGS while building libc++. This was
enabled because ArchLinux includes that flag in its default package
build options.

I'd like to check whether this is a known incompatibility, and if so
whether it is documented anywhere? I wonder if libc++'s build system
could give a warning/error if an attempt is made to build with
FORTIFY_SOURCE, or if that would be considered too specific/unusual a


John B