This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Dejagnu: use -isystem to include system header files.
- From: Nick Clifton <nickc at redhat dot com>
- To: binutils at sources dot redhat dot com
- Cc: gdb-patches at sources dot redhat dot com, newlib at sources dot redhat dot com
- Date: Thu, 11 Nov 2004 11:58:15 +0000
- Subject: Dejagnu: use -isystem to include system header files.
Hi Guys,
I am going to check in the attached patch which imports a fix from
the mainline dejagnu sources. This fix is to use the -isystem
switch to include system header files rather than -I. This fixes
several unexpected failures in the GCC and G++ testsuites where the
newlib system header file <limits.h> is included in strict ANSI
mode, and the compiler barfs on the #include_next directive.
Cheers
Nick
dejagnu/ChangeLog
2004-11-11 Nick Clifton <nickc@redhat.com>
* Import this patch from dejagnu mainline sources. It fixes
unexpected failures in the GCC and G++ testsuites where <limits.h>
is #include's in strict ANSI mode.
2002-11-12 Hans-Peter Nilsson <hp@bitrange.com>
* lib/libgloss.exp (newlib_include_flags): Use -isystem, not -I.
(libio_include_flags, g++_include_flags, libstdc++_include_flags,
winsup_include_flags): Ditto.
* doc/user.sgml (Local Config File): Use -isystem, not -I, in
example.
Index: dejagnu/lib/libgloss.exp
===================================================================
RCS file: /cvs/src/src/dejagnu/lib/libgloss.exp,v
retrieving revision 1.10
diff -c -3 -p -r1.10 libgloss.exp
*** dejagnu/lib/libgloss.exp 11 Feb 2003 13:51:32 -0000 1.10
--- dejagnu/lib/libgloss.exp 11 Nov 2004 11:52:12 -0000
*************** proc newlib_include_flags { args } {
*** 159,165 ****
if { ${newlib_dir} != "" } {
set newlib_dir [file dirname ${newlib_dir}]
}
! return " -I$gccpath/newlib/targ-include -I${newlib_dir}"
} else {
verbose "No newlib support for this target"
}
--- 159,165 ----
if { ${newlib_dir} != "" } {
set newlib_dir [file dirname ${newlib_dir}]
}
! return " -isystem $gccpath/newlib/targ-include -isystem ${newlib_dir}"
} else {
verbose "No newlib support for this target"
}
*************** proc libio_include_flags { args } {
*** 191,197 ****
if { $libio_bin_dir != "" && $libio_src_dir != "" } {
set libio_src_dir [file dirname ${libio_src_dir}]
set libio_bin_dir [file dirname ${libio_bin_dir}];
! return " -I${libio_src_dir} -I${libio_bin_dir}"
} else {
return ""
}
--- 191,197 ----
if { $libio_bin_dir != "" && $libio_src_dir != "" } {
set libio_src_dir [file dirname ${libio_src_dir}]
set libio_bin_dir [file dirname ${libio_bin_dir}];
! return " -isystem ${libio_src_dir} -isystem ${libio_bin_dir}"
} else {
return ""
}
*************** proc g++_include_flags { args } {
*** 226,247 ****
set dir [lookfor_file ${srcdir} libg++]
if { ${dir} != "" } {
! append flags " -I${dir} -I${dir}/src"
}
set dir [lookfor_file ${srcdir} libstdc++-v3]
if { ${dir} != "" } {
! append flags " -I${dir}/include -I${dir}/include/std -I${dir}/include/c_std -I${dir}/libsupc++"
}
set dir [lookfor_file ${gccpath} libstdc++-v3]
if { ${dir} != "" } {
! append flags " -I${dir}/include -I${dir}/include/${target_alias}"
}
set dir [lookfor_file ${srcdir} libstdc++]
if { ${dir} != "" } {
! append flags " -I${dir} -I${dir}/stl"
}
return "$flags"
--- 226,247 ----
set dir [lookfor_file ${srcdir} libg++]
if { ${dir} != "" } {
! append flags " -isystem ${dir} -isystem ${dir}/src"
}
set dir [lookfor_file ${srcdir} libstdc++-v3]
if { ${dir} != "" } {
! append flags " -isystem ${dir}/include -isystem ${dir}/include/std -isystem ${dir}/include/c_std -isystem ${dir}/libsupc++"
}
set dir [lookfor_file ${gccpath} libstdc++-v3]
if { ${dir} != "" } {
! append flags " -isystem ${dir}/include -isystem ${dir}/include/${target_alias}"
}
set dir [lookfor_file ${srcdir} libstdc++]
if { ${dir} != "" } {
! append flags " -isystem ${dir} -isystem ${dir}/stl"
}
return "$flags"
*************** proc libstdc++_include_flags { args } {
*** 317,335 ****
set dir [lookfor_file ${srcdir} libstdc++-v3]
if { ${dir} != "" } {
! append flags " -I${dir}/include -I${dir}/include/std -I${dir}/include/c_std -I${dir}/libsupc++"
}
set gccpath [get_multilibs]
set dir [lookfor_file ${gccpath} libstdc++-v3]
if { ${dir} != "" } {
! append flags " -I${dir}/include -I${dir}/include/${target_alias}"
}
set dir [lookfor_file ${srcdir} libstdc++]
if { ${dir} != "" } {
! append flags " -I${dir} -I${dir}/stl"
}
return "$flags"
--- 317,335 ----
set dir [lookfor_file ${srcdir} libstdc++-v3]
if { ${dir} != "" } {
! append flags " -isystem ${dir}/include -isystem ${dir}/include/std -isystem ${dir}/include/c_std -isystem ${dir}/libsupc++"
}
set gccpath [get_multilibs]
set dir [lookfor_file ${gccpath} libstdc++-v3]
if { ${dir} != "" } {
! append flags " -isystem ${dir}/include -isystem ${dir}/include/${target_alias}"
}
set dir [lookfor_file ${srcdir} libstdc++]
if { ${dir} != "" } {
! append flags " -isystem ${dir} -isystem ${dir}/stl"
}
return "$flags"
*************** proc libstdc++_link_flags { args } {
*** 376,382 ****
#
# Get the list of directories and -m options for gcc. This is kinda bogus that
! # generic testing software needs support for gcc hardwired in, but to make
# testing the GNU tools work right, there didn't seem to be any other way.
#
--- 376,382 ----
#
# Get the list of directories and -m options for gcc. This is kinda bogus that
! # generic testing software needs support for gcc hardwired in, but to make
# testing the GNU tools work right, there didn't seem to be any other way.
#
*************** proc winsup_include_flags { args } {
*** 867,873 ****
set winsup_dir [lookfor_file ${srcdir} winsup/include/windows.h]
if { ${winsup_dir} != "" } {
set winsup_dir [file dirname ${winsup_dir}]
! return " -I${winsup_dir}"
}
}
verbose "No winsup support for this target"
--- 867,873 ----
set winsup_dir [lookfor_file ${srcdir} winsup/include/windows.h]
if { ${winsup_dir} != "" } {
set winsup_dir [file dirname ${winsup_dir}]
! return " -isystem ${winsup_dir}"
}
}
verbose "No winsup support for this target"
Index: dejagnu/doc/user.sgml
===================================================================
RCS file: /cvs/src/src/dejagnu/doc/user.sgml,v
retrieving revision 1.2
diff -c -3 -p -r1.2 user.sgml
*** dejagnu/doc/user.sgml 21 Apr 2002 08:47:03 -0000 1.2
--- dejagnu/doc/user.sgml 11 Nov 2004 11:52:13 -0000
***************
*** 803,815 ****
<sect1 id=local xreflabel="Local Config File">
<title>Local Config File</title>
!
<para>It is usually more convenient to keep these <emphasis>manual
overrides</emphasis> in the <filename>site.exp</filename>
local to each test directory, rather than in the global
<filename>site.exp</filename> in the installed DejaGnu
library. This file is mostly for supplying tool specific info
! that is required by the test suite.</para>
<para>All local <filename>site.exp</filename> files have
two sections, separated by comment text. The first section is
--- 803,815 ----
<sect1 id=local xreflabel="Local Config File">
<title>Local Config File</title>
!
<para>It is usually more convenient to keep these <emphasis>manual
overrides</emphasis> in the <filename>site.exp</filename>
local to each test directory, rather than in the global
<filename>site.exp</filename> in the installed DejaGnu
library. This file is mostly for supplying tool specific info
! that is required by the testsuite.</para>
<para>All local <filename>site.exp</filename> files have
two sections, separated by comment text. The first section is
***************
*** 869,875 ****
<example>
<title>Local Config File</title>
! <programlisting>
## these variables are automatically generated by make ##
# Do not edit here. If you wish to override these values
# add them to the last section
--- 869,875 ----
<example>
<title>Local Config File</title>
! <programlisting>
## these variables are automatically generated by make ##
# Do not edit here. If you wish to override these values
# add them to the last section
***************
*** 879,904 ****
set target_triplet i586-pc-linux-gnulibc1
set target_alias i586-pc-linux-gnulibc1
set CFLAGS ""
! set CXXFLAGS "-I/build/devo-builds/i586-pc-linux-gnulibc1/gcc/../libio -I$srcdir/../libg++/src -I$srcdir/../libio -I$srcdir/../libstdc++ -I$srcdir/../libstdc++/stl -L/build/devo-builds/i586-pc-linux-gnulibc1/gcc/../libg++ -L/build/devo-builds/i586-pc-linux-gnulibc1/gcc/../libstdc++"
append LDFLAGS " -L/build/devo-builds/i586-pc-linux-gnulibc1/gcc/../ld"
set tmpdir /build/devo-builds/i586-pc-linux-gnulibc1/gcc/testsuite
set srcdir "${srcdir}/testsuite"
## All variables above are generated by configure. Do Not Edit ##
!
! </programlisting>
</example>
<para>This file defines the required fields for a local config
file, namely the three config triplets, and the srcdir. It also
defines several other Tcl variables that are used exclusivly by
! the GCC test suite. For most test cases, the CXXFLAGS and LDFLAGS
are supplied by DejaGnu itself for cross testing, but to test a
compiler, GCC needs to manipulate these itself.</para>
</sect1>
<sect1 id=global xreflabel="Global Config File">
<title>Global Config File</title>
!
<para>The master config file is where all the target specific
config variables get set for a whole site get set. The idea is
that for a centralized testing lab where people have to share a
--- 879,904 ----
set target_triplet i586-pc-linux-gnulibc1
set target_alias i586-pc-linux-gnulibc1
set CFLAGS ""
! set CXXFLAGS "-isystem /build/devo-builds/i586-pc-linux-gnulibc1/gcc/../libio -isystem $srcdir/../libg++/src -isystem $srcdir/../libio -isystem $srcdir/../libstdc++ -isystem $srcdir/../libstdc++/stl -L/build/devo-builds/i586-pc-linux-gnulibc1/gcc/../libg++ -L/build/devo-builds/i586-pc-linux-gnulibc1/gcc/../libstdc++"
append LDFLAGS " -L/build/devo-builds/i586-pc-linux-gnulibc1/gcc/../ld"
set tmpdir /build/devo-builds/i586-pc-linux-gnulibc1/gcc/testsuite
set srcdir "${srcdir}/testsuite"
## All variables above are generated by configure. Do Not Edit ##
!
! </programlisting>
</example>
<para>This file defines the required fields for a local config
file, namely the three config triplets, and the srcdir. It also
defines several other Tcl variables that are used exclusivly by
! the GCC testsuite. For most test cases, the CXXFLAGS and LDFLAGS
are supplied by DejaGnu itself for cross testing, but to test a
compiler, GCC needs to manipulate these itself.</para>
</sect1>
<sect1 id=global xreflabel="Global Config File">
<title>Global Config File</title>
!
<para>The master config file is where all the target specific
config variables get set for a whole site get set. The idea is
that for a centralized testing lab where people have to share a