[all-commits] [llvm/llvm-project] e12905: [OpenMP] Add basic support for properly handling s...

Joseph Huber via All-commits all-commits at lists.llvm.org
Fri May 6 08:21:19 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e12905b4d5f95952600515901b82da0a8eefcd73
      https://github.com/llvm/llvm-project/commit/e12905b4d5f95952600515901b82da0a8eefcd73
  Author: Joseph Huber <jhuber6 at vols.utk.edu>
  Date:   2022-05-06 (Fri, 06 May 2022)

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

  Log Message:
  -----------
  [OpenMP] Add basic support for properly handling static libraries

Currently we handle static libraries like any other object in the
linker wrapper. However, this does not preserve the sematnics that
dictate static libraries should be lazily loaded as the symbols are
needed. This allows us to ignore linking in architectures that are not
used by the main application being compiled. This patch adds the basic
support for detecting if a file came from a static library, and only
including it in the link job if it's used by other object files.

This patch only adds the basic support, to be more correct we should
check the symbols and only inclue the library if the link job contains
symbols that are needed. Ideally we could just put this on the linker
itself, but nvlink doesn't seem to support `.a` files.

Reviewed By: jdoerfert

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




More information about the All-commits mailing list