Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 431352 - sys-libs/ncurses-5.9-r2: fails to build due to strict standard checking on illumos/solaris
Summary: sys-libs/ncurses-5.9-r2: fails to build due to strict standard checking on il...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Other (show other bugs)
Hardware: x86 Solaris
: Normal normal (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-14 08:54 UTC by Igor
Modified: 2012-09-01 13:05 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
config.log (config.log,87.50 KB, text/plain)
2012-08-14 08:54 UTC, Igor
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Igor 2012-08-14 08:54:16 UTC
_XOPEN_SOURCE=500 is passed to CXX and results in error "#error "Compiler or options invalid for pre-UNIX 03 X/Open applications"

1. There is a workaround for c++/Makefile in ebuild, but
it fails if USE=-cxx

2. Similar workaround is required on configure step.

Reproducible: Always

Steps to Reproduce:
emerge ncurses
Actual Results:  
checking whether i386-pc-solaris2.11-g++ understands -c and -o together... yes
checking how to run the C++ preprocessor... /lib/cpp
configure: error: C++ preprocessor "/lib/cpp" fails sanity check

!!! Please attach the following file when seeking support:
!!! /nef/var/tmp/portage/sys-libs/ncurses-5.9-r3/work/narrowc/config.log
 * ERROR: sys-libs/ncurses-5.9-r3 failed (compile phase):
 *   econf failed



NOTE: configure looks for "/lib/cpp" because "$CXX -E" failed.
And "$CXX -E" failed because of _XOPEN_SOURCE=500
Comment 1 Igor 2012-08-14 08:54:46 UTC
Created attachment 321286 [details]
config.log
Comment 2 Igor 2012-08-14 08:55:58 UTC
As for fix in c++/Makefile: ebuild should test whether c++/Makefile exists, and then try to fix it.
Comment 3 Fabian Groffen gentoo-dev 2012-08-14 09:39:34 UTC
that sounds reasonable, but wouldn't

 if use cxx ; then
   sed ....
 fi

be more sensical then?
Comment 4 Igor 2012-08-14 09:48:31 UTC
(In reply to comment #3)
> that sounds reasonable, but wouldn't
> 
>  if use cxx ; then
>    sed ....
>  fi
> 
> be more sensical then?

Yes, I thinks so.
Comment 5 Igor 2012-08-14 14:53:56 UTC
It is safe to completely remove -D_XOPEN_SOURCE from configure for *-solaris*
Comment 6 Fabian Groffen gentoo-dev 2012-08-14 14:58:18 UTC
that needs checking, gcc-4.6 required me to add that nasty bit
Comment 7 Igor 2012-08-14 15:40:26 UTC
(In reply to comment #6)
> that needs checking, gcc-4.6 required me to add that nasty bit

I've checked this with GCC 4.6.3 (both CC and CXX).

AFAIK, Python does similar thing: defines __EXTENSIONS__ instead of any _XOPEN_SOURCE
Comment 8 Fabian Groffen gentoo-dev 2012-08-17 09:03:18 UTC
ok, I have to backtrack  here.

We remove -D_XOPEN_SOURCE=500 on solaris, beacuse it breaks the c++ (due to _XOPEN_SOURCE=600 being standard with c++).

I seem to recall, I could not remove it from configure or something.  Do you see a way?
Comment 9 Igor 2012-08-17 10:19:39 UTC
(In reply to comment #8)
> ok, I have to backtrack  here.
> 
> We remove -D_XOPEN_SOURCE=500 on solaris, beacuse it breaks the c++ (due to
> _XOPEN_SOURCE=600 being standard with c++).
> 
> I seem to recall, I could not remove it from configure or something.  Do you
> see a way?

I do this:


        if [[ ${CHOST} == *-solaris* ]] ; then
        sed -i -e '/-D__EXTENSIONS__/ s/-D_XOPEN_SOURCE=\$cf_XOPEN_SOURCE//' configure || die
        fi

It's just a fast hack. NCurses should be patched to be more careful.

BTW, in illumos/solaris headers each test for _XOPEN_SOURCE is accompanied with "|| defined(__EXTENSIONS__)"
Comment 10 Fabian Groffen gentoo-dev 2012-08-21 18:36:19 UTC
fixed in ncurses-5.9-r02.1, I hope it doesn't break.
Comment 11 Fabian Groffen gentoo-dev 2012-09-01 12:18:00 UTC
it does ... on OpenIndiana 151a5
Comment 12 Fabian Groffen gentoo-dev 2012-09-01 12:19:44 UTC
make: Entering directory `/home/gentoo/var/tmp/portage/sys-libs/ncurses-5.9-r02.1/work/widec/c++'
i386-pc-solaris2.11-g++ -I../c++ -I../include -I/home/gentoo/var/tmp/portage/sys-libs/ncurses-5.9-r02.1/work/ncurses-5.9/c++ -DHAVE_CONFIG_H   -D__EXTENSIONS__ -D_XOPEN_SOURCE_EXTENDED -D_FILE_OFFSET_BITS=64  -DXTSTRINGDEFINES -DNDEBUG -I. -I../include -I/home/gentoo/var/tmp/portage/sys-libs/ncurses-5.9-r02.1/work/ncurses-5.9/c++/../include -I/home/gentoo/usr/include/ncursesw -O2 -pipe -W -Wall -Wabi -fabi-version=0 -Woverloaded-virtual -Wsign-promo -Wsynth -Wold-style-cast -Wcast-align -Wcast-qual -Wpointer-arith -Wshadow -Wundef -Wwrite-strings -Weffc++ -Wno-unused -fPIC -c /home/gentoo/var/tmp/portage/sys-libs/ncurses-5.9-r02.1/work/ncurses-5.9/c++/cursesf.cc -o ../obj_s/cursesf.o
In file included from /usr/include/iso/stdlib_iso.h:48:0,
                 from /usr/include/stdlib.h:32,
                 from /home/gentoo/var/tmp/portage/sys-libs/ncurses-5.9-r02.1/work/ncurses-5.9/c++/internal.h:53,
                 from /home/gentoo/var/tmp/portage/sys-libs/ncurses-5.9-r02.1/work/ncurses-5.9/c++/cursesf.cc:34:
/home/gentoo/usr/lib/gcc/i386-pc-solaris2.11/4.6.3/include-fixed/sys/feature_tests.h:362:2: error: #error "Compiler or options invalid for pre-UNIX 03 X/Open applications        and pre-2001 POSIX applications"
In file included from /home/gentoo/var/tmp/portage/sys-libs/ncurses-5.9-r02.1/work/ncurses-5.9/c++/cursesf.h:39:0,
                 from /home/gentoo/var/tmp/portage/sys-libs/ncurses-5.9-r02.1/work/ncurses-5.9/c++/cursesf.cc:35:

This is a fresh 32-bits bootstrap on OpenIndiana where the emerge -e system stage goes wrong :(
Comment 13 Fabian Groffen gentoo-dev 2012-09-01 12:28:09 UTC
and it fails exactly the same way on an existing OpenIndiana Prefix, 64-bits, using GCC 4.7.1.
Comment 14 Fabian Groffen gentoo-dev 2012-09-01 12:39:24 UTC
-D_XOPEN_SOURCE_EXTENDED kills sys/feature_tests.h, because that means the system would be prehistoric level (pre _XOPEN_SOURCE=500) X/Open CAE Specification, Issue 4, Version 2.
Comment 15 Fabian Groffen gentoo-dev 2012-09-01 13:05:13 UTC
Fixed forgood, now, I hope.