This is an archive of the discontinued LLVM Phabricator instance.

[PATCH] [sanitizer] Use size_t on g_tls_size
ClosedPublic

Authored by hjl.tools on May 13 2021, 2:52 PM.

Details

Summary

Fix build on x32 where size_t == unsigned int, not unsigned long int:

../../../../../src-master/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cpp: In function ??void sanitizer::InitTlsSize()??:
../../../../../src-master/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cpp:209:55: error: invalid conversion from ??
sanitizer::uptr*?? {aka ??long unsigned int*??} to ??size_t*?? {aka ??unsigned int*??} [-fpermissive]

209 |   ((void (*)(size_t *, size_t *))get_tls_static_info)(&g_tls_size, &tls_align);
    |                                                       ^~~~~~~~~~~
    |                                                       |
    |                                                       __sanitizer::uptr* {aka long unsigned int*}

by using size_t on g_tls_size. This is to fix:

https://bugs.llvm.org/show_bug.cgi?id=50332

Diff Detail

Event Timeline

hjl.tools requested review of this revision.May 13 2021, 2:52 PM
hjl.tools created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptMay 13 2021, 2:52 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
MaskRay accepted this revision.May 13 2021, 3:29 PM

LGTM.

This revision is now accepted and ready to land.May 13 2021, 3:29 PM

LGTM.

Can you push it for me? Thanks.

This revision was landed with ongoing or failed builds.May 13 2021, 6:07 PM
This revision was automatically updated to reflect the committed changes.