labath wrote:

> > @petrhosek Hey Petr, can you provide more information? For Linux 
> > environments, SI_DETHREAD should be present. The commit for this signal 
> > specifically is 13 years old, @DavidSpickett do you have any insight as to 
> > why this is happening?
> > [SI_DETHREAD](https://github.com/torvalds/linux/blob/015a99fa76650e7d6efa3e36f20c0f5b346fe9ce/include/uapi/asm-generic/siginfo.h#L182)
> > (Updated with an actually useful Linux line number)
> 
> I'm not sure what the issue is yet, I checked 
> `usr/include/asm-generic/siginfo.h` in our sysroot and it contains the 
> `SI_DETHREAD` definition.

This is a linux kernel header, and is not included when building regular 
applications. For me, the definition of SI_DETHREAD comes from 
/usr/include/bits/siginfo-consts.h (which comes from (g)libc). Maybe you don't 
have it if you have an old libc version.

I also checked the glibc version used internally at google (2.27, which is 
"only" seven years old :/), and it also does not have this symbol.

> Because the Linux CI is passing, are you opposed to merging the reapply? I'm 
> not sure how I would help debug your builders failing to link it. We could 
> also drop SI_DETHREAD for now and follow up in the future.

It's true that these libraries are old, but it seems wrong to make this not 
build on (old) linuxes if the code actually builds on windows. We are actually 
providing the hardcoded values of these constants. The only reason we're 
referencing the os-defined values is so we can validate our values for them. 
There's already a 
[precedent](https://github.com/llvm/llvm-project/blob/cbe2352c4dc607da71e7bd40213b8922fbdee482/lldb/source/Plugins/Process/Utility/LinuxSignals.cpp#L18)
 for handling unavailable constants, so you could just do the same with these.

(Although overall, I think it be better to move these checks to a test where 
the checks for individual constants could be guarded by `#ifdef SI_CONSTANT`)

https://github.com/llvm/llvm-project/pull/140150
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to