[all-commits] [llvm/llvm-project] 92bca1: [AIX] add new option -mignore-xcoff-visibility

diggerlin via All-commits all-commits at lists.llvm.org
Thu Oct 8 06:35:54 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 92bca1284308452b8eb549e9382873645320cf19
      https://github.com/llvm/llvm-project/commit/92bca1284308452b8eb549e9382873645320cf19
  Author: diggerlin <digger.llvm at gmail.com>
  Date:   2020-10-08 (Thu, 08 Oct 2020)

  Changed paths:
    M clang/docs/ClangCommandLineReference.rst
    M clang/include/clang/Basic/CodeGenOptions.def
    M clang/include/clang/Driver/Options.td
    M clang/lib/CodeGen/BackendUtil.cpp
    M clang/lib/Driver/ToolChains/Clang.cpp
    M clang/lib/Frontend/CompilerInvocation.cpp
    A clang/test/CodeGen/aix-ignore-xcoff-visibility.cpp
    A clang/test/Driver/ignore-xcoff-visibility.cpp
    M llvm/include/llvm/CodeGen/CommandFlags.h
    M llvm/include/llvm/Target/TargetMachine.h
    M llvm/include/llvm/Target/TargetOptions.h
    M llvm/lib/CodeGen/CommandFlags.cpp
    M llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
    A llvm/test/CodeGen/PowerPC/aix-ignore-xcoff-visibility.ll

  Log Message:
  -----------
  [AIX] add new option -mignore-xcoff-visibility

SUMMARY:

In IBM compiler xlclang , there is an option -fnovisibility which suppresses visibility. For more details see: https://www.ibm.com/support/knowledgecenter/SSGH3R_16.1.0/com.ibm.xlcpp161.aix.doc/compiler_ref/opt_visibility.html.

We need to add the option -mignore-xcoff-visibility for compatibility with the IBM AIX OS (as the option is enabled by default in AIX). With this option llvm does not emit any visibility attribute to ASM or XCOFF object file.

The option only work on the AIX OS, for other non-AIX OS using the option will report an unsupported options error.

In AIX OS:

1.1  the option -mignore-xcoff-visibility is enabled by default , if there is not -fvisibility=* and -mignore-xcoff-visibility explicitly in the clang command .

1.2 if there is -fvisibility=* explicitly but not -mignore-xcoff-visibility  explicitly in the clang command.  it will generate visibility attributes.

1.3 if there are  both  -fvisibility=* and  -mignore-xcoff-visibility  explicitly in the clang command. The option  "-mignore-xcoff-visibility" wins , it do not emit the visibility attribute.

The option -mignore-xcoff-visibility has no effect on visibility attribute when compile with -emit-llvm option to generated LLVM IR.

Reviewer: daltenty,Jason Liu

Differential Revision: https://reviews.llvm.org/D87451




More information about the All-commits mailing list