[all-commits] [llvm/llvm-project] b530e1: [LinkerWrapper] Do not extract globals with no off...

Joseph Huber via All-commits all-commits at lists.llvm.org
Mon Mar 27 09:38:44 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b530e1af62be16ffb06285ddca27a413f5089b7e
      https://github.com/llvm/llvm-project/commit/b530e1af62be16ffb06285ddca27a413f5089b7e
  Author: Joseph Huber <jhuber6 at vols.utk.edu>
  Date:   2023-03-27 (Mon, 27 Mar 2023)

  Changed paths:
    M clang/test/Driver/linker-wrapper-libs.c
    M clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp

  Log Message:
  -----------
  [LinkerWrapper] Do not extract globals with no offloading language

The linker wrapper needs to reinvent its own special static library
handling for static libraries containing fatbinaries. This is primarily
because offloading languages expect certain global symbols to be visible
to the host so we must consider them used symbols. However we should be
able to remove this requirement if we are linking in "freestanding" code
that was not created by an offloading language.

The motivation for this is to support the work-in-progress `libc` for
GPUs. It is provided as a static library with no offloading language
set. This logic will let us only import used `libc` symbols always.

Reviewed By: yaxunl

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




More information about the All-commits mailing list