]>
Commit | Line | Data |
---|---|---|
f1717362 | 1 | # Copyright (C) 2005-2016 Free Software Foundation, Inc. |
c6dc6159 | 2 | # |
3 | # This program is free software; you can redistribute it and/or modify | |
4 | # it under the terms of the GNU General Public License as published by | |
6bc9506f | 5 | # the Free Software Foundation; either version 3 of the License, or |
c6dc6159 | 6 | # (at your option) any later version. |
7 | # | |
8 | # This program is distributed in the hope that it will be useful, | |
9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
11 | # GNU General Public License for more details. | |
12 | # | |
13 | # You should have received a copy of the GNU General Public License | |
6bc9506f | 14 | # along with this program; see the file COPYING3. If not see |
15 | # <http://www.gnu.org/licenses/>. | |
c6dc6159 | 16 | |
d4101db6 | 17 | # If there is no baseline file, or we can't find the library, skip |
099c5a78 | 18 | # this test. Or, hey, if we don't support this kind of symbol |
19 | # versioning test: don't run it. | |
20 | ||
eb9bd3cc | 21 | # Only run whole abi.exp in one instance, serially. |
22 | if ![gcc_parallel_test_run_p abi] { | |
23 | return | |
24 | } | |
25 | gcc_parallel_test_enable 0 | |
26 | ||
145d8b5f | 27 | if { [string match "*-*-darwin*" $target_triplet] } { |
28 | set lib $blddir/src/.libs/libstdc++.dylib | |
29 | } else { | |
30 | set lib $blddir/src/.libs/libstdc++.so | |
31 | } | |
32 | ||
099c5a78 | 33 | # Build the support objects. |
34 | v3-build_support | |
35 | ||
da177fdf | 36 | if { (${v3-symver} == 0) || ![info exists baseline_dir] \ |
37 | || ![file exists $baseline_dir] \ | |
38 | || ![file exists $lib] } { | |
eb9bd3cc | 39 | gcc_parallel_test_enable 1 |
da177fdf | 40 | return |
41 | } | |
42 | ||
339edeef | 43 | set baseline_subdir "[eval exec $cxx $baseline_subdir_switch]" |
44 | ||
da177fdf | 45 | set baseline_file \ |
46 | [file join $baseline_dir $baseline_subdir "baseline_symbols.txt"] | |
47 | # If there is no ABI-specific reference file use that of the default ABI. | |
48 | if ![file exists $baseline_file] { | |
49 | set baseline_file [file join $baseline_dir "baseline_symbols.txt"] | |
50 | } | |
51 | if ![file exists $baseline_file] { | |
eb9bd3cc | 52 | gcc_parallel_test_enable 1 |
c6dc6159 | 53 | return |
54 | } | |
da177fdf | 55 | send_log "Checking $lib against $baseline_file\n" |
c6dc6159 | 56 | |
d4101db6 | 57 | # Figure out what symbols are defined by the active build of the library. |
eb9bd3cc | 58 | remote_exec "build" "$blddir/scripts/extract_symvers" \ |
da177fdf | 59 | [list $lib "current_symbols.txt"] |
d4101db6 | 60 | |
c6dc6159 | 61 | # Build the abi_check program. |
acb09254 | 62 | if { [v3_target_compile "$srcdir/util/testsuite_abi_check.cc" "abi_check" \ |
c6dc6159 | 63 | "executable" [list "additional_flags=-w"]] != "" } { |
4f67a81c | 64 | error "could not compile testsuite_abi_check.cc" |
c6dc6159 | 65 | } |
66 | ||
67 | remote_download "target" $baseline_file "baseline_symbols.txt" | |
68 | remote_download "target" "current_symbols.txt" "current_symbols.txt" | |
69 | set result [${tool}_load "./abi_check" \ | |
70 | [list "--check-verbose" "current_symbols.txt" \ | |
71 | "baseline_symbols.txt"]] | |
4c69eea5 | 72 | [lindex $result 0] "libstdc++-abi/abi_check" |
eb9bd3cc | 73 | |
74 | gcc_parallel_test_enable 1 |