Merging r326358:

r326358 | dim | 2018-02-28 12:04:21 -0800 (Wed, 28 Feb 2018) | 29 lines

Fix llvm-config --system-libs output on FreeBSD and NetBSD

For various reasons, CMake's detection mechanism for `backtrace()`
returns an absolute path `/usr/lib/` on FreeBSD and

Since `tools/llvm-config/CMakeLists.txt` only checks if system
libraries start with `-`, this causes `llvm-config --system-libs` to
produce the following incorrect output:

-lrt -l/usr/lib/ -ltinfo -lpthread -lz -lm

Fix it by removing the path and the `lib` prefix, to make it look like a
regular short library name, suitable for appending to a `-l` link flag.

This also fixes the `Bindings/Go/go.test` test case, since that always
died with "unable to find library -l/usr/lib/".

Reviewers: chandlerc, emaste, joerg, krytarowski

Reviewed By: krytarowski

Subscribers: hans, bdrewery, mgorny, hintonda, llvm-commits

Differential Revision:


git-svn-id: 91177308-0d34-0410-b5e6-96231b3b80d8
1 file changed