libclang: Fixes for the python script that generates the export list
authorTom Stellard <tstellar@redhat.com>
Tue, 27 Jul 2021 01:20:14 +0000 (18:20 -0700)
committerTom Stellard <tstellar@redhat.com>
Tue, 27 Jul 2021 01:39:53 +0000 (18:39 -0700)
This script was added in 0cf37a3b0617457daaed3224373ffa07724f8482.

clang/tools/libclang/CMakeLists.txt
clang/tools/libclang/linker-script-to-export-list.py

index f5297ba5396681c66ca8823b558fe1e1b586281c..65863d7508a8c3acc774aad6af3c5d062bf5ec77 100644 (file)
@@ -64,7 +64,7 @@ endif ()
 option(LIBCLANG_BUILD_STATIC
   "Build libclang as a static library (in addition to a shared one)" OFF)
 
-set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/libclang.exports)
+set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_BINARY_DIR}/libclang-generic.exports)
 set(LIBCLANG_VERSION_SCRIPT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/libclang.map)
 
 if(MSVC)
index 4b57be03c6c7058af8e1d8b2e287fd12536ae6ba..37fb172b9a0a25e72534dd54009e85a287f2a574 100644 (file)
@@ -3,9 +3,9 @@ import os
 import sys
 
 input_file = open(sys.argv[1])
-output_file = open(sys.argv[2])
+output_file = open(sys.argv[2], 'w')
 
 for line in input_file:
-    m = re.search('clang_[^;]+', line)
+    m = re.search('^\s+(clang_[^;]+)', line)
     if m:
-        output_file.write(m.group(0))
+        output_file.write(m.group(1) + "\n")