other/10532: include-path broken for cross-gccs (PREFIX_INCLUDE_DIR)

corsepiu@faw.uni-ulm.de corsepiu@faw.uni-ulm.de
Tue Apr 29 07:19:00 GMT 2003


>Number:         10532
>Category:       other
>Synopsis:       include-path broken for cross-gccs (PREFIX_INCLUDE_DIR)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 29 01:36:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     corsepiu@faw.uni-ulm.de
>Release:        gcc-3.2.x, gcc-3.3, gcc-3.4
>Organization:
>Environment:
Any.
>Description:
Any cross-gcc has $prefix/include before 
$prefix/<target>/include and $prefix/lib/gcc-lib/<target>/<version>/include in its include-path.

This is not correct, because $prefix/include for cross-gccs contains host-headers, not target-headers, like it does for native gccs and therefore bogusly pulls-in host headers.
>How-To-Repeat:
Build a cross-gcc and examine the include-path
Example:
touch tmp.c
i386-rtems-gcc -v -o tmp.o -c tmp.c

gcc version 3.2.2 (OAR Corporation gcc-3.2.2-20030425/newlib-1.11.0-20030416a-0_rc_10)
 /opt/rtems/lib/gcc-lib/i386-rtems/3.2.2/cc1 -lang-c -v -D__GNUC__=3 -D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=2 -D__GXX_ABI_VERSION=102
-D__rtems__ -D__ELF__ -D__i386__ -D__USE_INIT_FINI__ -D__rtems__ -D__ELF__ -D__i386__ -D__USE_INIT_FINI__ -Asystem=rtems -D__NO_INLINE__ -D__STDC_HOSTED__=1 -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i386__ tmp.c -quiet -dumpbase tmp.c -version -o /tmp/cc66lQPD.s
GNU CPP version 3.2.2 (OAR Corporation gcc-3.2.2-20030425/newlib-1.11.0-20030416a-0_rc_10) (cpplib) (i386 bare ELF target)
GNU C version 3.2.2 (OAR Corporation gcc-3.2.2-20030425/newlib-1.11.0-20030416a-0_rc_10) (i386-rtems)
        compiled by GNU C version 3.2.2 20030313 (Red Hat Linux 3.2.2-10).
ignoring nonexistent directory "/opt/rtems/i386-rtems/sys-include"
#include "..." search starts here:
#include <...> search starts here:
 /opt/rtems/include
 /opt/rtems/lib/gcc-lib/i386-rtems/3.2.2/include
 /opt/rtems/i386-rtems/include
End of search list.
>Fix:
The cause of this seems to be PREFIX_INCLUDE_DIR in gcc/configure.in. 
The patch in the attachment works around this issue by #undef'ing PREFIX_INCLUDE_DIR in cppdefaults.h for cross-compilation.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="gcc-3.2.2-prefix-include-dir.diff"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="gcc-3.2.2-prefix-include-dir.diff"

LS0tIC91c3IvbG9jYWwvc3JjL3BhY2thZ2VzL2djYy9zdWJ2ZXJzaW9ucy9nY2MtMy4yLjIvZ2Nj
L2NwcGRlZmF1bHQuaAkyMDAxLTEwLTE0IDA5OjM1OjA3LjAwMDAwMDAwMCArMDIwMAorKysgZ2Nj
LTMuMi4yL2djYy9jcHBkZWZhdWx0LmgJMjAwMy0wNC0yOCAyMzo1Mzo0OC4wMDAwMDAwMDAgKzAy
MDAKQEAgLTM4LDYgKzM4LDcgQEAKICN1bmRlZiBMT0NBTF9JTkNMVURFX0RJUgogI3VuZGVmIFNZ
U1RFTV9JTkNMVURFX0RJUgogI3VuZGVmIFNUQU5EQVJEX0lOQ0xVREVfRElSCisjdW5kZWYgUFJF
RklYX0lOQ0xVREVfRElSCiAjZWxzZQogI3VuZGVmIENST1NTX0lOQ0xVREVfRElSCiAjZW5kaWYK



More information about the Gcc-bugs mailing list