Bug 6702 - requirements for wchar_t support are too restrictive for Solaris pre 10
Summary: requirements for wchar_t support are too restrictive for Solaris pre 10
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 3.1
: P3 enhancement
Target Milestone: 4.1.1
Assignee: Benjamin Kosnik
URL:
Keywords:
: 4764 5090 10061 11312 23990 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-05-17 10:26 UTC by dale
Modified: 2012-12-14 19:54 UTC (History)
14 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2003-06-07 21:10:04


Attachments
gcc 4.1.0 sparc-sun-solaris2.8/libstdc++-v3/config.log (20.65 KB, application/octet-stream)
2006-03-22 17:23 UTC, Caleb Epstein
Details

Note You need to log in before you can comment on or make changes to this bug.
Description dale 2002-05-17 10:26:00 UTC
The requirements before libstdc++ will build with support
for wchar_t are too restrictive.

Changing cwchar and cwctype to not try import the missing
functions into std namespace and changing config.h and c++config.h to define _GLIBCPP_USE_WCHAR_T and rebuilding libstdc++ works without problem on solaris 8, although autoconf had decided that this wasn't possible.

Support for wchar_t is mandated by the C++ standard - gcc should make more extensive efforts to support it on any platform that it reasonably can (i.e. supports the set of functions used by libstdc++).

Release:
3.1 20020510 (prerelease)

Environment:
solaris 8
Comment 1 phil 2002-05-17 14:00:15 UTC
From: Phil Edwards <phil@jaj.com>
To: dale@peakall.net
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: libstdc++/6702: requirements for wchar_t support are too restrictive
Date: Fri, 17 May 2002 14:00:15 -0400

 On Fri, May 17, 2002 at 05:19:38PM -0000, dale@peakall.net wrote:
 > config.h and c++config.h to
 > define _GLIBCPP_USE_WCHAR_T and rebuilding libstdc++ works without problem
 > on solaris 8, although autoconf had decided that this wasn't possible.
 
 Before you try hacking around this yourself, it's useful to investigate
 /why/ the autoconf scripts decided it wasn't possible.  The file
 sparc-sun-solaris2.8/libstdc++-v3/config.log in the build directory will
 contain the output of the wide-character tests.  Searching for "C99",
 "mbstate_t" and "wchar" should give results.
 
 
 > Support for wchar_t is mandated by the C++ standard - gcc should make
 > more extensive efforts to support it on any platform that it reasonably can
 > (i.e. supports the set of functions used by libstdc++).
 
 We already try, thankyouverymuch.  More specifically, others have reported
 success on this platform, so I'm initially inclined to look at individual
 platform problems than systemic bugs.  There were problems with the 'long
 long' tests under Solaris giving up too easily, but those were fixed back
 in 3.0.3; wide character support is related but separate.
 
 

Comment 2 Dara Hazeghi 2003-05-10 16:49:52 UTC
From: Dara Hazeghi <dhazeghi@yahoo.com>
To: gcc-gnats@gcc.gnu.org, dale@peakall.net
Cc:  
Subject: Re: libstdc++/6702: requirements for wchar_t support are too restrictive
Date: Sat, 10 May 2003 16:49:52 -0700

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit- 
 trail&database=gcc&pr=6702
 
 Hello,
 
 this problem was reported against gcc 3.1 which is now quite old. Would  
 it be possible for you to determine if this problem still occurs under  
 gcc 3.2.3 or 3.3 prerelease? Thanks,
 
 Dara
 
Comment 3 Steven Bosscher 2003-05-12 10:54:58 UTC
State-Changed-From-To: open->feedback
State-Changed-Why: Dara has asked for feedback.
Comment 4 Dara Hazeghi 2003-05-14 10:34:10 UTC
From: Dara Hazeghi <dhazeghi@yahoo.com>
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: RE: libstdc++/6702: requirements for wchar_t support are too restrictive
Date: Wed, 14 May 2003 10:34:10 -0700 (PDT)

 > 3.2.3 still exhibits the problem.  The resolution to
 > the problem involves
 > changing:
 > 
 > 1. std_cwchar.h - so that per-function config
 > variables are tested before
 > performing
 >    the required using statement.
 > 2. configure - to set the various config variables
 > that will be checked
 > 3. configure - to only require the minimum set of
 > functions - those used in
 > the library
 >    itself for
 > 
 
 __________________________________
 Do you Yahoo!?
 The New Yahoo! Search - Faster. Easier. Bingo.
 http://search.yahoo.com

