[libcxx-commits] [libcxx] 3c9063f - [libc++] Force the ABI namespace to be a reserved identifier

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Oct 29 10:56:14 PDT 2019


Author: Louis Dionne
Date: 2019-10-29T10:55:43-07:00
New Revision: 3c9063f5d2df3affba655711c2031020e6819510

URL: https://github.com/llvm/llvm-project/commit/3c9063f5d2df3affba655711c2031020e6819510
DIFF: https://github.com/llvm/llvm-project/commit/3c9063f5d2df3affba655711c2031020e6819510.diff

LOG: [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

Added: 
    

Modified: 
    compiler-rt/lib/fuzzer/CMakeLists.txt
    libcxx/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/fuzzer/CMakeLists.txt b/compiler-rt/lib/fuzzer/CMakeLists.txt
index 3743db9908ce..57b418216d73 100644
--- a/compiler-rt/lib/fuzzer/CMakeLists.txt
+++ b/compiler-rt/lib/fuzzer/CMakeLists.txt
@@ -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)

diff  --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
index 21d0c925fab3..e57ed030a8d0 100644
--- a/libcxx/CMakeLists.txt
+++ b/libcxx/CMakeLists.txt
@@ -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++.")


        


More information about the libcxx-commits mailing list