From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by sourceware.org (Postfix) with ESMTPS id AF156384D183 for ; Wed, 29 Jun 2022 00:47:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AF156384D183 Received: by mail-pf1-x42a.google.com with SMTP id x138so10855001pfc.3 for ; Tue, 28 Jun 2022 17:47:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition; bh=tUOH2ygY4Zw19iQYfq86NP47uO+B/sCiE8Py7ag7Ggs=; b=7BHOOUEq9Bzb6Ce5IaXnda4fGV+RS+C7RRw8zE/4+LihmwhYcBki9Juh8OxkjxOtfu w89RbDPS7m4/0TPdMv/Sw8H7vtgB3fr7/CXyd+9mrC+P9b2EaLUxu55mpWF3XDGJ7/hh oVxa64aWkCe0HPWRIU3xDcWrB2al8LUUZWgIqqnEWkkEYa20TYmM3HGVFmLNOWfDQ6Br VBH7Yj7MnNcridyG1qlnTrj5E5uJV6UQDCdOUpx3RAz4IXXvreYdHqhYEiXwX8SUsltl sxDHZ3EmwhLllDkykNTDcN3PtAEHGNl9hCcdQTfCTgpQ13VUC3xDm5uneS64R+4gMlGd hBZw== X-Gm-Message-State: AJIora/HLU8lOMz0DkBX/xkUJXU+HAQg+1vtXa3l0/iSEXeC4OTpapto Ju0fr0NB5L4BtW/heTBiMSs3VJh+THs= X-Google-Smtp-Source: AGRyM1vHPZ03tLtFP81kJLOJcXPQwB586GYINwc4nU1MFSqhUZ8bILEuYHKEuXDld51AZsKFHI6MRg== X-Received: by 2002:a65:6b95:0:b0:408:9d1b:2e56 with SMTP id d21-20020a656b95000000b004089d1b2e56mr593679pgw.381.1656463650390; Tue, 28 Jun 2022 17:47:30 -0700 (PDT) Received: from squeak.grove.modra.org (158.106.96.58.static.exetel.com.au. [58.96.106.158]) by smtp.gmail.com with ESMTPSA id y11-20020a63de4b000000b0040c644e82efsm9827972pgi.43.2022.06.28.17.47.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jun 2022 17:47:29 -0700 (PDT) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id E7C1D11407BE; Wed, 29 Jun 2022 10:17:25 +0930 (ACST) Date: Wed, 29 Jun 2022 10:17:25 +0930 From: Alan Modra To: binutils@sourceware.org Subject: Re: ld/x86: skip p_align-1 tests with unsuitable compiler Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3037.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jun 2022 00:47:33 -0000 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. 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" \ -- Alan Modra Australia Development Lab, IBM