NetBSD Problem Report #37200

From martin@duskware.de  Wed Oct 24 21:30:17 2007
Return-Path: <martin@duskware.de>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id B09CE63BA90
	for <gnats-bugs@gnats.netbsd.org>; Wed, 24 Oct 2007 21:30:17 +0000 (UTC)
Message-Id: <20071024195827.A7F4663B89A@narn.NetBSD.org>
Date: Wed, 24 Oct 2007 19:58:27 +0000 (UTC)
From: uli@habel.name
Reply-To: uli@habel.name
To: netbsd-bugs-owner@NetBSD.org
Subject: devel/glib2 fails on Solaris 5.9 due to compiler flags in sunpro.mk
X-Send-Pr-Version: www-1.0

>Number:         37200
>Category:       pkg
>Synopsis:       devel/glib2 fails on Solaris 5.9 due to compiler flags in sunpro.mk
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    solaris-pkg-people
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Oct 24 21:35:00 +0000 2007
>Closed-Date:    Fri Nov 30 16:57:36 +0000 2007
>Last-Modified:  Sat Dec 22 23:20:29 +0000 2007
>Originator:     Ulrich Habel
>Release:        SunOS 5.9
>Organization:
>Environment:
SunOS sun-install 5.9 Generic_122300-12 sun4u sparc SUNW,Sun-Fire-V240
>Description:
When you try to build devel/glib2 on Solaris 5.9 using the SUNPro Compiler it fails in the configure phase when a test binary is compiled.