Comment 5 Dara Hazeghi 2003-05-14 10:35:07 UTC
From: Dara Hazeghi <dhazeghi@yahoo.com>
To: dale.peakall@fdisolutions.com
Cc: gcc-gnats@gcc.gnu.org
Subject: RE: libstdc++/6702: requirements for wchar_t support are too restrictive
Date: Wed, 14 May 2003 10:35:07 -0700 (PDT)

 > 
 > Continuing from before:
 > 
 > 3. configure - to only require the minimum set of
 > functions - those used in
 > the library
 >    itself for chosing whether to define
 > _GLIBCPP_USE_WCHAR_T.
 
 Thanks for the feedback and analysis. Hopefully one of
 the libstdc++ huys will take a look at this soon...
 
 Dara
 
 __________________________________
 Do you Yahoo!?
 The New Yahoo! Search - Faster. Easier. Bingo.
 http://search.yahoo.com
Comment 6 Dara Hazeghi 2003-06-02 03:04:08 UTC
Hello,

sorry to have to ask for yet more confirmation. But would it be possible for you to check whether 
gcc 3.3 exhibits this problem too? Thanks,

Draa
Comment 7 Andrew Pinski 2003-06-07 21:04:09 UTC
This is the same as bug 10061 which says it still does not work with 3.3.

*** This bug has been marked as a duplicate of 10061 ***
Comment 8 Andrew Pinski 2003-06-07 21:06:59 UTC
Wrong way because this explains the problem.
Comment 9 Andrew Pinski 2003-06-07 21:07:38 UTC
*** Bug 10061 has been marked as a duplicate of this bug. ***
Comment 10 Andrew Pinski 2003-06-07 21:10:04 UTC
This is still a bug in 3.3 as bug 10061 says.
Comment 11 Andrew Pinski 2003-06-08 17:30:18 UTC
*** Bug 5090 has been marked as a duplicate of this bug. ***
Comment 12 Andrew Pinski 2003-06-13 18:00:13 UTC
This is related to bug 10041 which is for HPUX and bug 10535 which is for cygwin.
Comment 13 Andrew Pinski 2003-06-14 22:02:48 UTC
*** Bug 4764 has been marked as a duplicate of this bug. ***
Comment 14 Andrew Pinski 2003-06-24 21:10:55 UTC
*** Bug 11312 has been marked as a duplicate of this bug. ***
Comment 15 Benjamin Kosnik 2003-09-25 20:29:24 UTC
I'm checking in this sucker, which should finally resolve this for 3.4. 

Wheee! Thanks Brad.

-benjamin

2003-09-25  Brad Spencer  <spencer@infointeractive.com>

	PR libstdc++/6072
	* acinclude.m4: 
	* aclocal.m4: Regenerate.
	* config.h.in: Regenerate.
	* configure: Regenerate.
	* crossconfig.m4: Add in wchar_t bits for solaris crosses.
	* config/io/basic_file_stdio.cc: Guard unistd.h.
	* include/c_compatibility/wchar.h: Guard extra wchar_t functionality.
	* include/c_std/std_cwchar.h: Same.
	* include/c_std/std_cwctype.h: Same.
	
