https://github.com/tambry updated 
https://github.com/llvm/llvm-project/pull/166768

>From 317aa042e4f01b48d081f4ece12853d6fcb54880 Mon Sep 17 00:00:00 2001
From: Raul Tambre <[email protected]>
Date: Thu, 6 Nov 2025 15:06:44 +0200
Subject: [PATCH] [NFCI][lldb][test] Enable GNU POSIX extensions where
 necessary

Otherwise these tests are reliant on the compiler defaulting to having the 
extensions on.
Rest of LLVM's codebase doesn't seem to make such assumptions.

Tested by building with `-std=c2y` in Clang's C frotend's config file.
---
 lldb/packages/Python/lldbsuite/test/make/Makefile.rules | 5 +++++
 lldb/test/Shell/Commands/Inputs/sigchld.c               | 4 ++++
 2 files changed, 9 insertions(+)

diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules 
b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
index 63a35224b0435..0122fe8409c29 100644
--- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
+++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
@@ -294,6 +294,11 @@ ifeq "$(MAKE_DEBUG_NAMES)" "YES"
        CFLAGS += -gpubnames
 endif
 
+# Enable GNU POSIX extensions (e.g. kill(), usleep(), getpgid(), ...)
+ifeq "$(OS)" "Linux"
+       CFLAGS += -D_DEFAULT_SOURCE
+endif
+
 ifeq "$(USE_PRIVATE_MODULE_CACHE)" "YES"
 THE_CLANG_MODULE_CACHE_DIR := $(BUILDDIR)/private-module-cache
 else
diff --git a/lldb/test/Shell/Commands/Inputs/sigchld.c 
b/lldb/test/Shell/Commands/Inputs/sigchld.c
index ba8c5ef45365b..0121e70c1bdd0 100644
--- a/lldb/test/Shell/Commands/Inputs/sigchld.c
+++ b/lldb/test/Shell/Commands/Inputs/sigchld.c
@@ -1,3 +1,7 @@
+#if defined(__linux__)
+#define _XOPEN_SOURCE 500 /* for CLD_EXITED */
+#endif
+
 #include <assert.h>
 #include <signal.h>
 #include <stdio.h>

_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to