This is an archive of the discontinued LLVM Phabricator instance.

Build with _XOPEN_SOURCE defined on AIX
ClosedPublic

Authored by daltenty on May 28 2019, 10:18 AM.

Details

Summary

It is useful to build with _XOPEN_SOURCE defined on AIX, enabling X/Open
and POSIX compatibility mode, to work around stray macros and other
bugs in the headers provided by the system and build compiler.

This patch adds the config to cmake to build with _XOPEN_SOURCE defined on AIX with a few exceptions. Google Test internals require access to platform specific thread info constructs on AIX so in that case we build with _ALL_SOURCE defined instead. Libclang also uses header which needs _ALL_SOURCE on AIX so we leave that as is as well..

We also add building on AIX with the large file API and doing CMake header checks with X/OPEN definitions so the results are consistent with the environment that will be present in the build.

Diff Detail

Repository
rL LLVM

Event Timeline

daltenty created this revision.May 28 2019, 10:18 AM
llvm/CMakeLists.txt
862 ↗(On Diff #201699)

Use either "code" or English style: s/LARGE FILE API/large-file API/;.
Add a period to the end of the sentence.

llvm/cmake/config-ix.cmake
27 ↗(On Diff #201699)

Same comment as above regarding "LARGE FILE API".
Use "because" in place of "as", and replace "that" with "those".
Add a period to the end of the sentence.

llvm/utils/unittest/CMakeLists.txt
33 ↗(On Diff #201699)

Indent only two spaces.

llvm/utils/unittest/googletest/src/gtest-port.cc
62 ↗(On Diff #201699)

It's generally a bad idea to define such macros after system headers have already been included.

daltenty updated this revision to Diff 202822.Jun 3 2019, 4:35 PM

Fix grammar in comments. Fix up the way we define the macros for Google Test.

daltenty marked 3 inline comments as done.Jun 3 2019, 4:35 PM

@daltenty, I believe that you have had a good number of patches committed into the project already (rL360898, rL361410, rL362454). Please go ahead with requesting commit access, and commit this patch when you are ready.

This revision is now accepted and ready to land.Jun 3 2019, 6:56 PM
This revision was automatically updated to reflect the committed changes.