From patchwork Thu May 14 18:03:26 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: 6725 Received: (qmail 38429 invoked by alias); 14 May 2015 18:03:35 -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 38415 invoked by uid 89); 14 May 2015 18:03:35 -0000 Authentication-Results: sourceware.org; auth=none 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-qk0-f171.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=apVRwYNOeeeVC8A+itlQxLVlL6FFht9syQ0MLojLoEA=; b=eVnMBXyXtn76RgIgUmB9uCCU80mwVa/1qhQW1o47vWuS1KZopWwE/GN8qlbVMnMUkr EKDFEczggSx9KqmrAgQGe88W6CQ3OlnpIOVcIo3xDx66JvDW33V8dS/GfuGKAaTsJ6+h xJvsZu4iOUWfcjtRktNY8vEQ3wfCRDnUEaTvkSDRa8N8MDvbeIsTu0nCdNEmK7ENeEmG CCdmnxIMjVcpJwGO6z4Frq1J2Fj1wDon8gl1Qx2k2uh+GOpAJ0PcIDSRQ3oyU9Q7aLFz omNJ8AmZcv7dbH9P7mzzg/8UpFjYy+Ll2VAWoS8+uDFQmsj3r9buXCcap48uGJwsADRt xLEQ== X-Gm-Message-State: ALoCoQkIrlMZI8pK39EXfxMQNpF30EcWiV9QjXeEaidYu/7HcVXitccaj0Cl5IPRS+XAzZyZVBHx X-Received: by 10.140.95.208 with SMTP id i74mr6973770qge.51.1431626610097; Thu, 14 May 2015 11:03:30 -0700 (PDT) Message-ID: <5554E36E.3000801@linaro.org> Date: Thu, 14 May 2015 15:03:26 -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> In-Reply-To: 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: I checked builds for x86_64, i386, x32, and aarch64 for both dash and bash. 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 <'; \\ - 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 <