Message ID | 20210315154723.11687-1-lukma@denx.de |
---|---|
State | Superseded |
Headers |
Return-Path: <libc-alpha-bounces@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 10569385801A; Mon, 15 Mar 2021 15:47:42 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) by sourceware.org (Postfix) with ESMTPS id 40B843858C27 for <libc-alpha@sourceware.org>; Mon, 15 Mar 2021 15:47:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 40B843858C27 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: sourceware.org; spf=none smtp.mailfrom=lukma@denx.de Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4Dzgm84gwqz1qtdm; Mon, 15 Mar 2021 16:47:36 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4Dzgm83hXMz1qqkT; Mon, 15 Mar 2021 16:47:36 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id OUbua44efbz4; Mon, 15 Mar 2021 16:47:35 +0100 (CET) X-Auth-Info: Vo3YVukOlxfgE8e1s9JrKA8fHeug9zcaF/vKY5MR1kg= Received: from localhost.localdomain (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Mon, 15 Mar 2021 16:47:35 +0100 (CET) From: Lukasz Majewski <lukma@denx.de> To: Joseph Myers <joseph@codesourcery.com>, Adhemerval Zanella <adhemerval.zanella@linaro.org> Subject: [PATCH] support: arm: Add libc_do_syscall function to libsupport routines Date: Mon, 15 Mar 2021 16:47:23 +0100 Message-Id: <20210315154723.11687-1-lukma@denx.de> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-14.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list <libc-alpha.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> Cc: Florian Weimer <fweimer@redhat.com>, GNU C Library <libc-alpha@sourceware.org> Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" <libc-alpha-bounces@sourceware.org> |
Series |
support: arm: Add libc_do_syscall function to libsupport routines
|
|
Commit Message
Lukasz Majewski
March 15, 2021, 3:47 p.m. UTC
The ARM port requires the __libc_do_syscall function to be able to call utimensat_time64 syscall required to check if file system supports 64 bit time. This patch adds the sysdeps/unix/sysv/linux/arm/libc-do-syscall.S to libsupport routines. It fixes the following error on ARM 32 bit port: y2038-glibc/support/support_path_support_time64.c:34: undefined reference to `__libc_do_syscall' collect2: error: ld returned 1 exit status --- sysdeps/unix/sysv/linux/arm/Makefile | 5 +++++ 1 file changed, 5 insertions(+)
Comments
* Lukasz Majewski: > It fixes the following error on ARM 32 bit port: > > y2038-glibc/support/support_path_support_time64.c:34: undefined reference to > `__libc_do_syscall' > collect2: error: ld returned 1 exit status Should libsupport use syscall for direct system calls? Thanks, Florian
Hi Florian, > * Lukasz Majewski: > > > It fixes the following error on ARM 32 bit port: > > > > y2038-glibc/support/support_path_support_time64.c:34: undefined > > reference to `__libc_do_syscall' > > collect2: error: ld returned 1 exit status > > Should libsupport use syscall for direct system calls? I'm not sure what is the correct approach here. In my case - armv7, 32 bit - in support/support_path_support_time64.c the utimensat_time64 syscall is called, which is wrapped to INLINE_SYSCALL_CALL(), which calls __libc_do_syscall ASM ARM function. This function is only defined for i386 and 32 bit ARM (in e.g. sysdeps/unix/sysv/linux/{arm|i386}/libc-do-syscall.S) > > Thanks, > Florian > Best regards, Lukasz Majewski -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de
* Lukasz Majewski: > Hi Florian, > >> * Lukasz Majewski: >> >> > It fixes the following error on ARM 32 bit port: >> > >> > y2038-glibc/support/support_path_support_time64.c:34: undefined >> > reference to `__libc_do_syscall' >> > collect2: error: ld returned 1 exit status >> >> Should libsupport use syscall for direct system calls? > > I'm not sure what is the correct approach here. > > In my case - armv7, 32 bit - in support/support_path_support_time64.c > the utimensat_time64 syscall is called, which is wrapped to > INLINE_SYSCALL_CALL(), which calls __libc_do_syscall ASM ARM function. > > This function is only defined for i386 and 32 bit ARM (in e.g. > sysdeps/unix/sysv/linux/{arm|i386}/libc-do-syscall.S) Yes, and using the syscall function would avoid this issue. So the question is, why INLINE_SYSCALL_CALL? Thanks, Florian
Hi Florian, > * Lukasz Majewski: > > > Hi Florian, > > > >> * Lukasz Majewski: > >> > >> > It fixes the following error on ARM 32 bit port: > >> > > >> > y2038-glibc/support/support_path_support_time64.c:34: undefined > >> > reference to `__libc_do_syscall' > >> > collect2: error: ld returned 1 exit status > >> > >> Should libsupport use syscall for direct system calls? > > > > I'm not sure what is the correct approach here. > > > > In my case - armv7, 32 bit - in > > support/support_path_support_time64.c the utimensat_time64 syscall > > is called, which is wrapped to INLINE_SYSCALL_CALL(), which calls > > __libc_do_syscall ASM ARM function. > > > > This function is only defined for i386 and 32 bit ARM (in e.g. > > sysdeps/unix/sysv/linux/{arm|i386}/libc-do-syscall.S) > > Yes, and using the syscall function would avoid this issue. > > So the question is, why INLINE_SYSCALL_CALL? Good question - I guess that Adhemerval would know why it was necessary. > > Thanks, > Florian > Best regards, Lukasz Majewski -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de
On 16/03/2021 02:10, Florian Weimer wrote: > * Lukasz Majewski: > >> Hi Florian, >> >>> * Lukasz Majewski: >>> >>>> It fixes the following error on ARM 32 bit port: >>>> >>>> y2038-glibc/support/support_path_support_time64.c:34: undefined >>>> reference to `__libc_do_syscall' >>>> collect2: error: ld returned 1 exit status >>> >>> Should libsupport use syscall for direct system calls? >> >> I'm not sure what is the correct approach here. >> >> In my case - armv7, 32 bit - in support/support_path_support_time64.c >> the utimensat_time64 syscall is called, which is wrapped to >> INLINE_SYSCALL_CALL(), which calls __libc_do_syscall ASM ARM function. >> >> This function is only defined for i386 and 32 bit ARM (in e.g. >> sysdeps/unix/sysv/linux/{arm|i386}/libc-do-syscall.S) > > Yes, and using the syscall function would avoid this issue. > > So the question is, why INLINE_SYSCALL_CALL? The __libc_do_syscall is in fact only used thumb mode used as default, and the direct syscall is used because there is no direct support for using 64 bit types on ABI with default 32 bit time. We might eventually remove the INLINE_SYSCALL_CALL once 64 bit time support is implemented (so we build the file with _TIME_SIZE=64). The patch itself looks ok.
On 16/03/2021 09:46, Adhemerval Zanella wrote: > > > On 16/03/2021 02:10, Florian Weimer wrote: >> * Lukasz Majewski: >> >>> Hi Florian, >>> >>>> * Lukasz Majewski: >>>> >>>>> It fixes the following error on ARM 32 bit port: >>>>> >>>>> y2038-glibc/support/support_path_support_time64.c:34: undefined >>>>> reference to `__libc_do_syscall' >>>>> collect2: error: ld returned 1 exit status >>>> >>>> Should libsupport use syscall for direct system calls? >>> >>> I'm not sure what is the correct approach here. >>> >>> In my case - armv7, 32 bit - in support/support_path_support_time64.c >>> the utimensat_time64 syscall is called, which is wrapped to >>> INLINE_SYSCALL_CALL(), which calls __libc_do_syscall ASM ARM function. >>> >>> This function is only defined for i386 and 32 bit ARM (in e.g. >>> sysdeps/unix/sysv/linux/{arm|i386}/libc-do-syscall.S) >> >> Yes, and using the syscall function would avoid this issue. >> >> So the question is, why INLINE_SYSCALL_CALL? > > The __libc_do_syscall is in fact only used thumb mode used as default, > and the direct syscall is used because there is no direct support > for using 64 bit types on ABI with default 32 bit time. We might > eventually remove the INLINE_SYSCALL_CALL once 64 bit time support is > implemented (so we build the file with _TIME_SIZE=64). > > The patch itself looks ok. > And indeed there is no need to use INLINE_SYSCALL_CALL, syscall(...) should suffice it won't require to handle the ARM __libc_do_syscall.
Hi Adhemerval, > On 16/03/2021 02:10, Florian Weimer wrote: > > * Lukasz Majewski: > > > >> Hi Florian, > >> > >>> * Lukasz Majewski: > >>> > >>>> It fixes the following error on ARM 32 bit port: > >>>> > >>>> y2038-glibc/support/support_path_support_time64.c:34: undefined > >>>> reference to `__libc_do_syscall' > >>>> collect2: error: ld returned 1 exit status > >>> > >>> Should libsupport use syscall for direct system calls? > >> > >> I'm not sure what is the correct approach here. > >> > >> In my case - armv7, 32 bit - in > >> support/support_path_support_time64.c the utimensat_time64 syscall > >> is called, which is wrapped to INLINE_SYSCALL_CALL(), which calls > >> __libc_do_syscall ASM ARM function. > >> > >> This function is only defined for i386 and 32 bit ARM (in e.g. > >> sysdeps/unix/sysv/linux/{arm|i386}/libc-do-syscall.S) > > > > Yes, and using the syscall function would avoid this issue. > > > > So the question is, why INLINE_SYSCALL_CALL? > > The __libc_do_syscall is in fact only used thumb mode used as default, > and the direct syscall is used because there is no direct support > for using 64 bit types on ABI with default 32 bit time. We might > eventually remove the INLINE_SYSCALL_CALL once 64 bit time support is > implemented (so we build the file with _TIME_SIZE=64). > > The patch itself looks ok. Thanks for review. I will apply it if Florian don't mind. Best regards, Lukasz Majewski -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de
On 16/03/2021 11:17, Lukasz Majewski wrote: > Hi Adhemerval, > >> On 16/03/2021 02:10, Florian Weimer wrote: >>> * Lukasz Majewski: >>> >>>> Hi Florian, >>>> >>>>> * Lukasz Majewski: >>>>> >>>>>> It fixes the following error on ARM 32 bit port: >>>>>> >>>>>> y2038-glibc/support/support_path_support_time64.c:34: undefined >>>>>> reference to `__libc_do_syscall' >>>>>> collect2: error: ld returned 1 exit status >>>>> >>>>> Should libsupport use syscall for direct system calls? >>>> >>>> I'm not sure what is the correct approach here. >>>> >>>> In my case - armv7, 32 bit - in >>>> support/support_path_support_time64.c the utimensat_time64 syscall >>>> is called, which is wrapped to INLINE_SYSCALL_CALL(), which calls >>>> __libc_do_syscall ASM ARM function. >>>> >>>> This function is only defined for i386 and 32 bit ARM (in e.g. >>>> sysdeps/unix/sysv/linux/{arm|i386}/libc-do-syscall.S) >>> >>> Yes, and using the syscall function would avoid this issue. >>> >>> So the question is, why INLINE_SYSCALL_CALL? >> >> The __libc_do_syscall is in fact only used thumb mode used as default, >> and the direct syscall is used because there is no direct support >> for using 64 bit types on ABI with default 32 bit time. We might >> eventually remove the INLINE_SYSCALL_CALL once 64 bit time support is >> implemented (so we build the file with _TIME_SIZE=64). >> >> The patch itself looks ok. > > Thanks for review. I will apply it if Florian don't mind. Please replace the INLINE_SYSCALL_CALL with a simpler syscall(2) so it won't require to add libc-do-syscall.
* Lukasz Majewski:
> Thanks for review. I will apply it if Florian don't mind.
I prefer the syscall-based approach because it makes it easier to build
the test outside of the glibc source tree.
Thanks,
Florian
Hi Florian, > * Lukasz Majewski: > > > Thanks for review. I will apply it if Florian don't mind. > > I prefer the syscall-based approach because it makes it easier to > build the test outside of the glibc source tree. Ok. > > Thanks, > Florian > Best regards, Lukasz Majewski -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de
diff --git a/sysdeps/unix/sysv/linux/arm/Makefile b/sysdeps/unix/sysv/linux/arm/Makefile index abdf01f00c..2344e74554 100644 --- a/sysdeps/unix/sysv/linux/arm/Makefile +++ b/sysdeps/unix/sysv/linux/arm/Makefile @@ -55,6 +55,11 @@ LDFLAGS-tst-rfc3484-2 += $(common-objpfx)csu/libc-do-syscall.o LDFLAGS-tst-rfc3484-3 += $(common-objpfx)csu/libc-do-syscall.o endif +ifeq ($(subdir),support) +libsupport-sysdep_routines += libc-do-syscall +libsupport-static-only-routines += libc-do-syscall +endif + abi-variants := soft hard ifeq (,$(filter $(default-abi),$(abi-variants)))