This is an archive of the discontinued LLVM Phabricator instance.

[AIX] Avoid use of mtim.tv_nsec member of stat structure on AIX
ClosedPublic

Authored by hubert.reinterpretcast on Apr 26 2021, 2:05 PM.

Details

Summary

The value observed for the mtim.tv_nsec member is erroneous in some AIX environments. Avoid using this member by forcing HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC to 0.

This resolves "mtime changed" errors such as the one http://lab.llvm.org:8014/#/builders/126/builds/330/steps/5/logs/FAIL__Clang__test_c has.

Diff Detail

Event Timeline

hubert.reinterpretcast requested review of this revision.Apr 26 2021, 2:05 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 26 2021, 2:05 PM
jsji added a reviewer: Restricted Project.Apr 26 2021, 2:08 PM
daltenty accepted this revision as: daltenty.Apr 26 2021, 2:23 PM

LGTM, thanks!

This revision is now accepted and ready to land.Apr 26 2021, 2:23 PM
jsji added a comment.Apr 26 2021, 2:29 PM

Have we considered workaround this in llvm/lib/Support/Unix/Path.inc instead?

Have we considered workaround this in llvm/lib/Support/Unix/Path.inc instead?

Yes. I think this is a more general fix that would automatically apply in other situations where code should be checking for this macro.

jsji accepted this revision as: jsji.Apr 26 2021, 2:44 PM
jsji added inline comments.
llvm/cmake/config-ix.cmake
285

Maybe add a warning here about we are forcing it to 0?

This revision was landed with ongoing or failed builds.Apr 26 2021, 3:30 PM
This revision was automatically updated to reflect the committed changes.
hubert.reinterpretcast marked an inline comment as done.
llvm/cmake/config-ix.cmake
285

As discussed off-list: For a platform where Clang and LLVM is relatively new, I don't think this leads to a loss of functionality at the level where a warning is warranted. The autodetection is going to set this to 0 on some platforms anyway.