Bug 38000 - [4.3 Regression] System header files not found once -isystem /usr/include is used
[4.3 Regression] System header files not found once -isystem /usr/include is ...
Status: RESOLVED FIXED
Product: gcc
Classification: Unclassified
Component: libstdc++
4.3.2
: P3 major
: 4.3.3
Assigned To: Not yet assigned to anyone
:
: 36505 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-11-03 09:33 UTC by Jens Seidel
Modified: 2009-01-09 00:01 UTC (History)
6 users (show)

See Also:
Host: i486-linux-gnu
Target: i486-linux-gnu
Build: i486-linux-gnu
Known to work: 4.2.4 4.4.0
Known to fail: 4.3.2
Last reconfirmed: 2008-11-03 12:25:17


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jens Seidel 2008-11-03 09:33:26 UTC
$ cat test.cpp
#include <cstdlib>

$ g++ -c -isystem /usr/include test.cpp
In file included from test.cpp:1:
/usr/include/c++/4.3/cstdlib:73:25: error: stdlib.h: No such file or directory
...

This happens on two different system with 4.3.1 and 4.3.2.
See also http://gcc.gnu.org/ml/gcc-help/2008-10/msg00338.html
Comment 1 Richard Biener 2008-11-03 12:25:16 UTC
appending -v shows

 /usr/lib64/gcc/x86_64-suse-linux/4.3/cc1plus -quiet -v -D_GNU_SOURCE t.C -quiet -dumpbase t.C -mtune=generic -auxbase t -version -o t.s
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/4.3
 /usr/include/c++/4.3/x86_64-suse-linux
 /usr/include/c++/4.3/backward
 /usr/local/include
 /usr/lib64/gcc/x86_64-suse-linux/4.3/include
 /usr/lib64/gcc/x86_64-suse-linux/4.3/include-fixed
 /usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/include
 /usr/include
End of search list.

vs.

 /usr/lib64/gcc/x86_64-suse-linux/4.3/cc1plus -quiet -v -D_GNU_SOURCE -isystem /usr/include t.C -quiet -dumpbase t.C -mtune=generic -auxbase t -version -o t.s
ignoring duplicate directory "/usr/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include
 /usr/include/c++/4.3
 /usr/include/c++/4.3/x86_64-suse-linux
 /usr/include/c++/4.3/backward
 /usr/local/include
 /usr/lib64/gcc/x86_64-suse-linux/4.3/include
 /usr/lib64/gcc/x86_64-suse-linux/4.3/include-fixed
 /usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/include
End of search list.

note the different ordering which will likely make #include_next fail?  It
works for me with 4.2.
Comment 2 Jakub Jelinek 2008-11-03 12:39:08 UTC
The include_next doesn't make any sense in the cXXX headers, include_next is typically used when including the same header name, not when you are including unrelated header name, exactly because making assumptions whether it comes earlier or later in the search path is bad.
Comment 3 Jakub Jelinek 2008-11-03 12:41:23 UTC
4.1.x used just #include, not #include_next in cstdio to include <stdio.h>,
so I guess this is libstdc++-v3 regression, not driver.
Comment 4 Paolo Carlini 2008-11-11 12:48:46 UTC
I think the use of include_next started with Benjamin's patch of 2007-03-04, adding c_global. Benjamin, can you look into this issue? Otherwise, missing a solid rationale, for 4.4.0 I would just remove the uses, per Jakub' suggestion.
Comment 5 pinskia@gmail.com 2008-11-12 18:01:29 UTC
Subject: Re:  [4.3/4.4 Regression] System header files not found once -isystem /usr/include is used

Hmm,  shouldn't the preprocessor just mark the include as a duplicate?

Sent from my iPhone

On Nov 12, 2008, at 8:50 AM, "paolo dot carlini at oracle dot com" <gcc-bugzilla@gcc.gnu.org 
 > wrote:

>
>
> -- 
>
> paolo dot carlini at oracle dot com changed:
>
>           What    |Removed                     |Added
> --- 
> --- 
> ----------------------------------------------------------------------
>         AssignedTo|unassigned at gcc dot gnu   |paolo dot carlini at  
> oracle
>                   |dot org                     |dot com
>             Status|NEW                         |ASSIGNED
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38000
>
Comment 6 paolo@gcc.gnu.org 2008-11-13 00:08:25 UTC
Subject: Bug 38000

