[libc-commits] [libc] 1ab46e5 - [libc] update LibcTableGenUtil for LLVM_LINK_LLVM_DYLIB

Stephen Neuendorffer via libc-commits libc-commits at lists.llvm.org
Sat Mar 11 09:16:24 PST 2023


Author: Stephen Neuendorffer
Date: 2023-03-11T09:15:06-08:00
New Revision: 1ab46e5cf86c3799044b1c6a52a4f4b8a5280c09

URL: https://github.com/llvm/llvm-project/commit/1ab46e5cf86c3799044b1c6a52a4f4b8a5280c09
DIFF: https://github.com/llvm/llvm-project/commit/1ab46e5cf86c3799044b1c6a52a4f4b8a5280c09.diff

LOG: [libc] update LibcTableGenUtil for LLVM_LINK_LLVM_DYLIB

This library is linked into libc-hdrgen, which is compiled with
DISABLE_LLVM_LINK_LLVM_DYLIB.  This option avoids linking with
libLLVM.so when LLVM_LINK_LLVM_DYLIB is specified.  Unfortunately,
this can cause wierd linkage errors where symbols are defined
multiple times, with one definition coming from static linkage
and another definition coming from libLLVM.so.  This is usually
apparent as a link error with options defined multiple times.

This patch adds DISABLE_LLVM_LINK_LLVM_DYLIB to this library, to
get consistent linkage of libc-hdrgen.

Differential Revision: https://reviews.llvm.org/D145839

Added: 
    

Modified: 
    libc/utils/LibcTableGenUtil/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/libc/utils/LibcTableGenUtil/CMakeLists.txt b/libc/utils/LibcTableGenUtil/CMakeLists.txt
index d2632a240bd3d..222f177ee2f77 100644
--- a/libc/utils/LibcTableGenUtil/CMakeLists.txt
+++ b/libc/utils/LibcTableGenUtil/CMakeLists.txt
@@ -2,6 +2,7 @@ add_llvm_library(
   LibcTableGenUtil
   APIIndexer.cpp
   APIIndexer.h
+  DISABLE_LLVM_LINK_LLVM_DYLIB
   LINK_COMPONENTS Support TableGen
 )
 target_include_directories(LibcTableGenUtil PUBLIC ${LIBC_SOURCE_DIR})


        


More information about the libc-commits mailing list