[compiler-rt] 9fdac84 - [sanitizer_common] Fix building with NetBSD 10.99.12 or newer (#134708)

via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 7 12:57:01 PDT 2025


Author: Brad Smith
Date: 2025-04-07T15:56:58-04:00
New Revision: 9fdac840ec4901a6e3c71249a136cbecc4a9921a

URL: https://github.com/llvm/llvm-project/commit/9fdac840ec4901a6e3c71249a136cbecc4a9921a
DIFF: https://github.com/llvm/llvm-project/commit/9fdac840ec4901a6e3c71249a136cbecc4a9921a.diff

LOG: [sanitizer_common] Fix building with NetBSD 10.99.12 or newer (#134708)

https://github.com/NetBSD/src/commit/16543c49052c820334cffc5c69b2afde18f02458

__lwp_getprivate_fast() was moved to a new arch-specific header file.

Closes: #125566

Co-authored-by: Thomas Klausner <wiz at gatalith.at>

Added: 
    

Modified: 
    compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
index ffd240974454e..9cc9da3d88c40 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
@@ -29,7 +29,13 @@
 #  include "sanitizer_solaris.h"
 
 #  if SANITIZER_NETBSD
-#    define _RTLD_SOURCE  // for __lwp_gettcb_fast() / __lwp_getprivate_fast()
+#    // for __lwp_gettcb_fast() / __lwp_getprivate_fast()
+#    include <sys/param.h>
+#    if defined(__NetBSD_Version__) && (__NetBSD_Version__ >= 1099001200)
+#      include <machine/lwp_private.h>
+#    else
+#      define _RTLD_SOURCE
+#    endif
 #  endif
 
 #  include <dlfcn.h>  // for dlsym()


        


More information about the llvm-commits mailing list