[llvm] [CMake] Do all availability checks with -D_GNU_SOURCE (PR #116640)
    Fangrui Song via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Sat Nov 23 16:36:57 PST 2024
    
    
  
================
@@ -40,6 +40,21 @@ if (UNIX AND ${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
           list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D_FILE_OFFSET_BITS=64")
 endif()
 
+check_symbol_exists(__GLIBC__ stdio.h LLVM_USING_GLIBC)
+if(LLVM_USING_GLIBC)
+  # Newer POSIX functions aren't available without the appropriate defines.
----------------
MaskRay wrote:
Note: the patch description (first comment) is used as the default commit message. You'd want to edit it instead of the commit message (completely ignored).
https://github.com/llvm/llvm-project/pull/116640
    
    
More information about the llvm-commits
mailing list