[all-commits] [llvm/llvm-project] 4f2cfb: [llvm-ar] Add object mode option -X for AIX

diggerlin via All-commits all-commits at lists.llvm.org
Fri Jul 22 06:55:44 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4f2cfbe5314b064625b2c87bde6ce5c8d04004c5
      https://github.com/llvm/llvm-project/commit/4f2cfbe5314b064625b2c87bde6ce5c8d04004c5
  Author: zhijian <zhijian at ca.ibm.com>
  Date:   2022-07-22 (Fri, 22 Jul 2022)

  Changed paths:
    M llvm/docs/CommandGuide/llvm-ar.rst
    M llvm/test/lit.cfg.py
    A llvm/test/tools/llvm-ar/Inputs/bitcode-sym32.ll
    A llvm/test/tools/llvm-ar/Inputs/bitcode-sym64.ll
    A llvm/test/tools/llvm-ar/invalid-option-X.test
    A llvm/test/tools/llvm-ar/option-X.test
    M llvm/tools/llvm-ar/llvm-ar.cpp

  Log Message:
  -----------
  [llvm-ar] Add object mode option -X for AIX

Summary:

1. Added a new option object mode -X for llvm-ar. In AIX OS , there is a object mode option -X for ar command.
please see the "-X mode" part of https://www.ibm.com/docs/ko/aix/7.1?topic=ar-command

Specifies the type of object file ar should examine. The mode must be one of the following:
32
Processes only 32-bit object files
64
Processes only 64-bit object files
32_64
Processes both 32-bit and 64-bit object files
any
Processes all of the supported object files.

The default is to process 32-bit object files (ignore 64-bit objects). The mode can also be set with the OBJECT_MODE environment variable. For example, OBJECT_MODE=64 causes ar to process any 64-bit objects and ignore 32-bit objects. The -X flag overrides the OBJECT_MODE variable.

2. Before adding the new option -X, the default behaviors of llvm-ar like -Xany, but after the adding the new option -X, the default behaviors of llvm-ar change to -X32 ,in order to let some test cases which has 32bit and 64bit object file in the same llvm-ar command, we need to add the "export OBJECT_MODE=any" into test case to change the default behaviors of llvm-ar's object mode.

Reviewers: James Henderson, Owen Reynolds, Fangrui Song
Differential Revision: https://reviews.llvm.org/D127864




More information about the All-commits mailing list