From: Stefan Weil <sw@weilnetz.de>
To: Peter Maydell <pmaydell@chiark.greenend.org.uk>, qemu-devel@nongnu.org
Cc: patches@linaro.org
Subject: Re: [Qemu-devel] [PATCH 1/2] configure: Improve usermode relocation linker option probe
Date: Sun, 19 Jun 2016 07:47:02 +0200 [thread overview]
Message-ID: <576631D6.1000505@weilnetz.de> (raw)
In-Reply-To: <1466287502-18730-2-git-send-email-pmaydell@chiark.greenend.org.uk>
Am 19.06.2016 um 00:05 schrieb Peter Maydell:
> From: Peter Maydell <peter.maydell@linaro.org>
>
> The probe we do to determine what flags to use to make the usermode
> executables use a non-default text address has some flaws:
> * we run it even if we're not building the user binaries
> * we don't expect "ld --verbose" to fail
>
> The combination of these two results in a harmless but
> ugly "ld: unknown option: --verbose" message when running
> configure on OSX.
>
> Improve the probe to only run when we need it and to fail
> nicely when even the backstop 'ld --verbose' approach fails.
>
> Reported-by: Stefan Weil <sw@weilnetz.de>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> configure | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/configure b/configure
> index 10cb212..7beefcd 100755
> --- a/configure
> +++ b/configure
> @@ -4700,7 +4700,7 @@ if test "$cpu" = "s390x" ; then
> fi
>
> # Probe for the need for relocating the user-only binary.
> -if test "$pie" = "no" ; then
> +if ( [ "$linux_user" = yes ] || [ "$bsd_user" = yes ] ) && [ "$pie" = no ]; then
> textseg_addr=
> case "$cpu" in
> arm | i386 | ppc* | s390* | sparc* | x86_64 | x32)
> @@ -4722,6 +4722,16 @@ EOF
> # In case ld does not support -Ttext-segment, edit the default linker
> # script via sed to set the .text start addr. This is needed on FreeBSD
> # at least.
> + if ! $ld --verbose >/dev/null 2>&1; then
> + error_exit \
> + "We need to link the QEMU user mode binaries at a" \
> + "specific text address. Unfortunately your linker" \
> + "doesn't support either the -Ttext-segment option or" \
> + "printing the default linker script with --verbose." \
> + "If you don't want the user mode binaries, pass the" \
> + "--disable-user option to configure."
> + fi
> +
> $ld --verbose | sed \
> -e '1,/==================================================/d' \
> -e '/==================================================/,$d' \
>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Thanks.
next prev parent reply other threads:[~2016-06-19 5:47 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-18 22:05 [Qemu-devel] [PATCH 0/2] configure: Avoid warnings on OSX Peter Maydell
2016-06-18 22:05 ` [Qemu-devel] [PATCH 1/2] configure: Improve usermode relocation linker option probe Peter Maydell
2016-06-19 5:47 ` Stefan Weil [this message]
2016-06-18 22:05 ` [Qemu-devel] [PATCH 2/2] configure: Make AVX2 test robust to non-ELF systems Peter Maydell
2016-06-19 5:53 ` Stefan Weil
2016-06-19 9:41 ` Peter Maydell
2016-06-19 11:19 ` Stefan Weil
2016-06-28 15:07 ` [Qemu-devel] [PATCH 0/2] configure: Avoid warnings on OSX 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=576631D6.1000505@weilnetz.de \
--to=sw@weilnetz.de \
--cc=patches@linaro.org \
--cc=pmaydell@chiark.greenend.org.uk \
--cc=qemu-devel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.