Subject: pkg/21122: lang/gcc{,3} unconditionally searches PREFIX/include for header files
To: None <gnats-bugs@gnats.netbsd.org>
From: None <grant@netbsd.org>
List: netbsd-bugs
Date: 04/13/2003 21:28:38
>Number:         21122
>Category:       pkg
>Synopsis:       lang/gcc{,3} unconditionally searches PREFIX/include for header files
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Apr 13 04:29:01 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator:     grant beattie
>Release:        SunOS 5.9
>Organization:
>Environment:
System: SunOS u10 5.9 Generic_112233-04 sun4u sparc SUNW,Ultra-5_10
Architecture: sparc
Machine: sun4u
>Description:
gcc by default looks in PREFIX/include for header files, regardless of
whether -IPREFIX/include is specified. This severely breaks buildlink2
because all header files in PREFIX/include are available to the
compiler, causing some package builds to fail.

An example of this is devel/gdb, which cannot be built with lang/gcc if
devel/ncurses is installed due to conflicting header files.

A possible workaround is to set CFLAGS=-nostdinc -I/usr/include, but
this is ugly.
>How-To-Repeat:
# ls -l /usr/pkg/include/ncurses.h
-r--r--r--   1 root     root       55879 Apr  8 02:41 /usr/pkg/include/ncurses.h
# cat blah.c
#include <ncurses.h>

main () { }

# /usr/pkg/bin/gcc -c blah.c
#
>Fix:
hack the gcc pkg to not look in PREFIX/include.
>Release-Note:
>Audit-Trail:
>Unformatted: