This is an archive of the discontinued LLVM Phabricator instance.

[msan][tsan] Refine __fxstat{,at}{,64} condition
ClosedPublic

Authored by MaskRay on Jan 27 2022, 6:23 PM.

Details

Reviewers
dvyukov
vitalybuka
Group Reviewers
Restricted Project
Commits
rGc80d34985993: [msan][tsan] Refine __fxstat{,at}{,64} condition
Summary

In glibc before 2.33, include/sys/stat.h defines fstat/fstat64 to
__fxstat/__fxstat64 and provides __fxstat/__fxstat64 in libc_nonshared.a.
The symbols are glibc specific and not needed on other systems.

Diff Detail

Event Timeline

MaskRay created this revision.Jan 27 2022, 6:23 PM
MaskRay requested review of this revision.Jan 27 2022, 6:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 27 2022, 6:23 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
MaskRay added a reviewer: Restricted Project.Jan 27 2022, 6:24 PM
MaskRay updated this revision to Diff 403855.Jan 27 2022, 6:29 PM
MaskRay retitled this revision from [msan][tsan] Refine __fxstat{,64} condition to [msan][tsan] Refine __fxstat{,at}{,64} condition.

Change __fxstatat{,64} as well

MaskRay added inline comments.Jan 27 2022, 6:32 PM
compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
1578

Note to this: FreeBSD doesn't have this libc function.

musl provides this as a glibc-compat non-API symbol. musl has #define fstat64 fstat so compiled programs won't get this symbol.

vitalybuka accepted this revision.Jan 27 2022, 7:02 PM
This revision is now accepted and ready to land.Jan 27 2022, 7:02 PM
This revision was automatically updated to reflect the committed changes.