Author: paolo
Date: Thu Nov 13 00:06:55 2008
New Revision: 141812

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=141812
Log:
2008-11-13  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/38000
	* include/c_global/csignal: Do not use include_next.
	* include/c_global/cstdlib: Likewise.
	* include/c_global/cstdio: Likewise.
	* include/c_global/cstdarg: Likewise.
	* include/c_global/cctype: Likewise.
	* include/c_global/cerrno: Likewise.
	* include/c_global/cmath: Likewise.
	* include/c_global/clocale: Likewise.
	* include/c_global/climits: Likewise.
	* include/c_global/cassert: Likewise.
	* include/c_global/csetjmp: Likewise.
	* include/c_global/cwchar: Likewise.
	* include/c_global/cfloat: Likewise.
	* include/c_global/cstdbool: Likewise.
	* include/c_global/cstring: Likewise.
	* include/c_global/cstddef: Likewise.
	* include/c_global/cwctype: Likewise.
	* include/tr1/cstdbool: Likewise.
	* include/tr1_impl/cinttypes: Do not include <inttypes.h>.
	* include/c_global/cinttypes: Do it here.
	* include/tr1/cinttypes: Likewise.
	* include/tr1_impl/cfenv: Do not include <fenv.h>.
	* include/c_global/cfenv: Do it here.
	* include/tr1/cfenv: Likewise.
	* include/tr1_impl/cstdint: Do not include <stdint.h>.
	* include/c_global/cstdint: Do it here.
	* include/tr1/cstdint: Likewise.
	* include/c_compatibility/fenv.h: Include <tr1_impl/cfenv>.
	* include/c_compatibility/stdint.h: Include <tr1_impl/cstdint>.
	* include/c_compatibility/inttypes.h: Include <tr1_impl/cinttypes>.

	* include/c_compatibility/math.h: Minor tweak, add comment.

Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/c_compatibility/fenv.h
    trunk/libstdc++-v3/include/c_compatibility/inttypes.h
    trunk/libstdc++-v3/include/c_compatibility/math.h
    trunk/libstdc++-v3/include/c_compatibility/stdint.h
    trunk/libstdc++-v3/include/c_global/cassert
    trunk/libstdc++-v3/include/c_global/cctype
    trunk/libstdc++-v3/include/c_global/cerrno
    trunk/libstdc++-v3/include/c_global/cfenv
    trunk/libstdc++-v3/include/c_global/cfloat
    trunk/libstdc++-v3/include/c_global/cinttypes
    trunk/libstdc++-v3/include/c_global/climits
    trunk/libstdc++-v3/include/c_global/clocale
    trunk/libstdc++-v3/include/c_global/cmath
    trunk/libstdc++-v3/include/c_global/csetjmp
    trunk/libstdc++-v3/include/c_global/csignal
    trunk/libstdc++-v3/include/c_global/cstdarg
    trunk/libstdc++-v3/include/c_global/cstdbool
    trunk/libstdc++-v3/include/c_global/cstddef
    trunk/libstdc++-v3/include/c_global/cstdint
    trunk/libstdc++-v3/include/c_global/cstdio
    trunk/libstdc++-v3/include/c_global/cstdlib
    trunk/libstdc++-v3/include/c_global/cstring
    trunk/libstdc++-v3/include/c_global/ctime
    trunk/libstdc++-v3/include/c_global/cwchar
    trunk/libstdc++-v3/include/c_global/cwctype
    trunk/libstdc++-v3/include/tr1/cfenv
    trunk/libstdc++-v3/include/tr1/cinttypes
    trunk/libstdc++-v3/include/tr1/cstdbool
    trunk/libstdc++-v3/include/tr1/cstdint
    trunk/libstdc++-v3/include/tr1_impl/cfenv
    trunk/libstdc++-v3/include/tr1_impl/cinttypes
    trunk/libstdc++-v3/include/tr1_impl/cstdint

Comment 7 Paolo Carlini 2008-11-13 00:09:52 UTC
Fixed for 4.4.0.
Comment 8 Benjamin Kosnik 2009-01-08 22:41:23 UTC
Hey Paolo, what do you think about applying this patch to the gcc-4_3-branch and change the target milestone to 4.3.3, marking it FIXED?

-benjamin
Comment 9 Benjamin Kosnik 2009-01-08 22:42:35 UTC
*** Bug 36505 has been marked as a duplicate of this bug. ***
Comment 10 Paolo Carlini 2009-01-08 23:02:52 UTC
Ok, I'll do the backport.
Comment 11 paolo@gcc.gnu.org 2009-01-09 00:00:40 UTC
Subject: Bug 38000

