Solaris compiler setup ?

Andrew Hughes ahughes at redhat.com
Thu Aug 9 04:36:12 PDT 2012


----- Original Message -----
> On 9/08/2012 6:24 PM, Erik Joelsson wrote:
> > I'm not managing to reproduce this even after removing access to
> > all my
> > gccs on the system.
> 
> And I just realized that I have a gcc available anyway!
> 
> > configure:10129: checking whether CC accepts -g
> > configure:10149: CC -c -g conftest.cpp >&5
> > configure:10149: $? = 0
> > configure:10190: result: yes
> > configure:10346: checking for gcc
> > configure:10376: result: no
> > configure:10346: checking for objcc
> > configure:10376: result: no
> > configure:10346: checking for objc
> > configure:10376: result: no
> >
> > Exactly what version of the script are you running? (repo, change
> > etc)
> 
> Repo is tagged at jdk8-b50. It's a jdk8 clone. No changes. But
> looking
> at the output again:
> 
> checking whether cc accepts -g... yes
> checking for cc option to accept ISO C89... none needed
> `tty`: Ambiguous
> checking for cl... no
> checking for CC... CC
> checking whether we are using the GNU C++ compiler... no
> checking whether CC accepts -g... yes
> `tty`: Ambiguous
> configure: error: Could not find the needed compilers!
> 

The failure is triggered by:

if test "x$CXX" = x || test "x$CC" = x; then

...

    as_fn_error $? "Could not find the needed compilers! $HELP_MSG " "$LINENO" 5
fi

Is CXX being set?

This block comes from toolchain.m4 in common/autoconf.

> I'm suspicious about the
> 
> `tty`: Ambiguous
> 
> lines. I'm wondering if they are messing up the attempts to parse the
> command output?

My guess is this is something to do with it printing the results.
You could have a look at how it's defining as_echo and as_echo_n.
Output lines look something like this:

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }

> 
> How to debug this? I ran configure with sh -x, but it then execs bash
> without -x :(
> 

The actual script from autoconf is generated-configure.sh which runs
with /bin/sh as default.

> Aside: on my solaris box configure runs horrendously slow too :(

I've only ever seen that on Windows before.  It could be down to the shell
being used.  Most lines of configure output are the result of a program
being executed, such as the compiler, so there's a lot of forking and use
of pipes going on.

> 
> Thanks,
> David
> 
> > /Erik
> >
> > On 2012-08-09 09:58, Erik Joelsson wrote:
> >> Comparing your log to mine, this is what happens:
> >>
> >> configure:10112: checking whether CC accepts -g
> >> configure:10132: CC -c -g conftest.cpp >&5
> >> configure:10132: $? = 0
> >> configure:10173: result: yes
> >> configure:10329: checking for gcc
> >> configure:10345: found /usr/local/bin/gcc
> >> configure:10356: result: gcc
> >> configure:10381: checking for Objective C compiler version
> >> configure:10390: gcc --version >&5
> >> gcc (GCC) 3.4.6
> >> Copyright (C) 2006 Free Software Foundation, Inc.
> >> This is free software; see the source for copying conditions.
> >> There is NO
> >> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
> >> PURPOSE.
> >>
> >>
> >> So for some reason, autoconf wants to find gcc too and on my
> >> system it
> >> happens to be there. I will look into it.
> >>
> >> /Erik
> >>
> >> On 2012-08-09 06:39, David Holmes wrote:
> >>> When I run configure on Solaris it can't find the "needed
> >>> compilers".
> >>>
> >>> checking if this is a cross compile... no
> >>> checking for cl... no
> >>> checking for cc... cc
> >>> checking whether the C compiler works... yes
> >>> checking for C compiler default output file name... a.out
> >>> checking for suffix of executables...
> >>> checking whether we are cross compiling... no
> >>> checking for suffix of object files... o
> >>> checking whether we are using the GNU C compiler... no
> >>> checking whether cc accepts -g... yes
> >>> checking for cc option to accept ISO C89... none needed
> >>> `tty`: Ambiguous
> >>> checking for cl... no
> >>> checking for CC... CC
> >>> checking whether we are using the GNU C++ compiler... no
> >>> checking whether CC accepts -g... yes
> >>> `tty`: Ambiguous
> >>> configure: error: Could not find the needed compilers!
> >>>
> >>> It finds CC, which is in my path at:
> >>>
> >>> /java/devtools/i386/SUNWspro/SS12u1/bin/CC
> >>>
> >>> What is it looking for? config.log shows:
> >>>
> >>> configure:10084: checking whether we are using the GNU C++
> >>> compiler
> >>> configure:10103: CC -c conftest.cpp >&5
> >>> "conftest.cpp", line 14: Error: choke is not defined.
> >>> 1 Error(s) detected.
> >>> configure:10103: $? = 1
> >>> configure: failed program was:
> >>> | /* confdefs.h */
> >>> | #define PACKAGE_NAME "openjdk"
> >>> | #define PACKAGE_TARNAME "openjdk"
> >>> | #define PACKAGE_VERSION "jdk8"
> >>> | #define PACKAGE_STRING "openjdk jdk8"
> >>> | #define PACKAGE_BUGREPORT "build-dev at openjdk.java.net"
> >>> | #define PACKAGE_URL ""
> >>> | /* end confdefs.h. */
> >>> |
> >>> | int
> >>> | main ()
> >>> | {
> >>> | #ifndef __GNUC__
> >>> | choke me
> >>> | #endif
> >>> |
> >>> | ;
> >>> | return 0;
> >>> | }
> >>> configure:10112: result: no
> >>> configure:10121: checking whether CC accepts -g
> >>> configure:10141: CC -c -g conftest.cpp >&5
> >>> configure:10141: $? = 0
> >>> configure:10182: result: yes
> >>> configure:10280: error: Could not find the needed compilers!
> >>>
> >>> ??
> >>>
> >>> Thanks,
> >>> David
> 

-- 
Andrew :)

Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

PGP Key: 248BDC07 (https://keys.indymedia.org/)
Fingerprint = EC5A 1F5E C0AD 1D15 8F1F  8F91 3B96 A578 248B DC07




More information about the build-infra-dev mailing list