[PATCH] D44623: Fix asan on i?86-linux (32-bit) against glibc 2.27 and later

Jakub JelĂ­nek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 9 11:40:19 PDT 2018


jakubjelinek added inline comments.


================
Comment at: compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc:174
+
+#if CHECK_GET_TLS_STATIC_INFO_VERSION
 # define DL_INTERNAL_FUNCTION __attribute__((regparm(3), stdcall))
----------------
vitalybuka wrote:
> Do we need this if we do runtime check anyway?
> We can't get into GetTlsStaticInfoRegparmCall with CHECK_GET_TLS_STATIC_INFO_VERSION == 0
If you mean the __GLIBC_PREREQ, that is an optimization to avoid doing the runtime check if we know the check is unnecessary.
If the CallGetTls<GetTlsStaticInfoCall>(get_tls_static_info_ptr, ...); call is not ifdefed out through preprocessor, then yes, it is needed.



================
Comment at: compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc:238
   uptr len = confstr(_CS_GNU_LIBC_VERSION, buf, sizeof(buf));
   if (len < sizeof(buf) && internal_strncmp(buf, "glibc 2.", 8) == 0) {
     char *end;
----------------
vitalybuka wrote:
> Is this the same as __GLIBC_PREREQ()
confstr is a runtime check, __GLIBC_PREREQ is a compile time check.


Repository:
  rL LLVM

https://reviews.llvm.org/D44623





More information about the llvm-commits mailing list