Author: paolo
Date: Fri Jan  9 00:00:17 2009
New Revision: 143194

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=143194
Log:
2009-01-08  Paolo Carlini  <paolo.carlini@oracle.com>

	Backport from mainline:
	2008-11-13  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/38000
	* include/c_global/csignal: Do not use include_next.
	* include/c_global/cstdlib: Likewise.
	* include/c_global/cstdio: Likewise.
	* include/c_global/cstdarg: Likewise.
	* include/c_global/cctype: Likewise.
	* include/c_global/cerrno: Likewise.
	* include/c_global/cmath: Likewise.
	* include/c_global/clocale: Likewise.
	* include/c_global/climits: Likewise.
	* include/c_global/cassert: Likewise.
	* include/c_global/csetjmp: Likewise.
	* include/c_global/cwchar: Likewise.
	* include/c_global/cfloat: Likewise.
	* include/c_global/cstdbool: Likewise.
	* include/c_global/cstring: Likewise.
	* include/c_global/cstddef: Likewise.
	* include/c_global/cwctype: Likewise.
	* include/tr1/cstdbool: Likewise.
	* include/tr1_impl/cinttypes: Do not include <inttypes.h>.
	* include/c_global/cinttypes: Do it here.
	* include/tr1/cinttypes: Likewise.
	* include/tr1_impl/cfenv: Do not include <fenv.h>.
	* include/c_global/cfenv: Do it here.
	* include/tr1/cfenv: Likewise.
	* include/tr1_impl/cstdint: Do not include <stdint.h>.
	* include/c_global/cstdint: Do it here.
	* include/tr1/cstdint: Likewise.
	* include/c_compatibility/fenv.h: Include <tr1_impl/cfenv>.
	* include/c_compatibility/stdint.h: Include <tr1_impl/cstdint>.
	* include/c_compatibility/inttypes.h: Include <tr1_impl/cinttypes>.

	* include/c_compatibility/math.h: Minor tweak, add comment.

Modified:
    branches/gcc-4_3-branch/libstdc++-v3/ChangeLog
    branches/gcc-4_3-branch/libstdc++-v3/include/c_compatibility/fenv.h
    branches/gcc-4_3-branch/libstdc++-v3/include/c_compatibility/inttypes.h
    branches/gcc-4_3-branch/libstdc++-v3/include/c_compatibility/math.h
    branches/gcc-4_3-branch/libstdc++-v3/include/c_compatibility/stdint.h
    branches/gcc-4_3-branch/libstdc++-v3/include/c_global/cassert
    branches/gcc-4_3-branch/libstdc++-v3/include/c_global/cctype
    branches/gcc-4_3-branch/libstdc++-v3/include/c_global/cerrno
    branches/gcc-4_3-branch/libstdc++-v3/include/c_global/cfenv
    branches/gcc-4_3-branch/libstdc++-v3/include/c_global/cfloat
    branches/gcc-4_3-branch/libstdc++-v3/include/c_global/cinttypes
    branches/gcc-4_3-branch/libstdc++-v3/include/c_global/climits
    branches/gcc-4_3-branch/libstdc++-v3/include/c_global/clocale
    branches/gcc-4_3-branch/libstdc++-v3/include/c_global/cmath
    branches/gcc-4_3-branch/libstdc++-v3/include/c_global/csetjmp
    branches/gcc-4_3-branch/libstdc++-v3/include/c_global/csignal
    branches/gcc-4_3-branch/libstdc++-v3/include/c_global/cstdarg
    branches/gcc-4_3-branch/libstdc++-v3/include/c_global/cstdbool
    branches/gcc-4_3-branch/libstdc++-v3/include/c_global/cstddef
    branches/gcc-4_3-branch/libstdc++-v3/include/c_global/cstdint
    branches/gcc-4_3-branch/libstdc++-v3/include/c_global/cstdio
    branches/gcc-4_3-branch/libstdc++-v3/include/c_global/cstdlib
    branches/gcc-4_3-branch/libstdc++-v3/include/c_global/cstring
    branches/gcc-4_3-branch/libstdc++-v3/include/c_global/ctime
    branches/gcc-4_3-branch/libstdc++-v3/include/c_global/cwchar
    branches/gcc-4_3-branch/libstdc++-v3/include/c_global/cwctype
    branches/gcc-4_3-branch/libstdc++-v3/include/tr1/cfenv
    branches/gcc-4_3-branch/libstdc++-v3/include/tr1/cinttypes
    branches/gcc-4_3-branch/libstdc++-v3/include/tr1/cstdbool
    branches/gcc-4_3-branch/libstdc++-v3/include/tr1/cstdint
    branches/gcc-4_3-branch/libstdc++-v3/include/tr1_impl/cfenv
    branches/gcc-4_3-branch/libstdc++-v3/include/tr1_impl/cinttypes
    branches/gcc-4_3-branch/libstdc++-v3/include/tr1_impl/cstdint

Comment 12 Paolo Carlini 2009-01-09 00:01:40 UTC
Fixed 4.3.3 too.