hawkinsw wrote:

I am _not_ an expert but did a little investigation and wanted to help if I 
could:

It looks like the problem is that `gettid` is defined (at least on Linux 
systems) only when the `__USE_GNU` macro is defined. From the `man` page:

```
SYNOPSIS
       #define _GNU_SOURCE
       #include <unistd.h>

       pid_t gettid(void);
```

It seems like we could fix the break in one of two ways:

1. Move the 
```Cmake
if (CMAKE_SYSTEM_NAME MATCHES "Linux|Android")
  add_subdirectory(elf-core)
```
into an if that checks exclusively for `Linux`; or
2. Use a `#ifdef _USE_GNU` in the actual test.

Both seem overly aggressive because they would defeat the purpose of the test. 

I did find that there seems to be a platform-independent means of getting the 
thread id in `packages/Python/lldbsuite/test/make/thread.h` -- we could 
repurpose that implementation to use in this test rather than calling  `gettid` 
directly. 

If that is something worth exploring, just let me know! I would be more than 
glad to help!

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

Reply via email to