ASan unit test/libcxx build break

Is no one else seeing this? (I've been seeing it for a few days)

In file included from
/usr/local/google/home/blaikie/dev/llvm/src/utils/unittest/googletest/gtest-all.cc:39:
In file included from
/usr/local/google/home/blaikie/dev/llvm/src/utils/unittest/googletest/include/gtest/gtest.h:57:
In file included from
/usr/local/google/home/blaikie/dev/llvm/src/utils/unittest/googletest/include/gtest/internal/gtest-internal.h:40:
In file included from
/usr/local/google/home/blaikie/dev/llvm/src/utils/unittest/googletest/include/gtest/internal/gtest-port.h:197:
In file included from
/usr/local/google/home/blaikie/dev/llvm/src/projects/libcxx/include/iostream:40:
In file included from
/usr/local/google/home/blaikie/dev/llvm/src/projects/libcxx/include/istream:156:
In file included from
/usr/local/google/home/blaikie/dev/llvm/src/projects/libcxx/include/ostream:132:
In file included from
/usr/local/google/home/blaikie/dev/llvm/src/projects/libcxx/include/locale:187:
/usr/local/google/home/blaikie/dev/llvm/src/projects/libcxx/include/cstdlib:154:9:
error: no member named 'aligned_alloc' in the global namespace
using ::aligned_alloc;
      ~~^
1 error generated.

Not sure who/how this was caused (whether by libcxx or the asan unit
test it was included from, or some chain of includes along the way)

(on Linux, fwiw)

+eugenis

I see this while running ‘check-msan’.

A recent change added defined(__linux__) condition to the code below.
Now it says that on linux with --std=c++0x (or --std=c++11) the system
stdlib.h header must define aligned_alloc(). Really?

include/__config:

#if ( defined(__FreeBSD__) || defined(__linux__) ) && (__ISO_C_VISIBLE

= 2011 || __cplusplus >= 201103L)

#define _LIBCPP_HAS_QUICK_EXIT
#define _LIBCPP_HAS_C11_FEATURES
#endif

include/cstdlib:

#include <__config>
#include <stdlib.h>
#ifdef _LIBCPP_HAS_C11_FEATURES
using ::aligned_alloc;
#endif

Hi,

Yes. Ubuntu 12.04 LTS with glibc 2.15 does not have aligned_alloc.

Hi,

You can use
#if __GLIBC_PREREQ(2, 17)

Attached patch should work. Please test.

Regards.

linux.diff (720 Bytes)

Thanks, it works.
2.15 has quick_exit and at_quick_exit. The attached patch also works.

linux2.diff (755 Bytes)

Hi,

I committed Evgeniy's patch in r181740. Feel free to fix/revert/etc if
there's something else that needs to be addressed here.

- David