From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from outpost1.zedat.fu-berlin.de (outpost1.zedat.fu-berlin.de [130.133.4.66]) by sourceware.org (Postfix) with ESMTPS id E36E23858C2D for ; Wed, 23 Feb 2022 20:51:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E36E23858C2D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=physik.fu-berlin.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=zedat.fu-berlin.de Received: from inpost2.zedat.fu-berlin.de ([130.133.4.69]) by outpost.zedat.fu-berlin.de (Exim 4.94) with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (envelope-from ) id 1nMybS-000xZY-U4; Wed, 23 Feb 2022 21:51:14 +0100 Received: from p57ae5149.dip0.t-ipconnect.de ([87.174.81.73] helo=[192.168.178.35]) by inpost2.zedat.fu-berlin.de (Exim 4.94) with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (envelope-from ) id 1nMybS-001dUV-Nf; Wed, 23 Feb 2022 21:51:14 +0100 Message-ID: <4439e314-dd0d-fb57-0a68-83c3e6f36c20@physik.fu-berlin.de> Date: Wed, 23 Feb 2022 21:51:14 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH] stdio: Move include of bits/stdio-ldbl.h before bits/stdio.h Content-Language: en-US To: Adhemerval Zanella References: <20210322111530.3215018-1-glaubitz@physik.fu-berlin.de> <9dedf9b9-5af3-3f3b-e749-2c8e50ec5dc4@linaro.org> Cc: libc-alpha@sourceware.org From: John Paul Adrian Glaubitz In-Reply-To: <9dedf9b9-5af3-3f3b-e749-2c8e50ec5dc4@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Original-Sender: glaubitz@physik.fu-berlin.de X-Originating-IP: 87.174.81.73 X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Feb 2022 20:51:19 -0000 Hi Adhemerval! On 3/23/21 18:59, Adhemerval Zanella wrote: > I am not sure if this is the correct approach, I am seeing it building for powerpc64le with gcc version 10.2.1 20210126: > > | powerpc64le-glibc-linux-gnu-gcc nscd.c -c [...] > | In file included from ../include/sys/cdefs.h:3, > | from ../include/features.h:484, > | from ../sysdeps/powerpc/bits/floatn.h:22, > | from ../include/stdio.h:7, > | from ../argp/argp.h:23, > | from ../include/argp.h:2, > | from nscd.c:20: > | ../misc/sys/cdefs.h:503:20: error: ‘__dprintf_chk’ undeclared here (not in a function); did you mean ‘__sprintf_chk’? > | 503 | extern __typeof (__##name) __##name \ > | ^~ > | ../libio/bits/stdio-ldbl.h:98:1: note: in expansion of macro ‘__LDBL_REDIR2_DECL’ > | 98 | __LDBL_REDIR2_DECL (dprintf_chk) > | | ^~~~~~~~~~~~~~~~~~ > | [...] > > The postprocessor output shows: > > | [...] > | 2820 extern __typeof (__dprintf_chk) __dprintf_chk __asm ("" "__" "dprintf_chk" "ieee128"); > | [...] > | 3067 extern int __dprintf_chk (int __fd, int __flag, const char *__restrict __fmt, > | 3068 ...) __attribute__ ((__format__ (__printf__, 3, 4))); > > Meaning we are not using __typeof *before* the function prototype > is define. > > I think to proper handle this LLVM limitation we will need to fully > rework how __LDBL_REDIR2_DECL does the redirect by something similar > to what __REDIRECT does by defining something like: > > | #if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 > | # ifdef __REDIRECT > | > | /* Alias name defined automatically. */ > | # define __LDBL_REDIR(name, proto) \ > | extern name proto __asm__ (__ASMNAME ("__" #name "ieee128")); > | > | /* Alias name defined automatically, with leading underscores. */ > | # define __LDBL_REDIR2_DECL(name) \ > | extern __##name proto __asm__ (__ASMNAME ("__" #name "ieee128")); > > | > | /* Alias name defined manually. */ > | # define __LDBL_REDIR1(name, proto, alias) \ > | extern name proto __asm__ (__ASMNAME (alias)); > > And replace __LDBL_REDIR_DECL with __LDBL_REDIR and __LDBL_REDIR1_DECL > with __LDBL_REDIR1 (while adding the require argument prototype). It > will allow to move the stdio-ldbl.h definitions to stdio and remove the > header. I don't fully understand how to implement this but I would like to fix this because this the main remaining issue with glibc that keeps LLVM from successfully building on sparc64. Could you maybe help me come up with a patch to fix this issue? Thanks, Adrian -- .''`. John Paul Adrian Glaubitz : :' : Debian Developer - glaubitz@debian.org `. `' Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913