VxWorks' GNU cross-compiler in the Cygwin environment

Andy Helten andy.helten@dot21rts.com
Wed Mar 14 07:58:00 GMT 2001


Hello,

I finally had time to do an strace and take some time trying
to determine exactly what I was looking at (I have not used
strace before).  I have attached the tail of the strace
starting with the test compile portion of the 'configure'
script.

>From the strace, when the test compile is started in the
'configure' script it uses 'eval' (Bourne shell), which
ultimately uses 'spawn_guts' to start the executable
'c++ppc' (line 133 of attached strace output).  Where
'c++ppc' is the GNU cross compiler provided with VxWorks.
It appears from the strace that soon after
'spawn_guts' starts the compiler (28068 usecs), it declares:
'subprocess exited' and the 'configure' script continues on
its way (line 135 of attached strace output).

The next thing the 'configure' script does is a 'test -s' on
the output of the compiler.  The output of the compiler
should be an executable called 'conftest'.  From the strace
it appears the 'test -s' becomes a 'stat(conftest)' as can
be seen on line 212 of attached file.  Well, I can only
guess that the 'stat()' fails because the conftest output
has not been produced by the compiler yet (which is
apparantly still running because the 'conftest' output does
get produced eventually).

I may have simplified this behavior too much, but if I'm in
the ball park, what can be done to prevent the shell's
'eval' command from declaring the compiler process has
exited before it really has.

I would appreciate any help and guidance in working this
problem.  The original post is given below without the
configure output.

Thanks,

Andy


"Larry Hall (RFK Partners, Inc)" wrote:

> At 05:36 PM 3/5/2001, Andy Helten wrote:
> >Hello,
> >
> >I recently (two weeks ago) downloaded and installed the
> >Cygwin tools on my Windows98 laptop.  I have been
attempting
> >to use the autoconf tools to setup for a cross compile to

> >VxWorks using the VxWorks/GNU compiler with version
output:
> >
> >AMHPC {bin}> c++ppc --version
> >cygnus-2.7.2-960126 egcs-971225 tornado 2.0
> >
> >If you are familiar (and I'm sure you are) with autoconf,

> >you will know that it generates a shell script called
> >'configure' that must be run before building the package.

> >My problem is that the 'configure' script fails during
the
> >C++ compiler test.  It fails with an indication that the
> >"C++ compiler cannot create executables" and then exits
the
> >'configure' script with a failure status.  After digging
> >into it, I discovered some very troubling things were
> >occurring.  First I found that the executable WAS being
> >generated by the cross-compiler and (in some cases) it
was
> >still there after the configure script failed.  Second,
> >using the 'config.log' output, I found the line that was
> >failing:
> >
> >if { (eval echo configure:1207: \"$ac_link\") 1>&5; (eval

> >$ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
> >
> >As it turns out, it is failing the 'test -s' for the
> >executable, 'conftest'.  After noticing that 'conftest'
was
> >in fact being correctly generated, I changed the above
line
> >in 'configure' to this:
> >
> >if { (eval echo configure:1207: \"$ac_link\") 1>&5; (eval

> >$ac_link) 2>&5; } && sleep 1 && test -s
> >conftest${ac_exeext}; then
> >
> >Notice the 'sleep 1' before the 'test -s'.  This made the

> >configure script work, that is, the 'test -s' succeeded
and
> >the configure script went on to finish successfully.  So
it
> >seems somehow the cross-compiler is completing
successfully
> >and the 'test -s' is executing before the output of the
> >cross-compiler is available for the 'test -s' !?!?!
> >
> >I do not have this problem running the configure script
for
> >targets other than VxWorks, so I assume the problem is
with
> >the interaction between the Cygwin tools and the
non-Cygwin
> >(VxWorks) cross-compiler.  I have produced this same
problem
> >with the latest (last week) Cygwin tools and Windows 2k.
I
> >have had similar problems (with dependency files) during
> >cross-compilation while using the VxWorks cross-compiler
> >from within the Cygwin environment.  Also, I noticed that

> >VxWorks supplies a Cygwin DLL, in this case
'cygwinb19.dll'.
> >
> >The output of running the 'configure' script, an 'll' of
> >'conftest', and a dump of config.log are provided below.
I
> >would appreciate any help on this.
> >
> >Thanks,
> >Andy
> >
>

[snip]

>
>
> Perhaps you want to try this under strace?
>
> Larry Hall                              lhall@rfk.com
> RFK Partners, Inc.                      http://www.rfk.com

> 118 Washington Street                   (508) 893-9779 -
RFK Office
> Holliston, MA 01746                     (508) 893-9889 -
FAX




More information about the Cygwin mailing list