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: 5078 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 <