--- ./Modules/Platform/AIX-GNU.cmake_orig	2024-07-26 00:05:08.468835058 -0500
+++ ./Modules/Platform/AIX-GNU.cmake	2024-07-26 00:05:33.186500117 -0500
@@ -30,6 +30,15 @@
     "<CMAKE_${lang}_COMPILER> <CMAKE_SHARED_LIBRARY_${lang}_FLAGS> -Wl,-bE:<OBJECT_DIR>/exports.exp <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>"
     )
 
+    # Create an archive for shared library if CMAKE_AIX_SHARED_LIBRARY_ARCHIVE is used.
+  string(REPLACE " <SONAME_FLAG><TARGET_SONAME> -o <TARGET>" " -o <TARGET_SONAME>"
+    CMAKE_${lang}_CREATE_SHARED_LIBRARY_ARCHIVE "${CMAKE_${lang}_CREATE_SHARED_LIBRARY}")
+  list(APPEND CMAKE_${lang}_CREATE_SHARED_LIBRARY_ARCHIVE
+    "<CMAKE_AR> -X32_64 rc <TARGET> <TARGET_SONAME>"
+    "rm -f <TARGET_SONAME>"
+  )
+
+
   set(CMAKE_${lang}_LINK_EXECUTABLE_WITH_EXPORTS
     "\"${CMAKE_ROOT}/Modules/Platform/AIX/ExportImportList\" -o <TARGET_IMPLIB> -c <CMAKE_${lang}_COMPILER> -l . <AIX_EXPORTS> <OBJECTS>"
     "<CMAKE_${lang}_COMPILER> <FLAGS> <CMAKE_${lang}_LINK_FLAGS> -Wl,-bE:<TARGET_IMPLIB> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
--- ./Modules/Platform/AIX-XL.cmake_orig	2024-07-26 00:06:26.399925941 -0500
+++ ./Modules/Platform/AIX-XL.cmake	2024-07-26 00:06:43.542086099 -0500
@@ -34,6 +34,14 @@
     "<CMAKE_${lang}_COMPILER> <CMAKE_SHARED_LIBRARY_${lang}_FLAGS> -Wl,-bE:<OBJECT_DIR>/exports.exp <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>"
     )
 
+  # Create an archive for shared library if CMAKE_AIX_SHARED_LIBRARY_ARCHIVE is used.
+  string(REPLACE " <SONAME_FLAG><TARGET_SONAME> -o <TARGET>" " -o <TARGET_SONAME>"
+    CMAKE_${lang}_CREATE_SHARED_LIBRARY_ARCHIVE "${CMAKE_${lang}_CREATE_SHARED_LIBRARY}")
+  list(APPEND CMAKE_${lang}_CREATE_SHARED_LIBRARY_ARCHIVE
+    "<CMAKE_AR> -X32_64 rc <TARGET> <TARGET_SONAME>"
+    "rm -f <TARGET_SONAME>"
+  )
+
   set(CMAKE_${lang}_LINK_EXECUTABLE_WITH_EXPORTS
     "\"${CMAKE_ROOT}/Modules/Platform/AIX/ExportImportList\" -o <TARGET_IMPLIB> -c <CMAKE_${lang}_COMPILER> -l . <AIX_EXPORTS> <OBJECTS>"
     "<CMAKE_${lang}_COMPILER> <FLAGS> <CMAKE_${lang}_LINK_FLAGS> -Wl,-bE:<TARGET_IMPLIB> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
--- ./Modules/Platform/AIX.cmake_orig	2024-07-26 00:07:35.120484256 -0500
+++ ./Modules/Platform/AIX.cmake	2024-07-26 00:07:55.289175150 -0500
@@ -1,5 +1,7 @@
 set(CMAKE_SHARED_LIBRARY_PREFIX "lib")          # lib
 set(CMAKE_SHARED_LIBRARY_SUFFIX ".so")          # .so
+
+set(CMAKE_SHARED_LIBRARY_ARCHIVE_SUFFIX ".a")   # .a
 set(CMAKE_AIX_IMPORT_FILE_PREFIX "")
 set(CMAKE_AIX_IMPORT_FILE_SUFFIX ".imp")
 set(CMAKE_DL_LIBS "-lld")
--- ./Modules/SystemInformation.in_orig	2024-07-26 00:08:21.299562981 -0500
+++ ./Modules/SystemInformation.in	2024-07-26 00:08:37.339674734 -0500
@@ -6,6 +6,7 @@
 CMAKE_STATIC_LIBRARY_SUFFIX == "${CMAKE_STATIC_LIBRARY_SUFFIX}"
 CMAKE_SHARED_LIBRARY_PREFIX == "${CMAKE_SHARED_LIBRARY_PREFIX}"
 CMAKE_SHARED_LIBRARY_SUFFIX == "${CMAKE_SHARED_LIBRARY_SUFFIX}"
+CMAKE_SHARED_LIBRARY_ARCHIVE_SUFFIX == "${CMAKE_SHARED_LIBRARY_ARCHIVE_SUFFIX}"
 CMAKE_SHARED_MODULE_PREFIX == "${CMAKE_SHARED_MODULE_PREFIX}"
 CMAKE_SHARED_MODULE_SUFFIX == "${CMAKE_SHARED_MODULE_SUFFIX}"
 
--- ./Source/cmGeneratorTarget.cxx_orig	2024-07-26 00:09:13.087255486 -0500
+++ ./Source/cmGeneratorTarget.cxx	2024-07-26 00:13:46.013969932 -0500
@@ -3692,6 +3692,9 @@
       return this->GetFeatureSpecificLinkRuleVariable(var, lang, config);
     }
     case cmStateEnums::SHARED_LIBRARY:
