[PATCH] D102446: [PATCH] [sanitizer] Use size_t on g_tls_size
H.J Lu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 13 14:52:26 PDT 2021
hjl.tools created this revision.
hjl.tools added reviewers: MaskRay, dvyukov.
hjl.tools requested review of this revision.
Herald added a project: Sanitizers.
Herald added a subscriber: Sanitizers.
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
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D102446
Files:
compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
Index: compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
===================================================================
--- compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
+++ compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
@@ -197,7 +197,7 @@
__attribute__((unused)) static int g_use_dlpi_tls_data;
#if SANITIZER_GLIBC && !SANITIZER_GO
-__attribute__((unused)) static uptr g_tls_size;
+__attribute__((unused)) static size_t g_tls_size;
void InitTlsSize() {
int major, minor, patch;
g_use_dlpi_tls_data =
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102446.345292.patch
Type: text/x-patch
Size: 558 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210513/afdffdc3/attachment.bin>
More information about the llvm-commits
mailing list