Skip to content

Commit

Permalink
[flang] Set compile definitions for flang-rt build on AIX (llvm#127919)
Browse files Browse the repository at this point in the history
After commit b55f751, the flang-rt build on AIX is missing `-D_LARGE_FILE_API 
-D_XOPEN_SOURCE=700` in compiling the source. This patch is to add the 
compile definitions.

---------

Co-authored-by: Michael Kruse <github@meinersbur.de>
  • Loading branch information
2 people authored and joaosaffran committed Feb 27, 2025
1 parent d066c31 commit afe260e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions flang-rt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,12 @@ if (WIN32)
find_compiler_rt_library(builtins FLANG_RT_BUILTINS_LIBRARY)
endif ()

# Build with _XOPEN_SOURCE on AIX to avoid errors caused by _ALL_SOURCE.
# We need to enable the large-file API as well.
if (UNIX AND CMAKE_SYSTEM_NAME MATCHES "AIX")
add_compile_definitions(_XOPEN_SOURCE=700)
add_compile_definitions(_LARGE_FILE_API)
endif ()

# Check whether the compiler can undefine a macro using the "-U" flag.
# Aternatively, we could use
Expand Down

0 comments on commit afe260e

Please sign in to comment.