[PATCH] D142660: [AIX] supporting -X options for llvm-ranlib in AIX OS

Stephen Peckham via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 12 15:20:47 PDT 2023


stephenpeckham added a comment.

Do the -U and -D flags have any effect on the behavior of llvm-ranlib?



================
Comment at: llvm/test/tools/llvm-ranlib/aix-X-option.test:16
+
+## Test OBJECT_MODE environment variable when adding symbol table
+# RUN: env OBJECT_MODE=32 llvm-ranlib t_X32.a
----------------
what about OBJECT_MODE= (defined, but empty value)


================
Comment at: llvm/tools/llvm-ar/llvm-ar.cpp:80
+         << "  -U                    - Use actual timestamps and uids/gids\n"
+         << "  -X {32|64|32_64}      - Specifies the type of object files"
+            "llvm-ranlib should examine (AIX OS only)\n";
----------------
I think the AIX documentation for ranlib isn't as helpful as it could be. I actually like a variation of the original message better:

"-X {32|64|32_64}      - Specifies which archive symbol tables should be generated if they do not already exist (AIX OS only)\n"

This implies that a 32-bit (64-bit) global symbol table is generated by examining XCOFF32 (XCOFF64) members.

But this wording doesn't really fit with the command description: Generate an //index// for archives. Should this be "Generate an index or symbol tables for archives"? Or just "Generate symbol tables for archives"?  The usage message for llvm-ar also mixes "index" and "symbol table"


================
Comment at: llvm/tools/llvm-ar/llvm-ar.cpp:127
   [P] - use full names when matching (implied for thin archives)
   [s] - create an archive index (cf. ranlib)
   [S] - do not build a symbol table
----------------
"Index" or "symbol table"?  See the related comment about the usage message for "ranlib".  


================
Comment at: llvm/tools/llvm-ar/llvm-ar.cpp:1278
   return StringSwitch<BitModeTy>(RawBitMode)
+      .Case("", BitModeTy::Bit32)
       .Case("32", BitModeTy::Bit32)
----------------
AIX commands differentiate between OBJECT_MODE='' (an empty string) and OBJECT_MODE not defined.  This function treats them the same way.

-X '' (an empty string) should also be an error. I would return Unknown for case "".  For the Default case, if RawBitMode is NULL, Bit32 should be returned.



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142660/new/

https://reviews.llvm.org/D142660



More information about the cfe-commits mailing list