[Lldb-commits] [lldb] [lldb][AIX] Introducing ALL_SOURCE macro into driver CMakeLists (PR #120607)

Dhruv Srivastava via lldb-commits lldb-commits at lists.llvm.org
Thu Dec 19 09:15:11 PST 2024


https://github.com/DhruvSrivastavaX created https://github.com/llvm/llvm-project/pull/120607

This PR is in reference to porting LLDB on AIX.

Link to discussions on llvm discourse and github:
1. https://discourse.llvm.org/t/port-lldb-to-ibm-aix/80640
2. https://github.com/llvm/llvm-project/issues/101657
The complete changes for porting are present in this draft PR:
https://github.com/llvm/llvm-project/pull/102601

Adding changes for minimal build for lldb binary on AIX: 
The `struct winsize` needed by `lldb/tools/driver/Driver.cpp` is only recognised in AIX under the AIX specific `ALL_SOURCE` macro, hence its enablement is required in certain places.

Review Request: @labath @DavidSpickett

>From 079825b797663911f0ec66bbb829ca3af38139f0 Mon Sep 17 00:00:00 2001
From: Dhruv-Srivastava <dhruv.srivastava at ibm.com>
Date: Thu, 19 Dec 2024 11:07:22 -0600
Subject: [PATCH] Need ALL_SOURCE macro

---
 lldb/tools/driver/CMakeLists.txt | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lldb/tools/driver/CMakeLists.txt b/lldb/tools/driver/CMakeLists.txt
index cd304a047dea6d..89884ecd0601bc 100644
--- a/lldb/tools/driver/CMakeLists.txt
+++ b/lldb/tools/driver/CMakeLists.txt
@@ -11,6 +11,11 @@ if(APPLE)
   set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-sectcreate,__TEXT,__info_plist,${CMAKE_CURRENT_BINARY_DIR}/lldb-Info.plist")
 endif()
 
+if (UNIX AND ${CMAKE_SYSTEM_NAME} MATCHES "AIX")                               
+  remove_definitions("-D_XOPEN_SOURCE=700")                                    
+  add_definitions("-D_ALL_SOURCE")                                             
+endif()
+
 add_lldb_tool(lldb
   Driver.cpp
   Platform.cpp



More information about the lldb-commits mailing list