aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDhruv Srivastava <dhruv.srivastava@ibm.com>2025-01-09 09:38:25 +0530
committerGitHub <noreply@github.com>2025-01-09 09:38:25 +0530
commit18de1db0cfbfbbf12d16338923b43077a87dce18 (patch)
tree9a5cc4a09f7507a17fc515d855f958687ab74351
parente438513f2e2ff7a19c671983ff22a14909c96859 (diff)
downloadllvm-18de1db0cfbfbbf12d16338923b43077a87dce18.zip
llvm-18de1db0cfbfbbf12d16338923b43077a87dce18.tar.gz
llvm-18de1db0cfbfbbf12d16338923b43077a87dce18.tar.bz2
[lldb][AIX] Some base #if _AIX changes of a minimal lldb build (#120979)
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 Added some base #if _AIX changes for minimal lldb build. Added a PR for clang-format changes separately, to rebase this on later: - https://github.com/llvm/llvm-project/pull/120978 Review Request: @labath @DavidSpickett
-rw-r--r--lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp12
-rw-r--r--lldb/source/Plugins/Language/ObjC/Cocoa.cpp2
-rw-r--r--lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp2
3 files changed, 13 insertions, 3 deletions
diff --git a/lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp b/lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp
index ab4ddbf..0ed2016 100644
--- a/lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp
+++ b/lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp
@@ -730,9 +730,19 @@ ConnectionStatus ConnectionFileDescriptor::ConnectFile(
struct termios options;
::tcgetattr(fd, &options);
- // Set port speed to maximum
+ // Set port speed to the available maximum
+#ifdef B115200
::cfsetospeed(&options, B115200);
::cfsetispeed(&options, B115200);
+#elif B57600
+ ::cfsetospeed(&options, B57600);
+ ::cfsetispeed(&options, B57600);
+#elif B38400
+ ::cfsetospeed(&options, B38400);
+ ::cfsetispeed(&options, B38400);
+#else
+#error "Maximum Baud rate is Unknown"
+#endif
// Raw input, disable echo and signals
options.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG);
diff --git a/lldb/source/Plugins/Language/ObjC/Cocoa.cpp b/lldb/source/Plugins/Language/ObjC/Cocoa.cpp
index b35e27a..1d79edb 100644
--- a/lldb/source/Plugins/Language/ObjC/Cocoa.cpp
+++ b/lldb/source/Plugins/Language/ObjC/Cocoa.cpp
@@ -1226,7 +1226,7 @@ bool lldb_private::formatters::ObjCSELSummaryProvider(
time_t lldb_private::formatters::GetOSXEpoch() {
static time_t epoch = 0;
if (!epoch) {
-#ifndef _WIN32
+#if !defined(_WIN32) && !defined(_AIX)
tzset();
tm tm_epoch;
tm_epoch.tm_sec = 0;
diff --git a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
index 3835f2b..b202898 100644
--- a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
+++ b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
@@ -8,7 +8,7 @@
#include "ObjectContainerBSDArchive.h"
-#if defined(_WIN32) || defined(__ANDROID__)
+#if defined(_WIN32) || defined(__ANDROID__) || defined(_AIX)
// Defines from ar, missing on Windows
#define SARMAG 8
#define ARFMAG "`\n"