Skip to content

Commit 611e2ea

Browse files
jeremyd2019IanWood1
authored andcommitted
[LLVM][Cygwin] Define _GNU_SOURCE on Cygwin as well. (llvm#138329)
Without it, certain functions such as dladdr are not make available by the headers. Signed-off-by: Jeremy Drake <[email protected]>
1 parent 0da3f71 commit 611e2ea

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

llvm/cmake/config-ix.cmake

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,15 @@ endif()
8686
# Keep this at the top to make sure we don't add _GNU_SOURCE dependent checks
8787
# before adding it.
8888
check_symbol_exists(__GLIBC__ stdio.h LLVM_USING_GLIBC)
89-
if(LLVM_USING_GLIBC)
89+
if(LLVM_USING_GLIBC OR CYGWIN)
9090
add_compile_definitions(_GNU_SOURCE)
9191
list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE")
92+
endif()
9293

93-
# enable 64bit off_t on 32bit systems using glibc
94-
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
95-
add_compile_definitions(_FILE_OFFSET_BITS=64)
96-
list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D_FILE_OFFSET_BITS=64")
97-
endif()
94+
# enable 64bit off_t on 32bit systems using glibc
95+
if(LLVM_USING_GLIBC AND CMAKE_SIZEOF_VOID_P EQUAL 4)
96+
add_compile_definitions(_FILE_OFFSET_BITS=64)
97+
list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D_FILE_OFFSET_BITS=64")
9898
endif()
9999

100100
# include checks

0 commit comments

Comments
 (0)