[compiler-rt] 8d9dcd1 - [compiler-rt] fseek interception update. (#122795)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 14 08:56:35 PST 2025


Author: David CARLIER
Date: 2025-01-14T16:56:32Z
New Revision: 8d9dcd111e5ced8135387917859dd64d67886be0

URL: https://github.com/llvm/llvm-project/commit/8d9dcd111e5ced8135387917859dd64d67886be0
DIFF: https://github.com/llvm/llvm-project/commit/8d9dcd111e5ced8135387917859dd64d67886be0.diff

LOG: [compiler-rt] fseek interception update. (#122795)

fseek api is POSIX.

to also address #122163

Added: 
    

Modified: 
    compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
    compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.cpp
    compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.h
    compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cpp
    compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.h
    compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
    compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
index 190cad7cf7c3f7..febd233bb1e3c0 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
@@ -593,7 +593,7 @@ SANITIZER_WEAK_IMPORT void *aligned_alloc(__sanitizer::usize __alignment,
 #define SANITIZER_INTERCEPT_SHA1 SI_NETBSD
 #define SANITIZER_INTERCEPT_MD4 SI_NETBSD
 #define SANITIZER_INTERCEPT_RMD160 SI_NETBSD
-#define SANITIZER_INTERCEPT_FSEEK (SI_NETBSD || SI_FREEBSD)
+#define SANITIZER_INTERCEPT_FSEEK SI_POSIX
 #define SANITIZER_INTERCEPT_MD2 SI_NETBSD
 #define SANITIZER_INTERCEPT_CDB SI_NETBSD
 #define SANITIZER_INTERCEPT_VIS (SI_NETBSD || SI_FREEBSD)

diff  --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.cpp
index 4940062eeae47f..b25b45e0217449 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.cpp
@@ -123,7 +123,6 @@ unsigned pid_t_sz = sizeof(pid_t);
 unsigned timeval_sz = sizeof(timeval);
 unsigned uid_t_sz = sizeof(uid_t);
 unsigned gid_t_sz = sizeof(gid_t);
-unsigned fpos_t_sz = sizeof(fpos_t);
 unsigned mbstate_t_sz = sizeof(mbstate_t);
 unsigned sigset_t_sz = sizeof(sigset_t);
 unsigned struct_timezone_sz = sizeof(struct timezone);

diff  --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.h
index 8ce73f206fd88d..3942f1523437f1 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.h
@@ -46,7 +46,6 @@ extern unsigned pid_t_sz;
 extern unsigned timeval_sz;
 extern unsigned uid_t_sz;
 extern unsigned gid_t_sz;
-extern unsigned fpos_t_sz;
 extern unsigned mbstate_t_sz;
 extern unsigned struct_timezone_sz;
 extern unsigned struct_tms_sz;

diff  --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cpp
index c40877ba48d072..ecabbf0d08e2cc 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cpp
@@ -2487,8 +2487,6 @@ const unsigned RMD160_return_length = RMD160_DIGEST_STRING_LENGTH;
 const unsigned MD5_CTX_sz = sizeof(MD5_CTX);
 const unsigned MD5_return_length = MD5_DIGEST_STRING_LENGTH;
 
-const unsigned fpos_t_sz = sizeof(fpos_t);
-
 const unsigned MD2_CTX_sz = sizeof(MD2_CTX);
 const unsigned MD2_return_length = MD2_DIGEST_STRING_LENGTH;
 

diff  --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.h
index 4c697b4d107ddf..4f892577d0b005 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.h
@@ -2335,8 +2335,6 @@ extern const unsigned RMD160_return_length;
 extern const unsigned MD5_CTX_sz;
 extern const unsigned MD5_return_length;
 
-extern const unsigned fpos_t_sz;
-
 extern const unsigned MD2_CTX_sz;
 extern const unsigned MD2_return_length;
 

diff  --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
index c87d5ef42c9242..ddd67cb43524d4 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
@@ -545,6 +545,8 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
   unsigned struct_sioc_vif_req_sz = sizeof(struct sioc_vif_req);
 #endif
 
+  unsigned fpos_t_sz = sizeof(fpos_t);
+
   const unsigned long __sanitizer_bufsiz = BUFSIZ;
 
   const unsigned IOCTL_NOT_PRESENT = 0;

diff  --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
index ea0933ca64af1d..7e62dc0e0523ec 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
@@ -1091,6 +1091,8 @@ extern unsigned struct_sioc_sg_req_sz;
 extern unsigned struct_sioc_vif_req_sz;
 #endif
 
+extern unsigned fpos_t_sz;
+
 // ioctl request identifiers
 
 // A special value to mark ioctls that are not present on the target platform,


        


More information about the llvm-commits mailing list