[llvm-bugs] [Bug 50332] New: Incorrect g_tls_size type

via llvm-bugs llvm-bugs at lists.llvm.org
Thu May 13 13:14:31 PDT 2021


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

            Bug ID: 50332
           Summary: Incorrect g_tls_size type
           Product: compiler-rt
           Version: 12.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: asan
          Assignee: unassignedbugs at nondot.org
          Reporter: hjl.tools at gmail.com
                CC: llvm-bugs at lists.llvm.org

When compiling for -mx32, I got

../../../../../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*}

I am testing:

diff --git a/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cpp
b/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cpp
index da19d3d2ceb..4f9577a97e2 100644
--- a/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cpp
+++ b/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cpp
@@ -197,7 +197,7 @@ __attribute__((unused)) static bool GetLibcVersion(int
*major, int *minor,
 __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 =

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210513/17b34774/attachment.html>


More information about the llvm-bugs mailing list