Provide a hook to customize missing library error handling
authorserge-sans-paille <sguelton@redhat.com>
Mon, 19 Oct 2020 11:19:52 +0000 (13:19 +0200)
committerserge-sans-paille <sguelton@redhat.com>
Tue, 3 Nov 2020 10:01:29 +0000 (11:01 +0100)
commitcfc32267e27f77211ee5eb6e30c52ab2c7740e6e
tree54ae7faabdeb831bf136f040b7efe659aac6ccf0
parent90131e3ecb753c38cc99e060aa69ca1766d96432
Provide a hook to customize missing library error handling

Make it possible for lld users to provide a custom script that would help to
find missing libraries. A possible scenario could be:

    % clang /tmp/a.c -fuse-ld=lld -loauth -Wl,--error-handling-script=/tmp/addLibrary.py
    unable to find library -loauth
    looking for relevant packages to provides that library

        liboauth-0.9.7-4.el7.i686
        liboauth-devel-0.9.7-4.el7.i686
        liboauth-0.9.7-4.el7.x86_64
        liboauth-devel-0.9.7-4.el7.x86_64
        pix-1.6.1-3.el7.x86_64

Where addLibrary would be called with the missing library name as first argument
(in that case addLibrary.py oauth)

Differential Revision: https://reviews.llvm.org/D87758
lld/Common/ErrorHandler.cpp
lld/ELF/Driver.cpp
lld/ELF/Options.td
lld/docs/ReleaseNotes.rst
lld/docs/index.rst
lld/docs/ld.lld.1
lld/include/lld/Common/ErrorHandler.h
lld/test/ELF/error-handling-script-linux.test [new file with mode: 0755]
lld/test/ELF/error-handling-script-windows.bat [new file with mode: 0644]
lld/test/ELF/lit.local.cfg