Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
serge-sans-paille
committed
Nov 3, 2020
1 parent
90131e3
commit cfc3226
Showing
10 changed files
with
107 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh | ||
# REQUIRES: x86 | ||
# UNSUPPORTED: system-windows | ||
|
||
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux /dev/null -o %t0.o | ||
# RUN: not ld.lld -o /dev/null -lidontexist --error-handling-script=%s %t0.o 2>&1 |\ | ||
# RUN: FileCheck --check-prefix=CHECK-LIB %s | ||
# RUN: not ld.lld -o /dev/null -lidontexist --error-handling-script=%s.nope %t0.o 2>&1 |\ | ||
# RUN: FileCheck --check-prefix=CHECK-SCRIPT-DOES-NOT-EXIST -DFILE=%s.nope %s | ||
|
||
# CHECK-LIB: script: info: called with missing-lib idontexist | ||
# CHECK-LIB-NEXT: ld.lld: error: unable to find library -lidontexist | ||
|
||
# CHECK-SCRIPT-DOES-NOT-EXIST: ld.lld: error: unable to find library -lidontexist | ||
# CHECK-SCRIPT-DOES-NOT-EXIST-NEXT: ld.lld: error: error handling script '[[FILE]]' failed to execute | ||
|
||
echo "script: info: called with $*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
:: REQUIRES: x86, system-windows | ||
:: RUN: echo | llvm-mc -filetype=obj -triple=x86_64-unknown-linux - -o %t0.o | ||
:: RUN: not ld.lld -o /dev/null -lidontexist --error-handling-script=%s %t0.o 2>&1 |\ | ||
:: RUN: FileCheck --check-prefix=CHECK-LIB %s | ||
:: RUN: not ld.lld -o /dev/null -lidontexist --error-handling-script=%s.nope %t0.o 2>&1 |\ | ||
:: RUN: FileCheck --check-prefix=CHECK-SCRIPT-DOES-NOT-EXIST -DFILE=%s.nope %s | ||
:: | ||
:: CHECK-LIB: script: info: called with missing-lib idontexist | ||
:: CHECK-LIB-NEXT: ld.lld: error: unable to find library -lidontexist | ||
|
||
:: CHECK-SCRIPT-DOES-NOT-EXIST: ld.lld: error: unable to find library -lidontexist | ||
:: CHECK-SCRIPT-DOES-NOT-EXIST-NEXT: ld.lld: error: error handling script '[[FILE]]' failed to execute | ||
|
||
@echo off | ||
echo "script: info: called with %*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
config.suffixes = ['.test', '.s', '.ll'] | ||
config.suffixes = ['.test', '.s', '.ll', '.bat'] |