[compiler-rt] [rtsan][compiler-rt] Add 64 bit file interceptors, test for _FILE_OFFSET_BITS (PR #108057)

Chris Apple via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 10 13:04:12 PDT 2024


================
@@ -76,6 +76,18 @@ foreach(arch ${RTSAN_TEST_ARCH})
     CFLAGS ${RTSAN_UNITTEST_CFLAGS} -fsanitize=realtime
     LINK_FLAGS ${RTSAN_UNITTEST_LINK_FLAGS} -fsanitize=realtime)
 
+  check_symbol_exists(__GLIBC__ stdio.h RTSAN_USING_GLIBC)
+  if (RTSAN_USING_GLIBC)
+    set(RtsanTestObjects_FileOffset64)
+    generate_compiler_rt_tests(RtsanTestObjects_FileOffset64
+      RtsanUnitTests "Rtsan-${arch}-FileOffset64-Test" ${arch}
+      COMPILE_DEPS ${RTSAN_UNITTEST_HEADERS}
+      SOURCES ${RTSAN_INST_TEST_SOURCES} ${COMPILER_RT_GOOGLETEST_SOURCES}
----------------
cjappl wrote:

My thought is that we need to test both configurations if they are available.

If we add a new interceptor for `foo` that also has a `foo64` that we don't know about, running both configurations should notify us of that missing interceptor. If we just pass in -D_FILE_OFFSET_BITS=64, we are only testing `foo64`

https://github.com/llvm/llvm-project/pull/108057


More information about the llvm-commits mailing list