It would be nice to be able to provide a custom script that would help users 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)
LLD uses lower-case variable names.
It occurs to me that we could just fold this and the existing error method together, and just default args to an empty list. Then, if args is empty, don't do the script launching bit.
@MaskRay/@grimar, what do you think about extending the ErrorHandler to actually store the path to the script somewhere? That way, it doesn't need specifying every time, and the only argument needs to be the tag and any missing payload. It'll keep the error calls that use this cleaner.