From patchwork Sat Feb 14 09:05:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Bogusz X-Patchwork-Id: 439706 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 C6E29140180 for ; Sat, 14 Feb 2015 20:03:29 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; q=dns; s=default; b=IiLxWJjryofX1x9CkH7+UrlEoQi5A dbn57AS1Uffb8GSKf5bcYPmBIJ9p28WLVZu/RWoVwzMvo1B63HPSEAuhStm7Khyf PT9lxbeD/QojgytsRJKNpxv5K1gz8HPTfeisYbhX+NsR6g0hfr4sd2xxuyQnq+oL OnJdBvxpQJgPyk= 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:date:from:to:subject:message-id:mime-version :content-type; s=default; bh=e+VIa7NRx4/XbLRZUtBiqqiSy0U=; b=Ebd SGvsam+c//9aV9HwKxXSU/AE9FU7mnvHzKHKsRdF+yA/e5cly+iVh1XyhReclyw0 dSN2rSp6KTfSgyrpHxE2VRvnbt0OYHI0ZkjaJnW0MhndEv3iYXPoNeBwovMgk48x XubYYiCLivU8gcJCCQZKp4SfQz509BU/bLbKO274= Received: (qmail 5624 invoked by alias); 14 Feb 2015 09:03:23 -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 5612 invoked by uid 89); 14 Feb 2015 09:03:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: mail.qboosh.pl Date: Sat, 14 Feb 2015 10:05:56 +0100 From: Jakub Bogusz To: libc-alpha@sourceware.org Subject: Non-portable echo usage in sysdeps/unix/make-syscalls.sh Message-ID: <20150214090556.GA9442@stranger.qboosh.pl> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Hello, Some paths of make-syscalls.sh script use echo in a way specific to bash or echo from GNU coreutils, expecting not to interpret escape sequences by default. It's contrary to what POSIX specs say and the way that echo from some other shells (like ksh or dash) works (escape sequences are always interpreted or are interpreted by default). The attached patch is a try to fix the problem by avoiding non portable cases. --- glibc-2.20/sysdeps/unix/make-syscalls.sh.orig 2014-09-07 10:09:09.000000000 +0200 +++ glibc-2.20/sysdeps/unix/make-syscalls.sh 2014-12-21 17:54:48.973388216 +0100 @@ -276,28 +276,33 @@ vdso_symbol="${vdso_syscall%@*}" vdso_symver="${vdso_syscall#*@}" vdso_symver=`echo "$vdso_symver" | sed 's/\./_/g'` - echo "\ + cat <'; \\ - echo 'extern void *${strong}_ifunc (void) __asm (\"${strong}\");'; \\ + echo 'extern void *${strong}_ifunc (void) __asm ("${strong}");'; \\ echo 'void *'; \\ echo '${strong}_ifunc (void)'; \\ echo '{'; \\ echo ' PREPARE_VERSION_KNOWN (symver, ${vdso_symver});'; \\ - echo ' return _dl_vdso_vsym (\"${vdso_symbol}\", &symver);'; \\ + echo ' return _dl_vdso_vsym ("${vdso_symbol}", &symver);'; \\ echo '}'; \\ - echo 'asm (\".type ${strong}, %gnu_indirect_function\");'; \\" + echo 'asm (".type ${strong}, %gnu_indirect_function");'; \\ +EOF # This is doing "libc_hidden_def (${strong})", but the compiler # doesn't know that we've defined ${strong} in the same file, so # we can't do it the normal way. - echo "\ - echo 'asm (\".globl __GI_${strong}\\n\"'; \\ - echo ' \"__GI_${strong} = ${strong}\");'; \\" + cat <