[PATCH] D148726: [ELF] Support --exclude-inputs

Marco Elver via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 19 09:37:23 PDT 2023


melver created this revision.
Herald added subscribers: arichardson, emaste.
Herald added a reviewer: MaskRay.
Herald added a project: All.
melver requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Linking of binaries in large projects often results in processing of
thousands of linker inputs. In such projects, controlling all transitive
dependencies' inputs and libraries to be added to the final linker
command is (unfortunately) often too complex.

In theory the build system should provide a convenient way to simply
exclude a given library, but the reality is that few build systems do.

The simplest possible design, that will work across all build systems,
is therefore to pass an option to the linker to exclude inputs matching
a given pattern. The possible use cases are:

1. Removing inputs added by dependencies (e.g. via pkg-config) where modification of the build scripts (or build systems such as Bazel) is infeasible.
2. Replacing inputs added by dependencies where modification of the build scripts is infeasible.
3. Replacing default inputs with custom implementations.

Introduce --exclude-inputs, which accomplishes just that.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D148726

Files:
  lld/ELF/Config.h
  lld/ELF/Driver.cpp
  lld/ELF/Options.td
  lld/docs/ld.lld.1
  lld/test/ELF/exclude-inputs.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D148726.514992.patch
Type: text/x-patch
Size: 3218 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230419/0b1775df/attachment.bin>


More information about the llvm-commits mailing list