public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Nick Clifton <nickc@redhat.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: binutils@sources.redhat.com,  gdb-patches@sources.redhat.com,
	 newlib@sources.redhat.com
Subject: Re: Dejagnu: use -isystem to include system header files.
Date: Thu, 11 Nov 2004 15:54:00 -0000	[thread overview]
Message-ID: <41938BDF.7040104@redhat.com> (raw)
In-Reply-To: <20041111142237.GA25841@nevyn.them.org>

[-- Attachment #1: Type: text/plain, Size: 1356 bytes --]

Hi Daniel,

> This patch will break in-tree testing for yet other targets.  I believe
> arm-elf was affected - anything which does not set
> NO_IMPLICIT_EXTERN_C.  I discussed this with H-P on the dejagnu list
> but never figured out a solution, but...

>>        * lib/libgloss.exp (newlib_include_flags): Use -isystem, not -I.
>>        (libio_include_flags, g++_include_flags, libstdc++_include_flags,
>>        winsup_include_flags): Ditto.

> ... I strongly suspect that g++ and winsup should be left out.


Ok - what about this revision to the patched sources based upon Rob 
Savoye's suggestion that -isystem is only needed for newlib includes ?

It appears to work for the xstormy16 port and I did not detect any 
regression for the arm-elf port, so I think that it should be OK.

Assuming that you like this patch, shall I submit it to Rob for 
inclusion in the official sources as well ?

Cheers
   Nick

dejagnu/ChangeLog
2004-11-11  Nick Clifton  <nickc@redhat.com>

	* lib/libgloss.exp (libio_include_flags, g++_include_flags,
	winsup_include_flags): Revert previous patch, restoring the use of
	-I, for all libraries except newlib.  Newlib needs -isystem to
	avoid the problems with <limits.h> but the C++ and winsup
	libraries need -I because -isystem generates an implicit 'extern
	"C"' which may not be appropriate for certain targets.




[-- Attachment #2: libgloss.exp.patch --]
[-- Type: text/plain, Size: 4167 bytes --]

Index: dejagnu/lib/libgloss.exp
===================================================================
RCS file: /cvs/src/src/dejagnu/lib/libgloss.exp,v
retrieving revision 1.11
diff -c -3 -p -r1.11 libgloss.exp
*** dejagnu/lib/libgloss.exp	11 Nov 2004 11:55:11 -0000	1.11
--- dejagnu/lib/libgloss.exp	11 Nov 2004 15:46:03 -0000
*************** 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 " -isystem ${libio_src_dir} -isystem ${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 " -I${libio_src_dir} -I${libio_bin_dir}"
      } else {
  	return ""
      }
*************** proc g++_include_flags { args } {
*** 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"
--- 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"
*************** proc libstdc++_include_flags { args } {
*** 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"
--- 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"
*************** 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 " -isystem ${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 " -I${winsup_dir}"
  	}
      }
      verbose "No winsup support for this target"

  reply	other threads:[~2004-11-11 15:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-11 11:54 Nick Clifton
2004-11-11 14:22 ` Daniel Jacobowitz
2004-11-11 15:54   ` Nick Clifton [this message]
2004-11-11 17:00     ` Daniel Jacobowitz
2004-11-12  0:25   ` Hans-Peter Nilsson
2004-11-12  0:29     ` Daniel Jacobowitz
2004-11-12  1:29       ` Zack Weinberg
2004-11-17 17:47 Richard Earnshaw
2004-11-18  9:15 ` Nick Clifton
2004-11-18 11:15   ` Richard Earnshaw
2004-11-18 15:56     ` Nick Clifton
2004-11-18 20:07 Richard Earnshaw
2004-11-22 14:05 ` Nick Clifton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41938BDF.7040104@redhat.com \
    --to=nickc@redhat.com \
    --cc=binutils@sources.redhat.com \
    --cc=drow@false.org \
    --cc=gdb-patches@sources.redhat.com \
    --cc=newlib@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).