Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions lldb/unittests/Process/elf-core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
include(CheckSymbolExists)
include(CMakePushCheckState)

add_lldb_unittest(ProcessElfCoreTests
ThreadElfCoreTest.cpp

Expand All @@ -13,3 +16,11 @@ add_lldb_unittest(ProcessElfCoreTests
LINK_COMPONENTS
Support
)

cmake_push_check_state()
set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
check_symbol_exists(gettid "unistd.h" HAVE_GETTID)
if(HAVE_GETTID)
target_compile_definitions(ProcessElfCoreTests PRIVATE HAVE_GETTID)
endif()
cmake_pop_check_state()
5 changes: 5 additions & 0 deletions lldb/unittests/Process/elf-core/ThreadElfCoreTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
#include <mutex>
#include <unistd.h>

#ifndef HAVE_GETTID
#include <sys/syscall.h>
pid_t gettid() { return ((pid_t)syscall(SYS_gettid)); }
#endif

using namespace lldb_private;

namespace {
Expand Down