[libcxxabi] Build all of libcxxabi with _LIBCPP_BUILDING_LIBRARY defined

Various definitions from libcxx need to be set in the same way
as if building libcxx itself.

Differential Revision: https://reviews.llvm.org/D90476
This commit is contained in:
Martin Storsjö
2020-10-30 19:11:23 +02:00
parent 7a5184ed95
commit 9c30bafd59
4 changed files with 4 additions and 5 deletions

View File

@@ -282,6 +282,10 @@ endif()
# library.
add_definitions(-D_LIBCXXABI_BUILDING_LIBRARY)
# libcxxabi needs to, for various reasons, include the libcpp headers as if
# it is being built as part of libcxx.
add_definitions(-D_LIBCPP_BUILDING_LIBRARY)
# Disable DLL annotations on Windows for static builds.
if (WIN32 AND LIBCXXABI_ENABLE_STATIC AND NOT LIBCXXABI_ENABLE_SHARED)
add_definitions(-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS)

View File

@@ -6,9 +6,6 @@
//
//===----------------------------------------------------------------------===//
// Define _LIBCPP_BUILDING_LIBRARY to ensure _LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION
// is only defined when libc aligned allocation is not available.
#define _LIBCPP_BUILDING_LIBRARY
#include "fallback_malloc.h"
#include <__threading_support>

View File

@@ -6,7 +6,6 @@
//
//===----------------------------------------------------------------------===//
#define _LIBCPP_BUILDING_LIBRARY
#include <new>
#include <exception>

View File

@@ -8,7 +8,6 @@
// This file implements the new and delete operators.
//===----------------------------------------------------------------------===//
#define _LIBCPP_BUILDING_LIBRARY
#include "__cxxabi_config.h"
#include <new>
#include <cstdlib>