This is an archive of the discontinued LLVM Phabricator instance.

[AIX] [test-suite] Enable standard compatable mode on AIX
ClosedPublic

Authored by stevewan on Jun 22 2020, 11:38 AM.

Details

Summary

Since the current default _ALL_SOURCE causes numerous issues on AIX (e.g., typedef redefinition, unintended macro expansion), this patch changes the configuration to use standard-compatable mode by appending XOPEN_SOURCE=700. This flag is added to cflags for all the C test cases because a considerable number of C tests are affected by the _ALL_SOURCE problem. For one particular C++ test case that was also affected by _ALL_SOURCE, the flag is appended to the cxxflags in its sub-level CMakeLists.

Event Timeline

stevewan created this revision.Jun 22 2020, 11:38 AM
stevewan edited the summary of this revision. (Show Details)Jun 22 2020, 11:59 AM
stevewan retitled this revision from [AIX] Enable standard compatable mode by default on AIX to [AIX] [test-suite] Enable standard compatable mode on AIX.Jun 22 2020, 12:12 PM
daltenty accepted this revision.Jun 24 2020, 8:43 AM

LGTM other than minor nit

CMakeLists.txt
173

nit: I think we should probably add a comment that this is a work around for system header issues that we are intending to apply only to C, something like:

# Use X/OPEN compatibility flag on AIX for C tests to avoid problems with some versions of the system headers.
This revision is now accepted and ready to land.Jun 24 2020, 8:43 AM
stevewan updated this revision to Diff 273104.Jun 24 2020, 11:00 AM

Add comment based on review.

stevewan marked an inline comment as done.Jun 24 2020, 11:01 AM
azhar added a subscriber: azhar.EditedJul 6 2020, 1:08 PM

This is failing on Darwin. Looks like for the C++ test too, the flag should be added only if it is AIX.

MultiSource/Benchmarks/DOE-ProxyApps-C++/miniFE/mytimer.cpp:116:19: error: variable has incomplete type 'struct timezone'

Refer to http://green.lab.llvm.org/green/job/test-suite-verify-machineinstrs-aarch64-O0-g/7783/consoleFull.

This is failing on Darwin. Looks like for the C++ test too, the flag should be added only if it is AIX.

MultiSource/Benchmarks/DOE-ProxyApps-C++/miniFE/mytimer.cpp:116:19: error: variable has incomplete type 'struct timezone'

Refer to http://green.lab.llvm.org/green/job/test-suite-verify-machineinstrs-aarch64-O0-g/7783/consoleFull.

Thanks for the note, I'm looking into this.

This is failing on Darwin. Looks like for the C++ test too, the flag should be added only if it is AIX.

MultiSource/Benchmarks/DOE-ProxyApps-C++/miniFE/mytimer.cpp:116:19: error: variable has incomplete type 'struct timezone'

Refer to http://green.lab.llvm.org/green/job/test-suite-verify-machineinstrs-aarch64-O0-g/7783/consoleFull.

Reverted the C++ part.

This is failing on Darwin. Looks like for the C++ test too, the flag should be added only if it is AIX.

MultiSource/Benchmarks/DOE-ProxyApps-C++/miniFE/mytimer.cpp:116:19: error: variable has incomplete type 'struct timezone'

Refer to http://green.lab.llvm.org/green/job/test-suite-verify-machineinstrs-aarch64-O0-g/7783/consoleFull.

The reported failure is fixed in the latest build, http://green.lab.llvm.org/green/job/test-suite-verify-machineinstrs-aarch64-O0-g/7867/consoleFull.

azhar added a comment.Jul 6 2020, 9:23 PM

This is failing on Darwin. Looks like for the C++ test too, the flag should be added only if it is AIX.

MultiSource/Benchmarks/DOE-ProxyApps-C++/miniFE/mytimer.cpp:116:19: error: variable has incomplete type 'struct timezone'

Refer to http://green.lab.llvm.org/green/job/test-suite-verify-machineinstrs-aarch64-O0-g/7783/consoleFull.

Reverted the C++ part.

Thanks @stevewan.