Configure broken on MIPS when uname returns mipsel or mips64el

Magnus Ihse Bursie magnus.ihse.bursie at oracle.com
Fri May 25 07:42:16 UTC 2018


On 2018-05-24 03:08, Ao Qi wrote:
> Hi Erik,
>
> Thanks for your comments. I made a new patch:
>
> $ hg diff
> diff -r 31361382634b make/autoconf/build-aux/config.guess
> --- a/make/autoconf/build-aux/config.guess Tue May 22 10:08:04 2018 -0700
> +++ b/make/autoconf/build-aux/config.guess Thu May 24 09:07:17 2018 +0800
> @@ -86,6 +86,17 @@
>     fi
>   fi
>
> +# Test and fix little endian MIPS.
> +if [ "x$OUT" = x ]; then
> +  if [ `uname -s` = Linux ]; then
> +    if [ `uname -m` = mipsel ]; then
> +      OUT=mipsel-unknown-linux-gnu
> +    elif [ `uname -m` = mips64el ]; then
> +      OUT=mips64el-unknown-linux-gnu
> +    fi
> +  fi
> +fi
> +
>   # Test and fix cpu on Macosx when C preprocessor is not on the path
>   echo $OUT | grep i386-apple-darwin > /dev/null 2> /dev/null
>   if test $? = 0; then

Looks good to me.

/Magnus
>
> Cheers,
> Ao Qi
>
> 2018-05-24 0:19 GMT+08:00 Erik Joelsson <erik.joelsson at oracle.com>:
>> Hello Ao Qi,
>>
>> Due to licensing reasons, we are unable to directly update the
>> autoconf-config.guess file. Instead we have the wrapper, config.guess in
>> which we make adjustments to the result returned by autoconf-config.guess.
>> Your fix needs to go in the wrapper file.
>>
>> /Erik
>>
>>
>>
>> On 2018-05-23 03:18, Ao Qi wrote:
>>> Hi all,
>>> I tried to configure jdk/jdk on MIPS, but I failed. The output of
>>> configure:
>>> ...
>>> checking for pandoc... no
>>> checking build system type...
>>> /home/loongson/aoqi/jdk/make/autoconf/build-aux/config.guess: unable
>>> to guess system type
>>>
>>> This script, last modified 2012-02-10, has failed to recognize
>>> the operating system you are using. It is advised that you
>>> download the most up to date version of the config scripts from
>>>
>>>
>>> http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
>>> and
>>>
>>> http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
>>>
>>> If the version you run
>>> (/home/loongson/aoqi/jdk/make/autoconf/build-aux/config.guess) is
>>> already up to date, please
>>> send the following data and any information you think might be
>>> pertinent to <config-patches at gnu.org> in order to provide the needed
>>> information to handle your system.
>>>
>>> config.guess timestamp = 2012-02-10
>>>
>>> uname -m = mips64el
>>> uname -r = 3.10.0-693.5.2.ns7.032.mips64el
>>> uname -s = Linux
>>> uname -v = #1 SMP PREEMPT Fri Dec 29 16:42:48 CST 2017
>>>
>>> /usr/bin/uname -p = mips64el
>>> /bin/uname -X     =
>>>
>>> hostinfo               =
>>> /bin/universe          =
>>> /usr/bin/arch -k       =
>>> /bin/arch              = mips64el
>>> /usr/bin/oslevel       =
>>> /usr/convex/getsysinfo =
>>>
>>> UNAME_MACHINE = mips64el
>>> UNAME_RELEASE = 3.10.0-693.5.2.ns7.032.mips64el
>>> UNAME_SYSTEM  = Linux
>>> UNAME_VERSION = #1 SMP PREEMPT Fri Dec 29 16:42:48 CST 2017
>>> configure: error: cannot guess build type; you must specify one
>>> configure exiting with result code 1
>>> ...
>>>
>>> I think the reason is that uname returns mips64el.
>>> autoconf-config.guess can handle mips and mips64, but cannot handle
>>> mipsel and mips64el.
>>> I made a patch to pass the configure:
>>>
>>> $ hg diff
>>> diff -r 31361382634b make/autoconf/build-aux/autoconf-config.guess
>>> --- a/make/autoconf/build-aux/autoconf-config.guess Tue May 22
>>> 10:08:04 2018 -0700
>>> +++ b/make/autoconf/build-aux/autoconf-config.guess Wed May 23
>>> 18:06:52 2018 +0800
>>> @@ -977,6 +977,9 @@
>>>     eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
>>>     test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
>>>     ;;
>>> +    mipsel:Linux:*:* | mips64el:Linux:*:*)
>>> + echo ${UNAME_MACHINE}-unknown-linux-gnu
>>> + exit ;;
>>>        or32:Linux:*:*)
>>>     echo ${UNAME_MACHINE}-unknown-linux-gnu
>>>     exit ;;
>>>
>>>
>>> I think ppc has the same problem, but it is fixed in
>>> make/autoconf/build-aux/config.guess.
>>>
>>> Thanks,
>>> Ao Qi
>>




More information about the build-dev mailing list