[Lldb-commits] [lldb] eba7690 - [lldb][AIX] GetOpt support in AIX (#120574)
via lldb-commits
lldb-commits at lists.llvm.org
Thu Dec 19 05:50:31 PST 2024
Author: Dhruv Srivastava
Date: 2024-12-19T13:50:27Z
New Revision: eba7690d2b94ebe7fcf3e8ceecd4486f328de035
URL: https://github.com/llvm/llvm-project/commit/eba7690d2b94ebe7fcf3e8ceecd4486f328de035
DIFF: https://github.com/llvm/llvm-project/commit/eba7690d2b94ebe7fcf3e8ceecd4486f328de035.diff
LOG: [lldb][AIX] GetOpt support in AIX (#120574)
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.
getopt.h is missing in AIX, so instead relying on LLDB's getopt
functions.
Added:
Modified:
lldb/include/lldb/Host/HostGetOpt.h
lldb/include/lldb/Host/common/GetOptInc.h
Removed:
################################################################################
diff --git a/lldb/include/lldb/Host/HostGetOpt.h b/lldb/include/lldb/Host/HostGetOpt.h
index 52cfdf4dbb89c2..b2b436e64a692f 100644
--- a/lldb/include/lldb/Host/HostGetOpt.h
+++ b/lldb/include/lldb/Host/HostGetOpt.h
@@ -9,7 +9,7 @@
#ifndef LLDB_HOST_HOSTGETOPT_H
#define LLDB_HOST_HOSTGETOPT_H
-#if !defined(_MSC_VER) && !defined(__NetBSD__)
+#if !defined(_MSC_VER) && !defined(__NetBSD__) && !defined(_AIX)
#include <getopt.h>
#include <unistd.h>
diff --git a/lldb/include/lldb/Host/common/GetOptInc.h b/lldb/include/lldb/Host/common/GetOptInc.h
index 3fb9add4795417..c9c9e2496d5f96 100644
--- a/lldb/include/lldb/Host/common/GetOptInc.h
+++ b/lldb/include/lldb/Host/common/GetOptInc.h
@@ -11,11 +11,11 @@
#include "lldb/lldb-defines.h"
-#if defined(_MSC_VER)
+#if defined(_MSC_VER) || defined(_AIX)
#define REPLACE_GETOPT
#define REPLACE_GETOPT_LONG
#endif
-#if defined(_MSC_VER) || defined(__NetBSD__)
+#if defined(_MSC_VER) || defined(__NetBSD__) || defined(_AIX)
#define REPLACE_GETOPT_LONG_ONLY
#endif
More information about the lldb-commits
mailing list