From patchwork Thu May 14 19:12:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 48537 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D62B72121F for ; Thu, 14 May 2015 19:13:19 +0000 (UTC) Received: by lagr1 with SMTP id r1sf6456317lag.3 for ; Thu, 14 May 2015 12:13:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mailing-list:precedence:list-id :list-unsubscribe:list-subscribe:list-archive:list-post:list-help :sender:delivered-to:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding:x-original-sender :x-original-authentication-results; bh=VZ5+A+fVDJJca+j/RD/2CBQhWd8Jpli66wxlZpWpnWs=; b=PUf0kWUahp/0BZSHn/mjKa/Utg5qPCCzjqoucaeOLNEuDgBur8fcnRAotSH/pSBARZ mnWmAD9riDjUN3a3+rRsMTaWoL9zWERuZFWnHOL64xq6wF+zE5IhdrfKMMKqoUvvyvUp YbaJH/YQFaxqmTP4tmUFGHQXDGN8U66u1U/J4LnUzWG558tw6XIHrgp3Ten/Z9oC6tph De7flZV3k1NFwXqjPFy6vhw7QK9+RNoypcRsCLhzWBeu+81fxpSyXWLE9Dw+11oKg19n Z/X8NikhLPdN2//G1fJynEQNCBSQ+ZIbFB9WTRMc3CWP5btqja44ZYi+f0P3/n32XBh9 F1RQ== X-Gm-Message-State: ALoCoQlAcg2M2TGybmoe37AgqCb2DhAf50jw3XJNUezkjPe1+249s2+gEUKavvvVRyZ4ZEIZlfRH X-Received: by 10.113.11.3 with SMTP id ee3mr3995837lbd.9.1431630798617; Thu, 14 May 2015 12:13:18 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.229 with SMTP id w5ls423737lag.44.gmail; Thu, 14 May 2015 12:13:18 -0700 (PDT) X-Received: by 10.153.8.167 with SMTP id dl7mr4349793lad.86.1431630798425; Thu, 14 May 2015 12:13:18 -0700 (PDT) Received: from mail-la0-x233.google.com (mail-la0-x233.google.com. [2a00:1450:4010:c03::233]) by mx.google.com with ESMTPS id ay8si15123807lbc.111.2015.05.14.12.13.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 May 2015 12:13:18 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::233 as permitted sender) client-ip=2a00:1450:4010:c03::233; Received: by laat2 with SMTP id t2so82286408laa.1 for ; Thu, 14 May 2015 12:13:18 -0700 (PDT) X-Received: by 10.112.140.231 with SMTP id rj7mr4288012lbb.76.1431630798217; Thu, 14 May 2015 12:13:18 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp1475469lbb; Thu, 14 May 2015 12:13:16 -0700 (PDT) X-Received: by 10.70.90.129 with SMTP id bw1mr10949213pdb.85.1431630796025; Thu, 14 May 2015 12:13:16 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id qy1si33694965pbc.74.2015.05.14.12.13.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 May 2015 12:13:16 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-58899-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 39679 invoked by alias); 14 May 2015 19:13:01 -0000 Mailing-List: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org Precedence: list 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 39646 invoked by uid 89); 14 May 2015 19:13:01 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qc0-f171.google.com X-Received: by 10.229.252.201 with SMTP id mx9mr7881345qcb.1.1431630776069; Thu, 14 May 2015 12:12:56 -0700 (PDT) Message-ID: <5554F3B4.3050404@linaro.org> Date: Thu, 14 May 2015 16:12:52 -0300 From: Adhemerval Zanella User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: "H.J. Lu" CC: GNU C Library Subject: Re: [committed, PATCH] BZ #18409: Remove a trailing `\' in make-syscalls.sh References: <5553A664.8090904@linaro.org> <5554E36E.3000801@linaro.org> In-Reply-To: X-Original-Sender: adhemerval.zanella@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::233 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@sourceware.org X-Google-Group-Id: 836684582541 On 14-05-2015 15:08, H.J. Lu wrote: > On Thu, May 14, 2015 at 11:03 AM, Adhemerval Zanella > wrote: >> >> >> On 13-05-2015 16:34, H.J. Lu wrote: >>> On Wed, May 13, 2015 at 12:30 PM, Adhemerval Zanella >>> wrote: >>>> Hi >>>> >>>> On 13-05-2015 13:20, H.J. Lu wrote: >>>>> commit c14874927b499ddfdbb03745bb32bfc778b8595f >>>>> Author: Roland McGrath >>>>> Date: Tue May 22 16:00:50 2012 -0700 >>>>> >>>>> syscalls.list support for vDSO IFUNCs, use it for x32 gettimeofday and time. >>>>> >>>>> added >>>>> >>>>> \$(foreach p,\$(sysd-rules-targets),\$(objpfx)\$(patsubst %,\$p,$file).os): \\ >>>>> \$(..)sysdeps/unix/make-syscalls.sh\ >>>>> \$(make-target-directory) >>>>> >>>>> to sysdeps/unix/make-syscalls.sh which generates >>>>> >>>>> #### CALL=gettimeofday NUMBER=(0x40000000 + 96) ARGS=i:pP SOURCE=- >>>>> ifeq (,$(filter gettimeofday,$(unix-syscalls))) >>>>> unix-syscalls += gettimeofday >>>>> $(foreach p,$(sysd-rules-targets),$(foreach >>>>> o,$(object-suffixes-noshared),$(objpfx)$(patsubst >>>>> %,$p,gettimeofday)$o)): \ >>>>> $(..)sysdeps/unix/make-syscalls.sh >>>>> $(make-target-directory) >>>>> (echo '#define SYSCALL_NAME gettimeofday'; \ >>>>> echo '#define SYSCALL_NARGS 2'; \ >>>>> echo '#define SYSCALL_SYMBOL __gettimeofday'; \ >>>>> echo '#include '; \ >>>>> echo 'weak_alias (__gettimeofday, gettimeofday)'; \ >>>>> echo 'libc_hidden_weak (gettimeofday)'; \ >>>>> ) | $(compile-syscall) $(foreach p,$(patsubst >>>>> %gettimeofday,%,$(basename $(@F))),$($(p)CPPFLAGS)) >>>>> $(foreach p,$(sysd-rules-targets),$(objpfx)$(patsubst %,$p,gettimeofday).os): \ >>>>> $(..)sysdeps/unix/make-syscalls.sh $(make-target-directory) >>>>> ^^^^^^^^^ Missing newline >>>>> (echo '#include '; \ >>>>> echo 'extern void *__gettimeofday_ifunc (void) __asm >>>>> ("__gettimeofday");'; \ >>>>> echo 'void *'; \ >>>>> echo '__gettimeofday_ifunc (void)'; \ >>>>> echo '{'; \ >>>>> echo ' PREPARE_VERSION_KNOWN (symver, LINUX_2_6);'; \ >>>>> echo ' return _dl_vdso_vsym ("__vdso_gettimeofday", &symver);'; \ >>>>> echo '}'; \ >>>>> echo 'asm (".type __gettimeofday, %gnu_indirect_function");'; \ >>>>> echo 'asm (".globl __GI___gettimeofday\n"'; \ >>>>> echo ' "__GI___gettimeofday = __gettimeofday");'; \ >>>>> echo 'weak_alias (__gettimeofday, gettimeofday)'; \ >>>>> echo 'libc_hidden_weak (gettimeofday)'; \ >>>>> ) | $(compile-stdin.c) $(foreach p,$(patsubst >>>>> %gettimeofday,%,$(basename $(@F))),$($(p)CPPFLAGS)) >>>>> endif >>>>> >>>>> This only affected x32. I checked in this patch after tested on >>>>> x32. >>>>> >>>>> Adhemerval, can you check if your problem with dash in >>>>> >>>>> https://sourceware.org/ml/libc-alpha/2015-04/msg00277.html >>>>> >>>>> is fixed by this? >>>>> >>>>> Thanks. >>>> >>>> I have been testing another more complete fix pointed out by Joseph [1] >>>> and it fixes the x32 build with dash issue I was seeing. Shouldn't we >>>> push this one? >>>> >>>> [1] https://sourceware.org/ml/libc-alpha/2015-02/msg00396.html >>> >>> Well, this part is the same as the one I checked in: >>> >>> \$(foreach p,\$(sysd-rules-targets),\$(objpfx)\$(patsubst %,\$p,$file).os): \\ >>> - \$(..)sysdeps/unix/make-syscalls.sh\ >>> + \$(..)sysdeps/unix/make-syscalls.sh >>> >>> At minimum, that patch should be rebased. >>> >> >> What about: >> >> diff --git a/sysdeps/unix/make-syscalls.sh b/sysdeps/unix/make-syscalls.sh >> index 910a22c..12f664e 100644 >> --- a/sysdeps/unix/make-syscalls.sh >> +++ b/sysdeps/unix/make-syscalls.sh >> @@ -272,28 +272,33 @@ while read file srcfile caller syscall args strong weak; do >> vdso_symbol="${vdso_syscall%@*}" >> vdso_symver="${vdso_syscall#*@}" >> vdso_symver=`echo "$vdso_symver" | sed 's/\./_/g'` >> - echo "\ >> + cat <> + >> \$(foreach p,\$(sysd-rules-targets),\$(objpfx)\$(patsubst %,\$p,$file).os): \\ >> \$(..)sysdeps/unix/make-syscalls.sh >> \$(make-target-directory) >> (echo '#include '; \\ >> - 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 <> + echo 'asm (".globl __GI_${strong}");'; \\ >> + echo 'asm ("__GI_${strong} = ${strong}");'; \\ >> +EOF >> emit_weak_aliases >> - echo ' ) | $(compile-stdin.c) '"\ >> -\$(foreach p,\$(patsubst %$file,%,\$(basename \$(@F))),\$(\$(p)CPPFLAGS))" >> + cat <> + ) | \$(compile-stdin.c) \ >> +\$(foreach p,\$(patsubst %$file,%,\$(basename \$(@F))),\$(\$(p)CPPFLAGS)) >> +EOF >> fi >> >> if test $shared_only = t; then >> >> I checked builds for x86_64, i386, x32, and aarch64 for both dash and bash. > > This only affects x32. Please show the output of diff -up between > > 1. The old x32 sysd-syscalls under bash and the new x32 > sysd-syscalls under bash. > 2. The new x32 sysd-syscalls under bash and the new x32 > sysd-syscalls under dash. > The master still do not build for x32 on my setup with dash (ubuntu 14.04): (echo '#include '; \ echo 'extern void *time_ifunc (void) __asm ("time");'; \ echo 'void *'; \ echo 'time_ifunc (void)'; \ echo '{'; \ echo ' PREPARE_VERSION_KNOWN (symver, LINUX_2_6);'; \ echo ' return _dl_vdso_vsym ("__vdso_time", &symver);'; \ echo '}'; \ echo 'asm (".type time, %gnu_indirect_function");'; \ echo 'asm (".globl __GI_time /bin/sh: 10: Syntax error: Unterminated quoted string And it build with the modifications I proposed. The differences using bash with and without the patch are: $ diff -pu /tmp/master.bash /tmp/patch.bash --- /tmp/master.bash 2015-05-14 16:01:06.986718272 -0300 +++ /tmp/patch.bash 2015-05-14 16:07:41.450731250 -0300 @@ -36,6 +36,7 @@ $(foreach p,$(sysd-rules-targets),$(fore echo 'weak_alias (__gettimeofday, gettimeofday)'; \ echo 'libc_hidden_weak (gettimeofday)'; \ ) | $(compile-syscall) $(foreach p,$(patsubst %gettimeofday,%,$(basename $(@F))),$($(p)CPPFLAGS)) + $(foreach p,$(sysd-rules-targets),$(objpfx)$(patsubst %,$p,gettimeofday).os): \ $(..)sysdeps/unix/make-syscalls.sh $(make-target-directory) @@ -48,8 +49,8 @@ $(foreach p,$(sysd-rules-targets),$(objp echo ' return _dl_vdso_vsym ("__vdso_gettimeofday", &symver);'; \ echo '}'; \ echo 'asm (".type __gettimeofday, %gnu_indirect_function");'; \ - echo 'asm (".globl __GI___gettimeofday\n"'; \ - echo ' "__GI___gettimeofday = __gettimeofday");'; \ + echo 'asm (".globl __GI___gettimeofday");'; \ + echo 'asm ("__GI___gettimeofday = __gettimeofday");'; \ echo 'weak_alias (__gettimeofday, gettimeofday)'; \ echo 'libc_hidden_weak (gettimeofday)'; \ ) | $(compile-stdin.c) $(foreach p,$(patsubst %gettimeofday,%,$(basename $(@F))),$($(p)CPPFLAGS)) @@ -123,6 +124,7 @@ $(foreach p,$(sysd-rules-targets),$(fore echo '#define SYSCALL_ERRVAL 0'; \ echo '#include '; \ ) | $(compile-syscall) $(foreach p,$(patsubst %time,%,$(basename $(@F))),$($(p)CPPFLAGS)) + $(foreach p,$(sysd-rules-targets),$(objpfx)$(patsubst %,$p,time).os): \ $(..)sysdeps/unix/make-syscalls.sh $(make-target-directory) @@ -135,8 +137,8 @@ $(foreach p,$(sysd-rules-targets),$(objp echo ' return _dl_vdso_vsym ("__vdso_time", &symver);'; \ echo '}'; \ echo 'asm (".type time, %gnu_indirect_function");'; \ - echo 'asm (".globl __GI_time\n"'; \ - echo ' "__GI_time = time");'; \ + echo 'asm (".globl __GI_time");'; \ + echo 'asm ("__GI_time = time");'; \ ) | $(compile-stdin.c) $(foreach p,$(patsubst %time,%,$(basename $(@F))),$($(p)CPPFLAGS)) endif