public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Alan Modra <amodra@gmail.com>
Cc: binutils@sourceware.org
Subject: Re: ld/x86: skip p_align-1 tests with unsuitable compiler
Date: Wed, 29 Jun 2022 07:59:05 +0200	[thread overview]
Message-ID: <5a78bb41-6aad-63a5-cc00-069d303d6429@suse.com> (raw)
In-Reply-To: <YruhHY3PTMFv+ibf@squeak.grove.modra.org>

On 29.06.2022 02:47, Alan Modra via Binutils wrote:
> commit d0e0f9c87a3e results "ERROR: i586-linux-cc does not exist" if
> cross-building an i586-linux target without a target compiler
> installed.
> 
> 	* testsuite/ld-elf/linux-x86.exp (compiler_honours_aligned): New.
> 	Use it after first testing check_compiler_available.

Just noticed this myself (apparently didn't test the right variants
the first time through to see it). Thanks for fixing (and educating
me about how such checks ought to be done).

Jan

> diff --git a/ld/testsuite/ld-elf/linux-x86.exp b/ld/testsuite/ld-elf/linux-x86.exp
> index ae0ed6ac0d2..6035ecd6829 100644
> --- a/ld/testsuite/ld-elf/linux-x86.exp
> +++ b/ld/testsuite/ld-elf/linux-x86.exp
> @@ -188,9 +188,17 @@ run_ld_link_exec_tests [list \
>  ]
>  
>  # Old gcc silently ignores __attribute__ ((aligned())) with too big alignment.
> -ld_compile $CC_FOR_TARGET $srcdir/$subdir/p_align-1.c tmpdir/p_align-1.o
> -set output [run_host_cmd "$READELF" "-SW tmpdir/p_align-1.o"]
> -if { [regexp { [.]data *PROGBITS .* 8388608[\n]} $output] } then {
> +proc compiler_honours_aligned { } {
> +    global CC_FOR_TARGET READELF srcdir subdir
> +    ld_compile $CC_FOR_TARGET $srcdir/$subdir/p_align-1.c tmpdir/p_align-1.o
> +    set output [run_host_cmd "$READELF" "-SW tmpdir/p_align-1.o"]
> +    if { [regexp { [.]data *PROGBITS .* 8388608[\n]} $output] } {
> +	return 1
> +    }
> +    return 0
> +}
> +
> +if { [check_compiler_available] && [compiler_honours_aligned] } {
>      run_ld_link_exec_tests [list \
>  	[list \
>  	    "Run p_align-1a without PIE" \
> 


      reply	other threads:[~2022-06-29  5:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-29  0:47 Alan Modra
2022-06-29  5:59 ` Jan Beulich [this message]

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=5a78bb41-6aad-63a5-cc00-069d303d6429@suse.com \
    --to=jbeulich@suse.com \
    --cc=amodra@gmail.com \
    --cc=binutils@sourceware.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 read-only IMAP folder(s) and NNTP newsgroup(s).