aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2022-08-06 08:29:11 -0400
committerNico Weber <thakis@chromium.org>2022-08-06 08:34:24 -0400
commit547c551925c8f4dd979ba5cf16c857091a80254b (patch)
treeeeca558325a50c914792a23810da5d3d67ec37d9
parentf7b73b7e8e6799d566abeb9954a0617e648b833e (diff)
[gn build] Try to fix build on linux after std=c++17 switch
glibc annotates `process_vm_readv` with `__THROW`. lldb/include/lldb/Host/linux/Uio.h and lldb/source/Host/linux/LibcGlue.cpp don't. Having a mismatch causes an error with c++17: ../../lldb/source/Host/linux/LibcGlue.cpp:18:9: error: 'process_vm_readv' is missing exception specification 'throw()' ssize_t process_vm_readv(::pid_t pid, const struct iovec *local_iov, ^ ../../lldb/include/lldb/Host/linux/Uio.h:18:9: note: previous declaration is here ssize_t process_vm_readv(::pid_t pid, const struct iovec *local_iov, ^ The diagnostic is a bit misleading, since the previous declaration in the sysroot (in usr/include/x76_64-linux-gnu/bits/uio-ext.h) is what has the `__THROW`. In the cmake build, cmake sets `HAVE_PROCESS_VM_READV` correctly based on header probing. In the GN build, just set it to 1 unconditionally on linux. If that turns out to not be good enough everywhere, we'll have to add a GN arg for this. (I'm also setting it to 1 on Android. I'm not sure if that's correct -- but we don't build lldb for Android anyways.)
-rw-r--r--llvm/utils/gn/secondary/lldb/include/lldb/Host/BUILD.gn10
1 files changed, 8 insertions, 2 deletions
diff --git a/llvm/utils/gn/secondary/lldb/include/lldb/Host/BUILD.gn b/llvm/utils/gn/secondary/lldb/include/lldb/Host/BUILD.gn
index 7e9c03c84e78..090580f52be6 100644
--- a/llvm/utils/gn/secondary/lldb/include/lldb/Host/BUILD.gn
+++ b/llvm/utils/gn/secondary/lldb/include/lldb/Host/BUILD.gn
@@ -62,8 +62,14 @@ write_cmake_config("Config") {
}
if (current_os == "linux" || current_os == "android") {
- values += [ "HAVE_PPOLL=1" ]
+ values += [
+ "HAVE_PPOLL=1",
+ "HAVE_PROCESS_VM_READV=1",
+ ]
} else {
- values += [ "HAVE_PPOLL=" ]
+ values += [
+ "HAVE_PPOLL=",
+ "HAVE_PROCESS_VM_READV=",
+ ]
}
}