[libc++] Force the ABI namespace to be a reserved identifier

Summary:
When the ABI namespace isn't a reserved identifier, we were issuing a
warning, but this should have been an error since the beginning. This
commit enforces that the ABI namespace is a reserved identifier, and
changes the ABI namespace used by LibFuzzer.

Reviewers: phosek, EricWF

Subscribers: mgorny, christof, jkorous, dexonsmith, #sanitizers, libcxx-commits, llvm-commits

Tags: #sanitizers, #libc, #llvm

Differential Revision: https://reviews.llvm.org/D69408
This commit is contained in:
Louis Dionne 2019-10-24 14:16:37 -07:00
parent efed314118
commit 3c9063f5d2
2 changed files with 2 additions and 2 deletions

View File

@ -144,7 +144,7 @@ if(OS_NAME MATCHES "Linux|Fuchsia" AND
CFLAGS ${TARGET_CFLAGS}
CMAKE_ARGS -DCMAKE_CXX_COMPILER_WORKS=ON
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
-DLIBCXX_ABI_NAMESPACE=Fuzzer)
-DLIBCXX_ABI_NAMESPACE=__Fuzzer)
target_compile_options(RTfuzzer.${arch} PRIVATE -isystem ${LIBCXX_${arch}_PREFIX}/include/c++/v1)
add_dependencies(RTfuzzer.${arch} libcxx_fuzzer_${arch}-build)
target_compile_options(RTfuzzer_main.${arch} PRIVATE -isystem ${LIBCXX_${arch}_PREFIX}/include/c++/v1)

View File

@ -816,7 +816,7 @@ if (NOT LIBCXX_ABI_VERSION EQUAL 1)
endif()
if (NOT LIBCXX_ABI_NAMESPACE STREQUAL "")
if (NOT LIBCXX_ABI_NAMESPACE MATCHES "__.*")
message(WARNING "LIBCXX_ABI_NAMESPACE must be a reserved identifier.")
message(FATAL_ERROR "LIBCXX_ABI_NAMESPACE must be a reserved identifier.")
endif()
if (LIBCXX_ABI_NAMESPACE MATCHES "__[0-9]+$")
message(FATAL_ERROR "LIBCXX_ABI_NAMESPACE '${LIBCXX_ABI_NAMESPACE}' is reserved for use by libc++.")