Comment 16 Andrew Pinski 2003-10-19 07:43:05 UTC
Fixed for 3.4.
Comment 17 Andrew Pinski 2003-10-19 07:44:28 UTC
Forgot to close this as it is fixed for 3.4.
Comment 18 Benjamin Kosnik 2005-09-21 16:14:13 UTC
*** Bug 23990 has been marked as a duplicate of this bug. ***
Comment 19 Caleb Epstein 2006-03-22 16:04:41 UTC
This bug appears to have recurred in gcc 4.1.0.  I have no wide string or iostream support on my brand-spanking-new versionof gcc, when this all worked fine with gcc 3.4.3.
Comment 20 Paolo Carlini 2006-03-22 16:11:56 UTC
(In reply to comment #19)
> This bug appears to have recurred in gcc 4.1.0.  I have no wide string or
> iostream support on my brand-spanking-new versionof gcc, when this all worked
> fine with gcc 3.4.3.

But frankly I suspect something is wrong in your setup, because people are regularly posting succesful testresults for Solaris with >~ 3000 passes (-> wchar_t is enabled). Just have a look to gcc-testresults.
Comment 21 Paolo Carlini 2006-03-22 16:23:54 UTC
Humm, maybe Solaris < 2.10 is affected...
Comment 22 Caleb Epstein 2006-03-22 17:20:54 UTC
(In reply to comment #21)
> Humm, maybe Solaris < 2.10 is affected...

I am indeed on 2.8.  What more can I do to debug this?  I'll attach sparc-sun-solaris2.8/libstdc++-v3/config.log.
Comment 23 Caleb Epstein 2006-03-22 17:23:01 UTC
Created attachment 11098 [details]
gcc 4.1.0 sparc-sun-solaris2.8/libstdc++-v3/config.log

Gcc 4.1.0 config.log from <build-dir>/sparc-sun-solaris2.8/libstdc++-v3/config.log
Comment 24 Eric Botcazou 2006-03-22 17:40:40 UTC
Confirmed on Solaris 7, 8 and 9, everything is fine on Solaris 10.
Comment 25 Eric Botcazou 2006-03-31 14:05:40 UTC
> Confirmed on Solaris 7, 8 and 9, everything is fine on Solaris 10.

Three functions are missing:

conftest.cc:75: error: '::wcstold' has not been declared
conftest.cc:76: error: '::wcstoll' has not been declared
conftest.cc:78: error: '::wcstoull' has not been declared

They'll need to be specialized like vfwscanf and the like.
Comment 26 paolo@gcc.gnu.org 2006-04-16 09:06:53 UTC
Subject: Bug 6702

Author: paolo
Date: Sun Apr 16 09:06:46 2006
New Revision: 112983

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=112983
Log:
2006-04-16  Paolo Carlini  <pcarlini@suse.de>

	PR libstdc++/6702 (again)
	* acinclude.m4 (GLIBCXX_ENABLE_C99): Don't check non-C99
	wchar_t functions...
	(GLIBCXX_ENABLE_WCHAR_T): ... do that here.
	* configure.ac: Adjust order of checks.
	* configure: Regenerate.

Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/acinclude.m4
    trunk/libstdc++-v3/configure
    trunk/libstdc++-v3/configure.ac

Comment 27 paolo@gcc.gnu.org 2006-05-03 17:00:24 UTC
Subject: Bug 6702

Author: paolo
Date: Wed May  3 17:00:18 2006
New Revision: 113498

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=113498
Log:
2006-05-03  Paolo Carlini  <pcarlini@suse.de>

	* acinclude.m4 (GLIBCXX_ENABLE_WCHAR_T): Always check the
	presence of wctype.h, for use in GLIBCXX_ENABLE_C99.
	* configure: Regenerate.

2006-05-03  Paolo Carlini  <pcarlini@suse.de>

	PR libstdc++/6702 (again)
	* acinclude.m4 (GLIBCXX_ENABLE_C99): Don't check non-C99
	wchar_t functions...
	(GLIBCXX_ENABLE_WCHAR_T): ... do that here.
	* configure.ac: Adjust order of checks.
	* configure: Regenerate.

Modified:
    branches/gcc-4_1-branch/libstdc++-v3/ChangeLog
    branches/gcc-4_1-branch/libstdc++-v3/acinclude.m4
    branches/gcc-4_1-branch/libstdc++-v3/configure
    branches/gcc-4_1-branch/libstdc++-v3/configure.ac

Comment 28 Paolo Carlini 2006-05-03 17:01:19 UTC
Fixed (again), for 4.1.1.
Comment 29 Eric Botcazou 2006-05-04 19:03:47 UTC
> Fixed (again), for 4.1.1.

Confirmed for all Solaris versions >= 7 on 4.1 branch and mainline, thanks again.