[all-commits] [llvm/llvm-project] 34dd8e: [clang, SystemZ] Support -munaligned-symbols (#73511)

Jonas Paulsson via All-commits all-commits at lists.llvm.org
Sat Jan 27 09:29:50 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 34dd8ec8aec17965313b17308faaa6272c235c53
      https://github.com/llvm/llvm-project/commit/34dd8ec8aec17965313b17308faaa6272c235c53
  Author: Jonas Paulsson <paulson1 at linux.ibm.com>
  Date:   2024-01-27 (Sat, 27 Jan 2024)

  Changed paths:
    M clang/include/clang/AST/ASTContext.h
    M clang/include/clang/Basic/TargetInfo.h
    M clang/include/clang/Driver/Options.td
    M clang/lib/AST/ASTContext.cpp
    M clang/lib/Basic/Targets/AArch64.cpp
    M clang/lib/Basic/Targets/AArch64.h
    M clang/lib/Basic/Targets/CSKY.cpp
    M clang/lib/Basic/Targets/CSKY.h
    M clang/lib/Basic/Targets/NVPTX.cpp
    M clang/lib/Basic/Targets/SPIR.h
    M clang/lib/Basic/Targets/SystemZ.cpp
    M clang/lib/Basic/Targets/SystemZ.h
    M clang/lib/CodeGen/CodeGenModule.cpp
    M clang/lib/Driver/ToolChains/Arch/SystemZ.cpp
    M clang/lib/Sema/SemaOpenMP.cpp
    A clang/test/CodeGen/SystemZ/unaligned-symbols.c
    M llvm/lib/Target/SystemZ/SystemZFeatures.td

  Log Message:
  -----------
  [clang, SystemZ] Support -munaligned-symbols (#73511)

When this option is passed to clang, external (and/or weak) symbols
are not assumed to have the minimum ABI alignment normally required.
Symbols defined locally that are not weak are however still given the
minimum alignment.

This is implemented by passing a new parameter to getMinGlobalAlign()
named HasNonWeakDef that is used to return the right alignment value.

This is needed when external symbols created from a linker script may
not get the ABI minimum alignment and must therefore be treated as
unaligned by the compiler.




More information about the All-commits mailing list