qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	qemu-devel@nongnu.org, qemu-stable@nongnu.org
Subject: Re: [PATCH] configure: Fix error message when C compiler is not working
Date: Fri, 8 Mar 2024 12:32:35 +0100	[thread overview]
Message-ID: <bb66c3f5-73b9-4ee8-b186-8384168c8930@redhat.com> (raw)
In-Reply-To: <CAFEAcA-0kNwed8SbceWuR89mFMvfwfPpQaJJfdoRoM3az8vttQ@mail.gmail.com>

On 08/03/2024 12.26, Peter Maydell wrote:
> On Fri, 8 Mar 2024 at 06:01, Thomas Huth <thuth@redhat.com> wrote:
>>
>> If you try to run the configure script on a system without a working
>> C compiler, you get a very misleading error message:
>>
>>   ERROR: Unrecognized host OS (uname -s reports 'Linux')
>>
>> We should rather tell the user that we were not able to use the C
>> compiler instead, otherwise they will have a hard time to figure
>> out what was going wrong.
>>
>> Fixes: 264b803721 ("configure: remove compiler sanity check")
>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>> ---
>>   configure | 12 +++++++-----
>>   1 file changed, 7 insertions(+), 5 deletions(-)
>>
>> diff --git a/configure b/configure
>> index 3cd736b139..a036923dee 100755
>> --- a/configure
>> +++ b/configure
>> @@ -411,7 +411,7 @@ else
>>     # Using uname is really broken, but it is just a fallback for architectures
>>     # that are going to use TCI anyway
>>     cpu=$(uname -m)
>> -  echo "WARNING: unrecognized host CPU, proceeding with 'uname -m' output '$cpu'"
>> +  echo "WARNING: could not determine host CPU, proceeding with 'uname -m' output '$cpu'"
>>   fi
>>
>>   # Normalise host CPU name to the values used by Meson cross files and in source
>> @@ -1000,10 +1000,12 @@ if test -z "$ninja"; then
>>   fi
>>
>>   if test "$host_os" = "bogus"; then
>> -    # Now that we know that we're not printing the help and that
>> -    # the compiler works (so the results of the check_defines we used
>> -    # to identify the OS are reliable), if we didn't recognize the
>> -    # host OS we should stop now.
>> +    # Now that we know that we're not printing the help, we should stop now
>> +    # if we didn't recognize the host OS (or the C compiler is not working).
>> +    write_c_skeleton;
>> +    if ! compile_object ; then
>> +        error_exit "C compiler \"$cc\" is not usable"
>> +    fi
>>       error_exit "Unrecognized host OS (uname -s reports '$(uname -s)')"
>>   fi
> 
> Why doesn't it work to check the C compiler works before we
> do the "what is the host CPU" test ? Does that make the
> --help output not work when there's no C compiler?

Right, that's the problem: --help would not work when there is no working C 
compiler.

  Thomas




  reply	other threads:[~2024-03-08 11:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-08  6:00 [PATCH] configure: Fix error message when C compiler is not working Thomas Huth
2024-03-08 11:26 ` Peter Maydell
2024-03-08 11:32   ` Thomas Huth [this message]
2024-03-18 16:08 ` Thomas Huth
2024-03-19 13:12 ` Peter Maydell
2024-03-20 14:38   ` Thomas Huth
2024-03-20 14:47     ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bb66c3f5-73b9-4ee8-b186-8384168c8930@redhat.com \
    --to=thuth@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).