checking for Mac OS X Carbon support... checking for style of include used by make... GNU
checking for sparc-sun-solaris2-gcc... gcc
checking for C compiler default output file name... configure: error: C compiler cannot create executables
See `config.log' for more details.
*** Error code 77

config.log shows the following problem:

configure:3105: gcc -V >&5
cc: Sun C 5.8 Patch 121015-05 2007/08/01
usage: cc [ options] files.  Use 'cc -flags' for details
configure:3108: $? = 1
configure:3131: checking for C compiler default output file name
configure:3158: gcc -O -I/usr/pkg/include -I/usr/include -DPREFIX="\"/usr/pkg\""
 -DPKGLOCALEDIR="\"lib\"" -DPKG_SYSCONFDIR="\"/usr/pkg/etc\"" -I/usr/pkg/include
 -I/usr/include -L/usr/pkg/lib -Wl,-R/usr/pkg/lib -L/usr/lib -Wl,-R/usr/lib conf
test.c  >&5
cc: -xc99=lib is not available on SunOS 5.9
configure:3161: $? = 1
configure: failed program was:

Further investigation showed that the flag "-xc99" for the sunpro compiler is not available on SunOS 5.9 (as stated above), however "-xc99=no_lib" would be a supported option to exclude libraries. The other choice would be "all" which is the default if this flag has been set.

>How-To-Repeat:
build devel/glib2 on SunOS 5.9 with SunPro compiler
>Fix:
The problem came into pkgsrc when someone set -xc99 generally in mk/compiler/sunpro.mk:

# XXX: What if a package needs both -- a c89 and a c99 compiler?
.if !empty(USE_LANGUAGES:Mc99)
_WRAP_EXTRA_ARGS.CC+=   -xc99
.endif


a correct patch would be to exclude SunOS 5.9 from this setting. This is the patch for it:

--- sunpro.mk.orig      Wed Oct 24 17:29:32 2007
+++ sunpro.mk   Wed Oct 24 18:06:02 2007
@@ -57,6 +57,9 @@
 # XXX: What if a package needs both -- a c89 and a c99 compiler?
 .if !empty(USE_LANGUAGES:Mc99)
 _WRAP_EXTRA_ARGS.CC+=  -xc99
+.  if ${OS_VERSION} == "5.9"
+_WRAP_EXTRA_ARGS.CC+=  -xc99=no_lib
+.  endif
 .endif

 # The Solaris linker uses "-R" for rpath directives.

>Release-Note:

>Audit-Trail:
From: Bernd Ernesti <veego@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/37200: devel/glib2 fails on Solaris 5.9 due to compiler flags in sunpro.mk
Date: Thu, 25 Oct 2007 09:36:23 +0200

 On Wed, Oct 24, 2007 at 09:35:00PM +0000, uli@habel.name wrote:
 [..]

 > config.log shows the following problem:
 > 
 > configure:3105: gcc -V >&5
 > cc: Sun C 5.8 Patch 121015-05 2007/08/01
 [..]

 > cc: -xc99=lib is not available on SunOS 5.9

 Where does the '=lib' part come from?
 I can't find that part.

 > Further investigation showed that the flag "-xc99" for the sunpro compiler is not available on SunOS 5.9 (as stated above), however "-xc99=no_lib" would be a supported option to exclude libraries. The other choice would be "all" which is the default if this flag has been set.

 The manpage says '-xc99[=o]' which sounds like for me that you don't need to use an option.

 IMHO it may depends on the installed compiler and not the operating system.
 At least 5.4 and 5.9 both have the same options on there manpage, so I fail to see
 why 5.8 should not have it.

 Sure, -xc99=lib is not supported, by where does that come from?

 Bernd

From: Ulrich Habel <uli@habel.name>
To: gnats-bugs@NetBSD.org
Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org,
	pkgsrc-bugs@netbsd.org
Subject: Re: pkg/37200: devel/glib2 fails on Solaris 5.9 due to compiler
 flags in sunpro.mk
Date: Thu, 25 Oct 2007 14:10:57 +0200 (CEST)

 > The manpage says '-xc99[=o]' which sounds like for me that you don't need to use an option.
 >
 > IMHO it may depends on the installed compiler and not the operating system.
 > At least 5.4 and 5.9 both have the same options on there manpage, so I fail to see
 > why 5.8 should not have it.
 >
 > Sure, -xc99=lib is not supported, by where does that come from?

 I'll check it on Solaris 8 later today. According to the man page of the 
 compiler it says:

 "If you specify -xc99 without any values, the option is set to -xc99=all."

 A small c-programm is being compiled on Solaris 9:

 file main.c:
 int main()
 {
          // nix
 }

 If I compile this file on Solaris 9 it looks like this:

 admin@sun-install ~ > cc -xc99 main.c
 cc: -xc99=lib is not available on SunOS 5.9
 admin@sun-install ~ >

 So it looks that the "=lib" is substituted by the compiler itself. The 
 correct flags for Solaris 9 would are:

 admin@sun-install ~ > cc -xc99=all,no_lib main.c
 admin@sun-install ~ > echo $?
 0


 and it works :o) So I think it would be ok to add the patch to fix the 
 Solaris support. It still should work on Solaris 10 and 
 OpenSolaris/Express could someone test it?


 A look into the manpage offers following:

 NOTE:
 Though the compiler support-level defaults to the
 language features of the C99 standard, the standard
 headers provided by Solaris 8 and Solaris 9 in
 /usr/include do not conform with the 1999 ISO/IEC C
 standard. If you encounter error messages, try using
 -xc99=none to obtain the 1990 ISO/IEC C standard
 behavior for these headers.

 The 1999 C standard library semantics of routines that
 appeared in both the 1990 and 1999 C standard are not
 available and therefore cannot be enabled on Solaris 8

 and Solaris 9. The compiler issues an error message
 when -xc99=lib has been specified directly or
 indirectly on Solaris 8 or Solaris 9.


 Regards
 Uli

From: Bernd Ernesti <veego@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/37200: devel/glib2 fails on Solaris 5.9 due to compiler flags in sunpro.mk
Date: Thu, 25 Oct 2007 17:03:52 +0200

 On Thu, Oct 25, 2007 at 02:10:57PM +0200, Ulrich Habel wrote:
 [..]
 > If I compile this file on Solaris 9 it looks like this:
 > 
 > admin@sun-install ~ > cc -xc99 main.c
 > cc: -xc99=lib is not available on SunOS 5.9
 > admin@sun-install ~ >

 It works here on Solaris 9, but then this is an older compiler:
 Forte Developer 7 C 5.4 2002/03/09

 Do you use cc from /opt/SUNWspro/bin/cc (where there could be a link to it
 in /usr/bin) or is cc a wrapper?

 I still suspect it is a problem with one or two compiler versions and not the OS
 iteself.

 Bernd

 P.S. gnats-bugs@NetBSD.org is enough to reply to. This gets forwared to this list.

From: Ulrich Habel <uli@habel.name>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/37200: devel/glib2 fails on Solaris 5.9 due to compiler
 flags in sunpro.mk
Date: Thu, 25 Oct 2007 23:48:01 +0200 (CEST)

 On Thu, 25 Oct 2007, Bernd Ernesti wrote:

 > Do you use cc from /opt/SUNWspro/bin/cc (where there could be a link to it
 > in /usr/bin) or is cc a wrapper?
 >
 > I still suspect it is a problem with one or two compiler versions and not the OS
 > iteself.

 admin@sun-install ~ > which cc
 /opt/SUNWspro/bin/cc

 admin@sun-install ~ > file /opt/SUNWspro/bin/cc
 /opt/SUNWspro/bin/cc:   ELF 32-bit MSB executable SPARC32PLUS Version 1, 
 V8+ Required, dynamically linked, stripped

 It's the only compiler which has been installed. However I think it has 
 been explained in the manpage already. Due to incompatible header files in 
 /usr/include for Solaris 8 and 9 the option -xc99 won't work as it 
 specifies "all". There are two options - "none" which won't be a good idea 
 as parts of c99 are supported and we should make a use of them if they are 
 available. "no_lib" is the option of choice I think.

 If it doesn't break Solaris 10 we would get some more packages on the 
 Solaris platform with this change, at least for Solaris 8/9.

 btw - I tested it on Solaris 8:

 root@cms-stage-admin / # cc -xc99 main.c
 cc: -xc99=lib is not available on SunOS 5.8
 root@cms-stage-admin / #

 same compiler version as on Solaris 9.

 So, right now we need someone with Solaris 8/9 and a SUNWpro compiler to 
 confirm it - however it has been proven that the patch is wrong as Solaris 
 8 needs to be excluded from the setting of "-xc99" as well.

 After the confirmation we can decide if a change just enables 
 Solaris 10 or excludes Solaris 8/9.

 The change from sketch@ broke pkgsrc-2007Q2/3.

 Regards
 Uli

 btw. there had been alot updates for SunPro compiler 11. I updated it - I 
 never noticed the error on my pkgsrc-2007Q2 builds so far. I'll check the 
 release notes.

Responsible-Changed-From-To: pkg-manager->solaris-pkg-people
Responsible-Changed-By: snj@netbsd.org
Responsible-Changed-When: Fri, 26 Oct 2007 02:59:44 +0000
Responsible-Changed-Why:
Solaris problem.


From: Bernd Ernesti <veego@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/37200: devel/glib2 fails on Solaris 5.9 due to compiler flags in sunpro.mk
Date: Fri, 2 Nov 2007 08:19:18 +0100

 On Thu, Oct 25, 2007 at 09:50:02PM +0000, Ulrich Habel wrote:
 [..]

 I still think that this is a problem with this compiler version and not with
 the OS version, because your test worked fine with the older compiler version
 on Solaris 9 and the latest compiler version was also working on Solaris 10.

 [..]
 >  btw. there had been alot updates for SunPro compiler 11. I updated it - I 
 >  never noticed the error on my pkgsrc-2007Q2 builds so far. I'll check the 
 >  release notes.

 The latest Sun Studio version is 12, which also worked for your testcase
 on Solaris 10.

 Bernd

State-Changed-From-To: open->Closed
State-Changed-By: rhaen@netbsd.org
State-Changed-When: Fri, 30 Nov 2007 16:57:36 +0000
State-Changed-Why:
Committed a fix for sunpro.mk which resolves the problem for Solaris 8/9


From: Ulrich Habel <rhaen@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: PR/37200 CVS commit: pkgsrc/mk/compiler
Date: Fri, 30 Nov 2007 16:55:28 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	rhaen
 Date:		Fri Nov 30 16:55:28 UTC 2007

 Modified Files:
 	pkgsrc/mk/compiler: sunpro.mk

 Log Message:
 Solaris SunPro Compiler 11/12 fails on Solaris 8/9 with -xc99. The header files supplied by the OS are not c99 aware, the manpage suggests the setting: -xc99=all,no_lib for Solaris 8/9.
 See PR 37200


 To generate a diff of this commit:
 cvs rdiff -r1.42 -r1.43 pkgsrc/mk/compiler/sunpro.mk

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Bernd Ernesti <veego@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc: rhaen@NetBSD.org
Subject: Re: pkg/37200 (devel/glib2 fails on Solaris 5.9 due to compiler flags in sunpro.mk)
Date: Fri, 30 Nov 2007 21:14:15 +0100

 On Fri, Nov 30, 2007 at 04:57:38PM +0000, rhaen@NetBSD.org wrote:
 > Synopsis: devel/glib2 fails on Solaris 5.9 due to compiler flags in sunpro.mk
 > 
 > State-Changed-From-To: open->Closed
 > State-Changed-By: rhaen@netbsd.org
 > State-Changed-When: Fri, 30 Nov 2007 16:57:36 +0000
 > State-Changed-Why:
 > Committed a fix for sunpro.mk which resolves the problem for Solaris 8/9

 As you mentioned in the commit log, this is a fix for SunPro 11/12, but the
 change does NOT reflect this.
 It should depend on the SunPro version because it works without a problem
 with an older version, as I allready said in the pr history.

 Bernd

From: Ulrich Habel <rhaen@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc: solaris-pkg-people@NetBSD.org, gnats-admin@netbsd.org,
	pkgsrc-bugs@netbsd.org, 
Subject: Re: pkg/37200 (devel/glib2 fails on Solaris 5.9 due to compiler flags in sunpro.mk)
Date: Fri, 30 Nov 2007 21:39:20 +0100

 Bernd Ernesti <veego@NetBSD.org> writes:

 >  > Committed a fix for sunpro.mk which resolves the problem for Solaris 8/9
 >  
 >  As you mentioned in the commit log, this is a fix for SunPro 11/12, but the
 >  change does NOT reflect this.
 >  It should depend on the SunPro version because it works without a problem
 >  with an older version, as I allready said in the pr history.

 According to the statements SUN made in the manpage the problem is not
 the SunPro compiler but the non-c99 conforming header files in
 /usr/include. So I doubt there will be any Sun Pro compiler which is
 able to compile c99 compliant code if the header files are broken. So I
 think this is more a Solaris 8/9 problem than a Sun Pro compiler problem.

 I haven't checked the gcc settings, however I doubt that this compiler
 deals with the header files in a better way.

 I dont't think that we should work around the problem in endless
 conditional loops. Check the version of SunPro, then check the OS
 version, etc. Unless someone is able to prove that an earlier Sun Pro on
 Solaris 8/9 has been broken by this change I would like to leave it as
 it is.

State-Changed-From-To: Closed->closed
State-Changed-By: minskim@netbsd.org
State-Changed-When: Sat, 22 Dec 2007 23:20:29 +0000
State-Changed-Why:
Closed -> closed (hi Ulrich!)


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.