Skip to content

[sanitizer_common] Updated build fix for newer NetBSD #134742

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

Merged
merged 1 commit into from
Apr 18, 2025

Conversation

brad0
Copy link
Contributor

@brad0 brad0 commented Apr 7, 2025

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Apr 7, 2025

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: Brad Smith (brad0)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/134742.diff

1 Files Affected:

  • (modified) compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp (+4-3)
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
index 9cc9da3d88c40..652c4a986ab72 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
@@ -30,11 +30,12 @@
 
 #  if SANITIZER_NETBSD
 #    // for __lwp_gettcb_fast() / __lwp_getprivate_fast()
+#    define _RTLD_SOURCE
+#    include <machine/mcontext.h>
+#    undef _RTLD_SOURCE
 #    include <sys/param.h>
-#    if defined(__NetBSD_Version__) && (__NetBSD_Version__ >= 1099001200)
+#    if __NetBSD_Version__ >= 1099001200
 #      include <machine/lwp_private.h>
-#    else
-#      define _RTLD_SOURCE
 #    endif
 #  endif
 

@devnexen
Copy link
Member

devnexen commented Apr 7, 2025

what was the issue with the previous commit ?

@brad0
Copy link
Contributor Author

brad0 commented Apr 18, 2025

what was the issue with the previous commit ?

Sorry, took a bit to get a -current VM up and running to check myself. Looks like the previous patch fixed -current but broke 10.

-current builds this chunk of code but 10 with the previous patch failed like so..

sanitizer_linux_libcdep.cpp:521:27: error: use of undeclared identifier '__lwp_getprivate_fast'; did you mean '_lwp_getprivate'?

@devnexen
Copy link
Member

fair :)

@brad0 brad0 merged commit 15ea45b into llvm:main Apr 18, 2025
13 checks passed
@brad0 brad0 deleted the compiler_rt_sanitizer_netbsd branch April 18, 2025 22:29
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants