Skip to content

[lldb][AIX] GetOpt support in AIX #120574

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 19, 2024
Merged

Conversation

DhruvSrivastavaX
Copy link
Contributor

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. Extending LLDB to work on AIX #101657
    The complete changes for porting are present in this draft PR:
    Extending LLDB to work on AIX #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.

Review Request: @labath @DavidSpickett

@llvmbot
Copy link
Member

llvmbot commented Dec 19, 2024

@llvm/pr-subscribers-lldb

Author: Dhruv Srivastava (DhruvSrivastavaX)

Changes

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. Extending LLDB to work on AIX #101657
    The complete changes for porting are present in this draft PR:
    Extending LLDB to work on AIX #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.

Review Request: @labath @DavidSpickett


Full diff: https://github.com/llvm/llvm-project/pull/120574.diff

2 Files Affected:

  • (modified) lldb/include/lldb/Host/HostGetOpt.h (+1-1)
  • (modified) lldb/include/lldb/Host/common/GetOptInc.h (+2-2)
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
 

Copy link
Collaborator

@DavidSpickett DavidSpickett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Should I merge this on your behalf?

@DhruvSrivastavaX
Copy link
Contributor Author

DhruvSrivastavaX commented Dec 19, 2024

Yes, Thanks. I dont have the permissions to merge so it would be great if you do.
Also, how can I gain the privilege to merge my changes once they are approved?

@DavidSpickett
Copy link
Collaborator

https://llvm.org/docs/DeveloperPolicy.html#obtaining-commit-access

My understanding is that this also allows you to add reviewers directly, and other non-commit things that are useful.

@DavidSpickett DavidSpickett merged commit eba7690 into llvm:main Dec 19, 2024
7 of 8 checks passed
@DhruvSrivastavaX
Copy link
Contributor Author

Great. Thanks alot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants