-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[sanitizer_common] Fix building with NetBSD 10.99.12 or newer #134708
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[sanitizer_common] Fix building with NetBSD 10.99.12 or newer #134708
Conversation
NetBSD/src@16543c4 __lwp_getprivate_fast() was moved to a new arch-specific header file. Closes: llvm#125566
@llvm/pr-subscribers-compiler-rt-sanitizer Author: Brad Smith (brad0) Changes__lwp_getprivate_fast() was moved to a new arch-specific header file. Closes: #125566 Full diff: https://github.com/llvm/llvm-project/pull/134708.diff 1 Files Affected:
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
index e5e79d4e0521c..304d14b20c6d5 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()
|
@@ -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> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be moved under the if condition, since it didn't seem to be needed for older NetBSD versions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, that's required for the if condition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes he s right we need this header prior
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see, thanks!
NetBSD/src@16543c4
__lwp_getprivate_fast() was moved to a new arch-specific header file.
Closes: #125566