NetBSD Problem Report #47213

From Wolfgang.Stukenbrock@nagler-company.com  Mon Nov 19 09:33:45 2012
Return-Path: <Wolfgang.Stukenbrock@nagler-company.com>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	by www.NetBSD.org (Postfix) with ESMTP id BC98063E8A7
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 19 Nov 2012 09:33:44 +0000 (UTC)
Message-Id: <20121119093333.2952C97110@s011.nagler-company.com>
Date: Mon, 19 Nov 2012 10:33:33 +0100 (CET)
From: Wolfgang.Stukenbrock@nagler-company.com
Reply-To: Wolfgang.Stukenbrock@nagler-company.com
To: gnats-bugs@gnats.NetBSD.org
Subject: gcc45, gcc46 and gcc47 from pkgsrc-2012Q3 on NetBSD installs bad include files
X-Send-Pr-Version: 3.95

>Number:         47213
>Category:       pkg
>Synopsis:       gcc45, gcc46 and gcc47 from pkgsrc-2012Q3 on NetBSD installs bad include files
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    sbd
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Nov 19 09:35:00 +0000 2012
>Last-Modified:  Sun Dec 16 19:31:06 +0000 2012
>Originator:     Dr. Wolfgang Stukenbrock
>Release:        NetBSD 5.1.2 - pkgsrc 2012Q3
>Organization:
Dr. Nagler & Company GmbH
>Environment:


System: NetBSD s011 5.1.2 NetBSD 5.1.2 (NSW-S011) #5: Fri Nov 16 14:54:56 CET 2012 wgstuken@s011:/usr/src/sys/arch/amd64/compile/NSW-S011 amd64
Architecture: x86_64
Machine: amd64
>Description:
	If the preprocessor variable _FORTIFY_SOURCE is defined to something larger 0, than the file ssp/stdio.h is included
	from stdio.h. There is a special version inside the gcc-include tree for gcc45, gcc46 and gcc47.
	There the file "ssp.h" will be included. This file is located in the ssp subdirectory too, but the include statement
	does not honor the subdirctory. The system headerfiles /usr/include/ssp/{stdio,string,unistd}.h include
	"ssp/ssp.h" and this works as expected.
>How-To-Repeat:
	install lang/gcc45, lang/gcc46 and/or lang/gcc47 and try to compile something - I'm trying to compile rstudio-server.
	You will end up in messages like:

In file included from /usr/include/stdio.h:498:0,
                 from /usr/include/wchar.h:67,
                 from /home/.pkg/pkg/gcc45/bin/../lib/gcc/../../include/c++/cwchar:47,
                 from /home/.pkg/pkg/gcc45/bin/../lib/gcc/../../include/c++/bits/postypes.h:42,
                 from /home/.pkg/pkg/gcc45/bin/../lib/gcc/../../include/c++/iosfwd:42,
                 from /var/tmp/rstudio-rstudio-9a26dbb/src/cpp/core/include/core/Error.hpp:17,
                 from /var/tmp/rstudio-rstudio-9a26dbb/src/cpp/core/Assert.cpp:15:
/home/.pkg/pkg/gcc45/bin/../lib/gcc/x86_64-unknown-netbsd5.1.2/4.5.3/include/ssp/stdio.h:38:17: fatal error: ssp.h: No such file or directory
compilation terminated.

	Remark: I've placed /usr/pkg in /home/.pkg/pkg for filesystem space reasons on my test system.
	        /usr/pkg is a symlink to /home/.pkg/pkg.
	The output is taken from gcc45. gcc46 and gcc47 produces the "same" messages.
	Any hello world program that include stdio.h compiled with e.g. "/usr/pkg/gcc46/bin/bin -D_FORTIFY_SOURCE=1 t.c"
	will fail too and report:
In file included from /usr/include/stdio.h:498:0,
                 from t.c:1:
/home/.pkg/pkg/gcc46/bin/../lib/gcc/x86_64-unknown-netbsd5.1.2/4.6.3/include/ssp/stdio.h:38:17: fatal error: ssp.h: No such file or directory
compilation terminated.

	My example programm t.c follows:
#include <stdio.h>
int main(int argc, char **argv) { return 0; }
>Fix:
	change the include lines from "#include <ssp.h>" to "#include <ssp/ssp.h>" and it will compile.
	The files ssp/stdio.h, ssp/strings.h and ssp/unistd.h are affected.
	The system compile gcc-4.1.x includes "ssp/ssp.h" in the corresponding files too, so this fix seems
	to be the correct way.
	I'm not shure where to add a patch for this to the gcc sources - the build of gcc looks a little bit special.

	remark: I'm not shure if gcc44 is affected too. It does not compile on 5.1.2 here. I will report this as own bug.

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->sbd
Responsible-Changed-By: hauke@NetBSD.org
Responsible-Changed-When: Sun, 16 Dec 2012 19:31:06 +0000
Responsible-Changed-Why:
Over to maintainer.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.