2 # Wrapper around gcc to run 'dwz' when running the testsuite.
4 # Copyright (C) 2010-2012 Free Software Foundation, Inc.
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 # This program requires dwz in addition to gcc.
22 # bash$ cd $objdir/gdb/testsuite
24 # CC_FOR_TARGET="/bin/sh $srcdir/cc-with-dwz.sh gcc" \
25 # CXX_FOR_TARGET="/bin/sh $srcdir/cc-with-dwz.sh g++"
33 next_is_output_file
=no
38 if [ "$next_is_output_file" = "yes" ]
41 next_is_output_file
=no
45 # Poor man's gcc argument parser.
46 # We don't need to handle all arguments, we just need to know if we're
47 # doing a link and what the output file is.
48 # It's not perfect, but it seems to work well enough for the task at hand.
53 "-o") next_is_output_file
=yes ;;
57 if [ "$next_is_output_file" = "yes" ]
59 echo "$myname: Unable to find output file" >&2
63 if [ "$have_link" = "no" ]
71 [ $rc != 0 ] && exit $rc
72 if [ ! -f "$output_file" ]
74 echo "$myname: Internal error: $output_file missing." >&2
78 $DWZ "$output_file" > /dev
/null
2>&1