[libc-commits] [compiler-rt] [flang] [clang] [libc] [llvm] [clang-tools-extra] [libcxx] [lldb] [PowerPC] Support mcmodel=large for AIX (PR #70652)

Fangrui Song via libc-commits libc-commits at lists.llvm.org
Thu Nov 2 00:58:45 PDT 2023


================
@@ -5723,16 +5723,14 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
   if (Arg *A = Args.getLastArg(options::OPT_mcmodel_EQ)) {
     StringRef CM = A->getValue();
     bool Ok = false;
-    if (Triple.isOSAIX() && CM == "medium") {
+    if (Triple.isOSAIX() && CM == "medium")
       CM = "large";
-      Ok = true;
-    }
     if (Triple.isAArch64(64)) {
       Ok = CM == "tiny" || CM == "small" || CM == "large";
       if (CM == "large" && RelocationModel != llvm::Reloc::Static)
         D.Diag(diag::err_drv_argument_only_allowed_with)
             << A->getAsString(Args) << "-fno-pic";
-    } else if (Triple.isPPC64()) {
+    } else if (Triple.isPPC64() || Triple.isOSAIX()) {
----------------
MaskRay wrote:

Hi, may I ask what `-mcmodel=large` does on a 32-bit AIX?

`-mcmodel=large` is generally not supported for 32-bit systems and it seems that AIX does something special here.

GCC's rs6000 doc says:

> Generate PowerPC64 code for the large model: The TOC may be up to 4G in size. Other data and code is only limited by the 64-bit address space.

https://github.com/llvm/llvm-project/pull/70652


More information about the libc-commits mailing list