diff options
Diffstat (limited to 'binutils/testsuite/lib/binutils-common.exp')
-rw-r--r-- | binutils/testsuite/lib/binutils-common.exp | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/binutils/testsuite/lib/binutils-common.exp b/binutils/testsuite/lib/binutils-common.exp index 2da7138..7297f6d 100644 --- a/binutils/testsuite/lib/binutils-common.exp +++ b/binutils/testsuite/lib/binutils-common.exp @@ -44,7 +44,6 @@ proc is_elf_format {} { && ![istarget kvx-*-*] && ![istarget *-*-*linux*] && ![istarget *-*-lynxos*] - && ![istarget *-*-nacl*] && ![istarget *-*-netbsd*] && ![istarget *-*-nto*] && ![istarget *-*-openbsd*] @@ -238,7 +237,6 @@ proc match_target { target } { proc supports_gnu_osabi {} { if { [istarget *-*-gnu*] || [istarget *-*-linux*] - || [istarget *-*-nacl*] || ( [istarget *-*-*bsd*] && ![istarget arm*-*-netbsd*] ) || [istarget *-*-lynxos] || ( [istarget *-*-nto*] && ![istarget arm*-*-*] ) @@ -1813,3 +1811,30 @@ proc get_standard_section_names {} { } return } + +set llvm_plug_opt "" +if { [isnative] } then { + if ![info exists CLANG_FOR_TARGET] then { + catch "exec clang -v" got + if [regexp "clang version" $got] then { + set CLANG_FOR_TARGET clang + } + } + if [info exists CLANG_FOR_TARGET] then { + set llvm_plug_so [string trim [exec $CLANG_FOR_TARGET -print-file-name=LLVMgold.so]] + if { $llvm_plug_so ne "LLVMgold.so" } then { + set llvm_plug_opt "--plugin $llvm_plug_so" + } + + if { $llvm_plug_opt eq "" } then { + # If it is still blank, try llvm-config --libdir. Clang + # searches CLANG_INSTALL_LIBDIR_BASENAME which corresponds + # to this. + catch "exec llvm-config --libdir" got + if {[file isdirectory $got] \ + && [file isfile $got/LLVMgold.so]} then { + set llvm_plug_opt "--plugin $got/LLVMgold.so" + } + } + } +} |