Solaris compiler setup ?

Magnus Ihse Bursie magnus.ihse.bursie at oracle.com
Mon Oct 22 17:13:58 PDT 2012


The compiler detection has changed a lot lately. Is this still a problem for you? If so, do you get a more descriptive output?

/Magnus

14 sep 2012 kl. 02:23 skrev David Holmes <david.holmes at oracle.com>:

> I'd forgotten about this problem until I went to try out a new sparc server today. :(
> 
> David
> -----
> 
> On 10/08/2012 8:04 AM, David Holmes wrote:
>> On 9/08/2012 9:36 PM, Andrew Hughes wrote:
>>> ----- 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?
>> 
>> There is nothing in the log to indicate that CXX is being looked for:
>> 
>> 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!
>> 
>>> This block comes from toolchain.m4 in common/autoconf.
>> 
>> Right and here is that block:
>> 
>> AC_PROG_CC([cl cc gcc])
>> if test "x$CC" = x; then
>> HELP_MSG_MISSING_DEPENDENCY([devkit])
>> AC_MSG_ERROR([Could not find a compiler. $HELP_MSG])
>> fi
>> if test "x$CC" = xcc && test "x$OPENJDK_BUILD_OS" = xmacosx; then
>> # Do not use cc on MacOSX use gcc instead.
>> CC="gcc"
>> fi
>> WHICHCMD(CC)
>> 
>> AC_PROG_CXX([cl CC g++])
>> if test "x$CXX" = xCC && test "x$OPENJDK_BUILD_OS" = xmacosx; then
>> # The found CC, even though it seems to be a g++ derivate, cannot compile
>> # c++ code. Override.
>> CXX="g++"
>> fi
>> WHICHCMD(CXX)
>> 
>> if test "x$CXX" = x || test "x$CC" = x; then
>> HELP_MSG_MISSING_DEPENDENCY([devkit])
>> AC_MSG_ERROR([Could not find the needed compilers! $HELP_MSG ])
>> fi
>> 
>> Based on the log we start to process ACC_PROG_CXX, we don't find cl, we
>> do find CC. Then we go off and do some additional checks. Seems we never
>> set CXX. And I'm still suspicious of the `tty`: Ambiguous - I think that
>> is preventing CXX from being assigned.
>> 
>> Thanks,
>> David
>> -----
>> 
>>>> 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
>>>> 
>>> 



More information about the build-infra-dev mailing list