From patchwork Mon Jul 14 19:54:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 2054 Received: (qmail 5519 invoked by alias); 14 Jul 2014 19:54: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 5424 invoked by uid 89); 14 Jul 2014 19:54:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.6 required=5.0 tests=AWL, BAYES_20, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS, URIBL_BLACK autolearn=no version=3.3.2 X-HELO: mail-qa0-f52.google.com X-Received: by 10.140.18.243 with SMTP id 106mr26894208qgf.105.1405367645743; Mon, 14 Jul 2014 12:54:05 -0700 (PDT) Message-ID: <53C43559.5000907@twiddle.net> Date: Mon, 14 Jul 2014 12:54:01 -0700 From: Richard Henderson User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: GNU C Library CC: Carlos O'Donell Subject: [PATCH, AArch64] Detect assembler vector mov parsing bug The strchr implementation that was recently committed to mainline tickles an assembler bug fixed by commit 8db49cc2de52033990ae5d4d6aacedc8f986e803 Author: Will Newton Date: Thu Oct 31 17:21:11 2013 -0700 config/tc-aarch64.c: Avoid trying to parse a vector mov as immediate. ... Obviously not a problem with a relatively new binutils installed, but Carlos ran into this problem building mainline glibc on a system using binutils 2.23. It's not a silent error (we die linking ld.so), but its somewhat cryptic. Carlos opined to me that we ought to error out at configure time with an understandable message. Rather than check for version numbers, let's check for functionality. Ok? r~ * sysdeps/aarch64/configure.ac: Check for assembler mov bug. * sysdeps/aarch64/configure: Regenerate. diff --git a/sysdeps/aarch64/configure.ac b/sysdeps/aarch64/configure.ac index 7851dd4..6654684 100644 --- a/sysdeps/aarch64/configure.ac +++ b/sysdeps/aarch64/configure.ac @@ -20,3 +20,19 @@ if test $libc_cv_aarch64_be = yes; then else LIBC_CONFIG_VAR([default-abi], [lp64]) fi + +# Check to see if the assembler has fixed a parsing bug wrt vector "mov" +# instructions leading to undefined symbols. +AC_MSG_CHECKING([for assembler vector mov bug]) +old_LDFLAGS="$LDFLAGS" +LDFLAGS="$LDFLAGS -nostdlib -nostartfiles" +AC_LINK_IFELSE([[void _start(void) { asm("mov x0,v0.2d[0]"); }]], + [AC_MSG_RESULT([no])], + [AC_MSG_RESULT([yes]) + AC_MSG_ERROR( +[*** Version of binutils is too old to support AArch64. +*** Your version of binutils contains a bug in the handling +*** of vector names. Please upgrade to a version of binutils +*** that contains commit: +*** 8db49cc2de52033990ae5d4d6aacedc8f986e803])]) +LDFLAGS="$old_LDFLAGS"