This is an archive of the discontinued LLVM Phabricator instance.

[sanitizer] Use confstr to check libc version in InitTlsSize

Authored by vitalybuka on Jun 17 2018, 1:57 AM.

Diff Detail


Event Timeline

vitalybuka created this revision.Jun 17 2018, 1:57 AM
Lekensteyn accepted this revision.Jun 17 2018, 3:10 AM

With the three whitespace issues fixed up, LGTM.
(I am also observing that the version check in ThreadDescriptorSize is Linux-only (minus Android), such that the cpp guards !SANITIZER_FREEBSD && !SANITIZER_ANDROID && ... will be broad enough.)

Tested with -m32 -fsanitize=address glibc 2.27.0 (with #define CHECK_GET_TLS_STATIC_INFO_VERSION 1) and glibc 2.23.0.

210 ↗(On Diff #151638)

style nitpicks: remove the double spaces after ? in the lines above and in sizeof(kGLibC) - 1.

This revision is now accepted and ready to land.Jun 17 2018, 3:10 AM


vitalybuka marked an inline comment as done.Jun 17 2018, 10:30 AM
This revision was automatically updated to reflect the committed changes.