From patchwork Fri Jun 26 16:32:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roland McGrath X-Patchwork-Id: 488927 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id C8B5B140284 for ; Sat, 27 Jun 2015 02:32:16 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=sourceware.org header.i=@sourceware.org header.b=CVIbDgVp; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:content-type :content-transfer-encoding:from:to:subject:message-id:date; q= dns; s=default; b=PpxKIvtqAx11Bpvtbd/sHGR2Gloi/3s991eyLbonAG4KrX TR75QZXBt9EemgcPhgt22IiNEZaBr7FETOw8p5q2aCfXnIZsILu7k0JagbpHNReJ JP7TKUa1BF+DTq8bHmCnSUtw6QP7K8SczHscJUmhR9G5Pv0yJCw2UmVe8hP6M= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:content-type :content-transfer-encoding:from:to:subject:message-id:date; s= default; bh=F4S9PVKp31t08JxBUwt8FXra/2s=; b=CVIbDgVpie7FYXlyWa+m Bdd2eEX3TSrcfnUdaRewDVFRPtpos7ZVrqee//BqxhYIfB/tdpmCu7UqYmdU+Wbc J6atKl2e6BtLisJBbDCbZpZxj5P2mpxb77z36QJ3bgqoRnViNwD62TWkmS9i0qHM 880nFglxzaSyJIc33cUnFHg= Received: (qmail 53246 invoked by alias); 26 Jun 2015 16:32:10 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 53236 invoked by uid 89); 26 Jun 2015 16:32:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.4 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, URIBL_BLACK autolearn=no version=3.3.2 X-HELO: topped-with-meat.com MIME-Version: 1.0 From: Roland McGrath To: "GNU C. Library" Subject: [PATCH roland/arm] Conditionalize test-xfail-tst-tlsalign{,-static} on ARM assembler bug. Message-Id: <20150626163206.675CC2C3B3B@topped-with-meat.com> Date: Fri, 26 Jun 2015 09:32:06 -0700 (PDT) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=SvUDtp+0 c=1 sm=1 tr=0 a=WkljmVdYkabdwxfqvArNOQ==:117 a=14OXPxybAAAA:8 a=wPDyFdB5xvgA:10 a=hOe2yjtxAAAA:8 a=kj9zAlcOel0A:10 a=QB0MyPFNBrbv0QfX4_EA:9 a=CjuIK1q_8ugA:10 With HJ's x86 fix, the only known failures for tst-tlsalign (18383) are due to the ARM assembler bug, which is fixed in current binutils trunk and 2.25 branch (but broken in all released versions). This adds a configure check for the bug, and makes the tests XFAIL only if the assembler bug is there. Tested on arm-linux-gnueabihf that the configure check fails with binutils-2.24 and that it (and the no-longer-XFAIL tests) succeed with binutils-2_25-branch. OK? Thanks, Roland 2015-06-26 Roland McGrath [BZ #18383] * sysdeps/arm/configure.ac (libc_cv_arm_tpoff_addend): New check. Emit test-xfail-tst-tlsalign{,-static}=yes if it fails. * sysdeps/arm/configure: Regenerated. * elf/Makefile (test-xfail-tst-tlsalign): Variable removed. (test-xfail-tst-tlsalign-static): Variable removed. diff --git a/elf/Makefile b/elf/Makefile index f21276c0..7fda056 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -524,10 +524,6 @@ $(objpfx)tst-initorder: $(objpfx)tst-initordera4.so $(objpfx)tst-initordera1.so $(objpfx)tst-null-argv: $(objpfx)tst-null-argv-lib.so $(objpfx)tst-tlsalign: $(objpfx)tst-tlsalign-lib.so -# BZ#18383: broken on at least ARM (both). -test-xfail-tst-tlsalign = yes -test-xfail-tst-tlsalign-static = yes - $(objpfx)tst-tlsalign-extern: $(objpfx)tst-tlsalign-vars.o $(objpfx)tst-tlsalign-extern-static: $(objpfx)tst-tlsalign-vars.o diff --git a/sysdeps/arm/configure b/sysdeps/arm/configure index 52f2185..f789f61 100644 --- a/sysdeps/arm/configure +++ b/sysdeps/arm/configure @@ -260,6 +260,52 @@ if test $libc_cv_arm_pcrel_movw = yes; then fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether TPOFF relocs with addends are assembled correctly" >&5 +$as_echo_n "checking whether TPOFF relocs with addends are assembled correctly... " >&6; } +if ${libc_cv_arm_tpoff_addend+:} false; then : + $as_echo_n "(cached) " >&6 +else + +cat > conftest.s <<\EOF + .syntax unified + .arm + .arch armv7-a + + .text +foo: + .word tbase(tpoff)+4 + + .section .tdata,"awT",%progbits + .word -4 +tbase: .word 0 + .word 4 +EOF +libc_cv_arm_tpoff_addend=no +${CC-cc} -c $CFLAGS $CPPFLAGS \ + -o conftest.o conftest.s 1>&5 2>&5 && +LC_ALL=C $READELF -x.text conftest.o > conftest.x 2>&5 && +{ + cat conftest.x 1>&5 + $AWK 'BEGIN { result = 2 } +$1 ~ /0x0+/ && $2 ~ /[0-9a-f]+/ { +# Check for little-endian or big-endian encoding of 4 in the in-place addend. + result = ($2 == "04000000" || $2 == "00000004") ? 0 : 1 +} +END { exit(result) } +' conftest.x 2>&5 && libc_cv_arm_tpoff_addend=yes +} +rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_arm_tpoff_addend" >&5 +$as_echo "$libc_cv_arm_tpoff_addend" >&6; } +if test $libc_cv_arm_tpoff_addend = no; then + config_vars="$config_vars +test-xfail-tst-tlsalign = yes" + config_vars="$config_vars +test-xfail-tst-tlsalign-static = yes" +fi + + libc_cv_gcc_unwind_find_fde=no # Remove -fno-unwind-tables that was added in sysdeps/arm/preconfigure.ac. diff --git a/sysdeps/arm/configure.ac b/sysdeps/arm/configure.ac index 168f2e7..d7b6a7a 100644 --- a/sysdeps/arm/configure.ac +++ b/sysdeps/arm/configure.ac @@ -79,6 +79,43 @@ if test $libc_cv_arm_pcrel_movw = yes; then AC_DEFINE([ARM_PCREL_MOVW_OK]) fi +AC_CACHE_CHECK([whether TPOFF relocs with addends are assembled correctly], + libc_cv_arm_tpoff_addend, [ +cat > conftest.s <<\EOF + .syntax unified + .arm + .arch armv7-a + + .text +foo: + .word tbase(tpoff)+4 + + .section .tdata,"awT",%progbits + .word -4 +tbase: .word 0 + .word 4 +EOF +libc_cv_arm_tpoff_addend=no +${CC-cc} -c $CFLAGS $CPPFLAGS \ + -o conftest.o conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD && +LC_ALL=C $READELF -x.text conftest.o > conftest.x 2>&AS_MESSAGE_LOG_FD && +{ + cat conftest.x 1>&AS_MESSAGE_LOG_FD + $AWK 'BEGIN { result = 2 } +$1 ~ /0x0+/ && $2 ~ /[[0-9a-f]]+/ { +# Check for little-endian or big-endian encoding of 4 in the in-place addend. + result = ($2 == "04000000" || $2 == "00000004") ? 0 : 1 +} +END { exit(result) } +' conftest.x 2>&AS_MESSAGE_LOG_FD && libc_cv_arm_tpoff_addend=yes +} +rm -f conftest*]) +if test $libc_cv_arm_tpoff_addend = no; then + LIBC_CONFIG_VAR([test-xfail-tst-tlsalign], [yes]) + LIBC_CONFIG_VAR([test-xfail-tst-tlsalign-static], [yes]) +fi + + libc_cv_gcc_unwind_find_fde=no # Remove -fno-unwind-tables that was added in sysdeps/arm/preconfigure.ac.