Bug 52513 - gcc-4.7.0-RC-20120302 fails to build for i686-pc-cygwin
Summary: gcc-4.7.0-RC-20120302 fails to build for i686-pc-cygwin
Status: RESOLVED WONTFIX
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 4.7.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-06 20:38 UTC by Ryan Johnson
Modified: 2012-03-07 13:36 UTC (History)
3 users (show)

See Also:
Host: i686-pc-cygwin
Target: i686-pc-cygwin
Build: i686-pc-cygwin
Known to work:
Known to fail:
Last reconfirmed: 2012-03-07 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan Johnson 2012-03-06 20:38:35 UTC
The RC doesn't build on i686-pc-cygwin:

gcc -c -DHAVE_CONFIG_H -g -fkeep-inline-functions  -I. -I../../gcc-4.7.0-RC-20120302/libiberty/../include  -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -pedantic  ../../gcc-4.7.0-RC-20120302/libiberty/pex-unix.c -o pex-unix.o
../../gcc-4.7.0-RC-20120302/libiberty/pex-unix.c: In function ‘pex_unix_exec_child’:
../../gcc-4.7.0-RC-20120302/libiberty/pex-unix.c:549:2: warning: implicit declaration of function ‘spawnvpe’ [-Wimplicit-function-declaration]
../../gcc-4.7.0-RC-20120302/libiberty/pex-unix.c:549:18: error: ‘_P_NOWAITO’ undeclared (first use in this function)
../../gcc-4.7.0-RC-20120302/libiberty/pex-unix.c:549:18: note: each undeclared identifier is reported only once for each function it appears in
../../gcc-4.7.0-RC-20120302/libiberty/pex-unix.c:551:2: warning: implicit declaration of function ‘spawnve’ [-Wimplicit-function-declaration]
Makefile:892: recipe for target `pex-unix.o' failed
make[3]: *** [pex-unix.o] Error 1
make[3]: Leaving directory `/home/Ryan/apps/gcc-4.7.0-obj/libiberty'
Makefile:8642: recipe for target `all-stage1-libiberty' failed
make[2]: *** [all-stage1-libiberty] Error 2
make[2]: Leaving directory `/home/Ryan/apps/gcc-4.7.0-obj'
Makefile:15771: recipe for target `stage1-bubble' failed
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/Ryan/apps/gcc-4.7.0-obj'
Makefile:897: recipe for target `all' failed
make: *** [all] Error 2

The needed declarations seem to live in Windows headers (process.h?)

This is using all official (and latest) cygwin packages:
binutils-2.22.51
cygwin-1.7.11s(0.259/5/3)
gcc-4.5.3
gmp-4.3.2
make-3.82.90
mpfr-3.0.1

Configure command: ../gcc-4.7.0-RC-20120302/configure --prefix=$HOME/apps/gcc-4.7 --enable-languages=c,c++,lto
Comment 1 Richard Biener 2012-03-07 09:44:34 UTC
Probably caused by

2010-11-04  Richard Henderson  <rth@redhat.com>

        * configure.ac (AC_CHECK_HEADERS): Add process.h.
        (checkfuncs): Add dup3, spawnve, spawnvpe; sort the list.
        (AC_CHECK_FUNCS): Add dup3, spawnve, spawnvpe.
        * configure, config.in: Rebuild.
        * pex-unix.c [HAVE_SPAWNVE] (pex_unix_exec_child): New function.
        [HAVE_SPAWNVE] (save_and_install_fd, restore_fd): New functions.

thus 4.6 should be broken as well for you?

Can you check why configure thinks spawnve is available in process.h
(contrary to the warning we see in your snippet)?

What Windows version are you using?
Comment 2 Ryan Johnson 2012-03-07 13:02:50 UTC
(In reply to comment #1)
> 4.6 should be broken as well for you?
Oops. I reported wrong in my OP. I've actually been using a home-built 4.6.2 for some time now... and it is the host compiler for this build:

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/home/Ryan/apps/gcc-4.6.2/libexec/gcc/i686-pc-cygwin/4.6.2/lto-wrapper.exe
Target: i686-pc-cygwin
Configured with: ../gcc-4.6.2-src/configure --prefix=/home/Ryan/apps/gcc-4.6.2
Thread model: single
gcc version 4.6.2 (GCC)


> 
> Can you check why configure thinks spawnve is available in process.h
> (contrary to the warning we see in your snippet)?
Sorry, I may not have been clear on this. Google reported that spawnve lives in process.h. A quick search on my filesystem shows that spawnve actually lives in <cygwin/process.h>, not <process.h> as expected by pex-unix.c. Configure probably only tested linker status for the function and therefore wouldn't have noticed. 

Perhaps the file moved recently (since 1.7.9 or 10)? I've sent mail to the cygwin list to see if anybody there knows. Meanwhile, soft-linking process.h to where gcc expects it lets the compile continue. I'll report back if any further issues arise.

> What Windows version are you using?
W7-x64
Comment 3 Dave Korn 2012-03-07 13:36:52 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > 4.6 should be broken as well for you?
> Oops. I reported wrong in my OP. I've actually been using a home-built 4.6.2
> for some time now... and it is the host compiler for this build:

  I had no problems building the RC using:

binutils             2.22.51-1
cygwin               1.7.9-1
gcc4                 4.5.3-3
gmp                  4.3.2-1
make                 3.82.90-1
mpfr                 3.0.1-1


> > Can you check why configure thinks spawnve is available in process.h
> > (contrary to the warning we see in your snippet)?
> Sorry, I may not have been clear on this. Google reported that spawnve lives in
> process.h. A quick search on my filesystem shows that spawnve actually lives in
> <cygwin/process.h>, not <process.h> as expected by pex-unix.c.

> Perhaps the file moved recently (since 1.7.9 or 10)? I've sent mail to the
> cygwin list to see if anybody there knows. Meanwhile, soft-linking process.h to
> where gcc expects it lets the compile continue. 

  Right, I think this is a cygwin bug.  The /usr/include/cygwin dir is private, you're not supposed to #include files from there directly, they should be indirectly included from within other system header files.  If process.h is a public header, it shouldn't have been moved there.

  Ah.  In fact, I see from the reply to your email there that it is indeed an acknowledged error in 1.7.10 and fixed already in 1.7.11.  Since the .10 release was buggy in several other important ways, I don't think it's important to support it, we'll just tell people they need to upgrade.  Closing as WONTFIX.