Skip to content

Commit 7262a1e

Browse files
kkwliMeinersbur
andauthoredFeb 24, 2025
[flang] Set compile definitions for flang-rt build on AIX (#127919)
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>
1 parent eb14d2a commit 7262a1e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
 

Diff for: ‎flang-rt/CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,12 @@ if (WIN32)
227227
find_compiler_rt_library(builtins FLANG_RT_BUILTINS_LIBRARY)
228228
endif ()
229229

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

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

0 commit comments

Comments
 (0)