+      if (this->IsArchivedAIXSharedLibrary()) {
+        return "CMAKE_" + lang + "_CREATE_SHARED_LIBRARY_ARCHIVE";
+      }
       return "CMAKE_" + lang + "_CREATE_SHARED_LIBRARY";
     case cmStateEnums::MODULE_LIBRARY:
       return "CMAKE_" + lang + "_CREATE_SHARED_MODULE";
@@ -5269,7 +5272,7 @@
   cmValue soversion = this->GetProperty("SOVERSION");
   if (!this->HasSOName(config) ||
       this->Makefile->IsOn("CMAKE_PLATFORM_NO_VERSIONED_SONAME") ||
-      this->IsFrameworkOnApple()) {
+      this->IsFrameworkOnApple() || this->IsArchivedAIXSharedLibrary()) {
     // Versioning is supported only for shared libraries and modules,
     // and then only when the platform supports an soname flag.
     version = nullptr;
@@ -5302,6 +5305,11 @@
     }
     targetNames.Real += cmStrCat(targetNames.Base, components.suffix);
     targetNames.SharedObject = targetNames.Real;
+  } else if (this->IsArchivedAIXSharedLibrary()) {
+    targetNames.SharedObject =
+      cmStrCat(components.prefix, targetNames.Base, ".so");
+    targetNames.Real =
+      cmStrCat(components.prefix, targetNames.Base, components.suffix);
   } else {
     // The library's soname.
     this->ComputeVersionedName(targetNames.SharedObject, components.prefix,
@@ -5385,8 +5393,12 @@
 
   // The executable name.
   targetNames.Base = components.base;
-  targetNames.Output =
-    components.prefix + targetNames.Base + components.suffix;
+  if (this->IsArchivedAIXSharedLibrary()) {
+    targetNames.Output = components.prefix + targetNames.Base;
+  } else {
+    targetNames.Output =
+      components.prefix + targetNames.Base + components.suffix;
+  }
 
 // The executable's real name on disk.
 #if defined(__CYGWIN__)
@@ -8885,6 +8897,11 @@
   return this->Target->IsFrameworkOnApple();
 }
 
+bool cmGeneratorTarget::IsArchivedAIXSharedLibrary() const
+{
+  return this->Target->IsArchivedAIXSharedLibrary();
+}
+
 bool cmGeneratorTarget::IsImportedFrameworkFolderOnApple(
   const std::string& config) const
 {
--- Source/cmGeneratorTarget.h_orig	2024-07-26 00:14:46.638128747 -0500
+++ ./Source/cmGeneratorTarget.h	2024-07-26 00:15:28.036669073 -0500
@@ -858,6 +858,9 @@
   /** Return whether this target is a CFBundle (plugin) on Apple.  */
   bool IsCFBundleOnApple() const;
 
+  /** Return whether this target is a shared library on AIX.  */
+  bool IsArchivedAIXSharedLibrary() const;
+
   /** Assembly types. The order of the values of this enum is relevant
       because of smaller/larger comparison operations! */
   enum ManagedType
--- ./Source/cmInstallTargetGenerator.cxx_orig	2024-07-26 00:15:58.859811042 -0500
+++ ./Source/cmInstallTargetGenerator.cxx	2024-07-26 00:18:35.424232664 -0500
@@ -66,7 +66,7 @@
   // Library interface name.
   std::string fromSOName;
   std::string toSOName;
-  if (library != output) {
+  if (!library.empty() && library != output) {
     haveNamelink = true;
     fromSOName = cmStrCat(fromDirConfig, library);
     toSOName = library;
@@ -403,6 +403,10 @@
 
       files.From.emplace_back(std::move(from1));
       files.To.emplace_back(std::move(to1));
+    } else if (this->Target->IsArchivedAIXSharedLibrary()) {
+      // Install only the archive on AIX.
+      computeFilesToInstall(files, this->NamelinkMode, fromDirConfig,
+                            targetNames.Output, {}, targetNames.Real);
     } else {
       computeFilesToInstall(files, this->NamelinkMode, fromDirConfig,
                             targetNames.Output, targetNames.SharedObject,
--- ./Source/cmMakefileLibraryTargetGenerator.cxx_orig	2024-07-26 00:19:24.690062121 -0500
+++ ./Source/cmMakefileLibraryTargetGenerator.cxx	2024-07-26 00:22:25.987071673 -0500
@@ -169,6 +169,11 @@
   std::string linkRuleVar =
     cmStrCat("CMAKE_", linkLanguage, "_CREATE_SHARED_LIBRARY");
 
+  if (this->GeneratorTarget->IsArchivedAIXSharedLibrary()) {
+    linkRuleVar =
+      cmStrCat("CMAKE_", linkLanguage, "_CREATE_SHARED_LIBRARY_ARCHIVE");
+  }
+
   std::string extraFlags;
   this->GetTargetLinkFlags(extraFlags, linkLanguage);
   this->LocalGenerator->AddConfigVariableFlags(
@@ -788,7 +793,8 @@
     vars.LinkLibraries = linkLibs.c_str();
     vars.ObjectsQuoted = buildObjs.c_str();
     std::string targetOutSOName;
-    if (this->GeneratorTarget->HasSOName(this->GetConfigName())) {
+    if (this->GeneratorTarget->HasSOName(this->GetConfigName()) ||
+        this->GeneratorTarget->IsArchivedAIXSharedLibrary()) {
       vars.SONameFlag = this->Makefile->GetSONameFlag(linkLanguage);
       targetOutSOName = this->LocalGenerator->ConvertToOutputFormat(
         this->TargetNames.SharedObject, cmOutputConverter::SHELL);
--- ./Source/cmNinjaNormalTargetGenerator.cxx_orig	2024-07-26 00:25:08.320825496 -0500
+++ ./Source/cmNinjaNormalTargetGenerator.cxx	2024-07-26 00:26:39.854283617 -0500
@@ -1490,7 +1490,8 @@
 
   cmNinjaVars symlinkVars;
   bool const symlinkNeeded =
-    (targetOutput != targetOutputReal && !gt->IsFrameworkOnApple());
+      (targetOutput != targetOutputReal && !gt->IsFrameworkOnApple() &&
+     !gt->IsArchivedAIXSharedLibrary());
   if (!symlinkNeeded) {
     vars["POST_BUILD"] = postBuildCmdLine;
   } else {
--- ./Source/cmTarget.cxx_orig	2024-07-26 00:28:10.113606912 -0500
+++ ./Source/cmTarget.cxx	2024-07-26 00:30:45.841414816 -0500
@@ -1271,6 +1273,12 @@
           this->IsApple() && this->GetPropertyAsBool("FRAMEWORK"));
 }
 
+bool cmTarget::IsArchivedAIXSharedLibrary() const
+{
+  return (this->GetType() == cmStateEnums::SHARED_LIBRARY && this->IsAIX() &&
+          this->GetPropertyAsBool("AIX_SHARED_LIBRARY_ARCHIVE"));
+}
+
 bool cmTarget::IsAppBundleOnApple() const
 {
   return (this->GetType() == cmStateEnums::EXECUTABLE && this->IsApple() &&
@@ -2983,7 +2991,9 @@
     case cmStateEnums::SHARED_LIBRARY:
       switch (artifact) {
         case cmStateEnums::RuntimeBinaryArtifact:
-          return "CMAKE_SHARED_LIBRARY_SUFFIX";
+          return this->IsArchivedAIXSharedLibrary()
+            ? "CMAKE_SHARED_LIBRARY_ARCHIVE_SUFFIX"
+            : "CMAKE_SHARED_LIBRARY_SUFFIX";
         case cmStateEnums::ImportLibraryArtifact:
           return this->IsApple() ? "CMAKE_APPLE_IMPORT_FILE_SUFFIX"
                                  : "CMAKE_IMPORT_LIBRARY_SUFFIX";
--- ./Source/cmTarget.h_orig	2024-07-26 00:31:49.114050012 -0500
+++ ./Source/cmTarget.h	2024-07-26 00:32:37.545039929 -0500
@@ -229,6 +229,9 @@
   //! Return whether this target is a shared library Framework on Apple.
   bool IsFrameworkOnApple() const;
 
+  //! Return whether to archive shared library or not on AIX.
+  bool IsArchivedAIXSharedLibrary() const;
+
   //! Return whether this target is an executable Bundle on Apple.
   bool IsAppBundleOnApple() const;

--- ./Source/cmTarget.cxx_orig	2024-09-03 06:32:13.389774601 -0500
+++ ./Source/cmTarget.cxx	2024-09-03 06:32:47.225592581 -0500
@@ -407,6 +407,8 @@
   { "VS_USE_DEBUG_LIBRARIES"_s, IC::NonImportedTarget },
   // ---- OpenWatcom
   { "WATCOM_RUNTIME_LIBRARY"_s, IC::CanCompileSources },
+  // ---- AIX
+  { "AIX_SHARED_LIBRARY_ARCHIVE"_s, IC::SharedLibraryTarget },
   // -- Language
   // ---- C
   COMMON_LANGUAGE_PROPERTIES(C),
