From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/14511 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH 2/2] fix risc64 user_regs_struct conflict with kernel header Date: Tue, 6 Aug 2019 09:01:29 -0400 Message-ID: <20190806130129.GU9017@brightrain.aerifal.cx> References: <63f4c551e85a848e336f41539b6dd283396eeda7.1565070674.git.baruch@tkos.co.il> <20190806121047.GT9017@brightrain.aerifal.cx> <87imra7amk.fsf@tarshish> Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="230442"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-14527-gllmg-musl=m.gmane.org@lists.openwall.com Tue Aug 06 15:01:45 2019 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.89) (envelope-from ) id 1huz60-000xeE-QA for gllmg-musl@m.gmane.org; Tue, 06 Aug 2019 15:01:44 +0200 Original-Received: (qmail 11941 invoked by uid 550); 6 Aug 2019 13:01:42 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 11921 invoked from network); 6 Aug 2019 13:01:42 -0000 Content-Disposition: inline In-Reply-To: <87imra7amk.fsf@tarshish> Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:14511 Archived-At: On Tue, Aug 06, 2019 at 03:15:47PM +0300, Baruch Siach wrote: > Hi Rick, > > On Tue, Aug 06 2019, Rich Felker wrote: > > On Tue, Aug 06, 2019 at 08:51:14AM +0300, Baruch Siach wrote: > >> Rename user_regs_struct following the example of s390 to avoid conflict > >> with the kernel asm/ptrace.h header. > >> --- > >> arch/riscv64/bits/user.h | 2 +- > >> 1 file changed, 1 insertion(+), 1 deletion(-) > >> > >> diff --git a/arch/riscv64/bits/user.h b/arch/riscv64/bits/user.h > >> index bd0f0fc7027f..097c7ad6ce18 100644 > >> --- a/arch/riscv64/bits/user.h > >> +++ b/arch/riscv64/bits/user.h > >> @@ -1,4 +1,4 @@ > >> -struct user_regs_struct { > >> +struct _user_regs_struct { > >> unsigned long pc; > >> unsigned long ra; > >> unsigned long sp; > > > > Does this agree with glibc naming? > > glibc riscv headers do not define user_regs_struct. Not even by including a kernel header that defines it? If so, then the public type must be the same as the type in the kernel header. This is a known issue in user.h and related headers on several archs, and it's hard to solve in any reasonable and consistent way short of doing the same thing (including the kernel header). Renaming the type in a way that makes the API incompatible is not the right solution. Rich