testsuite: Detect clang
Clang doesn't like the -Wno-psabi argument that we want to pass to GCC. Since clang is detected as GCC via __GNUC__, use ax_cv_c_compiler_vendor.
This commit is contained in:
@@ -100,18 +100,16 @@ proc libffi-init { args } {
|
|||||||
global libffi_link_flags
|
global libffi_link_flags
|
||||||
global tool_root_dir
|
global tool_root_dir
|
||||||
global ld_library_path
|
global ld_library_path
|
||||||
|
global compiler_vendor
|
||||||
global using_gcc
|
|
||||||
|
|
||||||
set blddirffi [pwd]/..
|
set blddirffi [pwd]/..
|
||||||
verbose "libffi $blddirffi"
|
verbose "libffi $blddirffi"
|
||||||
|
|
||||||
# Are we building with GCC?
|
# Which compiler are we building with?
|
||||||
set tmp [grep ../config.status "GCC='yes'"]
|
set tmp [grep ../config.log "^ax_cv_c_compiler_vendor.*$"]
|
||||||
if { [string match $tmp "GCC='yes'"] } {
|
regexp -- {^[^=]*=(.*)$} $tmp nil compiler_vendor
|
||||||
|
|
||||||
set using_gcc "yes"
|
|
||||||
|
|
||||||
|
if { [string match $compiler_vendor "gnu"] } {
|
||||||
set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
|
set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
|
||||||
if {$gccdir != ""} {
|
if {$gccdir != ""} {
|
||||||
set gccdir [file dirname $gccdir]
|
set gccdir [file dirname $gccdir]
|
||||||
@@ -135,11 +133,6 @@ proc libffi-init { args } {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
set using_gcc "no"
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# add the library path for libffi.
|
# add the library path for libffi.
|
||||||
@@ -278,18 +271,25 @@ proc libffi-dg-runtest { testcases default-extra-flags } {
|
|||||||
}
|
}
|
||||||
|
|
||||||
proc run-many-tests { testcases extra_flags } {
|
proc run-many-tests { testcases extra_flags } {
|
||||||
global using_gcc
|
global compiler_vendor
|
||||||
if { [string match $using_gcc "yes"] } {
|
switch $compiler_vendor {
|
||||||
|
"clang" {
|
||||||
|
set common "-W -Wall"
|
||||||
|
set optimizations { "-O0" "-O1" "-O2" "-O3" "-Os" }
|
||||||
|
}
|
||||||
|
"gnu" {
|
||||||
set common "-W -Wall -Wno-psabi"
|
set common "-W -Wall -Wno-psabi"
|
||||||
set optimizations { "-O0" "-O2" "-O3" "-Os" "-O2 -fomit-frame-pointer" }
|
set optimizations { "-O0" "-O2" "-O3" "-Os" "-O2 -fomit-frame-pointer" }
|
||||||
} else {
|
}
|
||||||
|
default {
|
||||||
# Assume we are using the vendor compiler.
|
# Assume we are using the vendor compiler.
|
||||||
set common ""
|
set common ""
|
||||||
set optimizations { "" }
|
set optimizations { "" }
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
set targetabis { "" }
|
set targetabis { "" }
|
||||||
if [string match $using_gcc "yes"] {
|
if [string match $compiler_vendor "gnu"] {
|
||||||
if [istarget "i?86-*-*"] {
|
if [istarget "i?86-*-*"] {
|
||||||
set targetabis {
|
set targetabis {
|
||||||
""
|
""
|
||||||
|
|||||||
Reference in New Issue
Block a user