This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2 10/15] RISC-V: Linux Syscall Interface
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Palmer Dabbelt <palmer at dabbelt dot com>
- Cc: <adhemerval dot zanella at linaro dot org>, <libc-alpha at sourceware dot org>, Andrew Waterman <andrew at sifive dot com>, Darius Rad <darius at bluespec dot com>, <dj at redhat dot com>
- Date: Mon, 1 Jan 2018 00:56:14 +0000
- Subject: Re: [PATCH v2 10/15] RISC-V: Linux Syscall Interface
- Authentication-results: sourceware.org; auth=none
- References: <mhng-a9f80547-ccbd-43a4-89d9-9ee8d1e6d067@palmer-si-x1c4>
On Sat, 23 Dec 2017, Palmer Dabbelt wrote:
> > > diff --git a/sysdeps/unix/sysv/linux/riscv/arch-fork.h
> > > b/sysdeps/unix/sysv/linux/riscv/arch-fork.h
> > > new file mode 100644
> > > index 000000000000..5f945378eec0
> > > --- /dev/null
> > > +++ b/sysdeps/unix/sysv/linux/riscv/arch-fork.h
> > > @@ -0,0 +1 @@
> > > +#include <sysdeps/unix/sysv/linux/i386/arch-fork.h>
> >
> > I would prefer for new ports if we refrain to continue doing this cross arch
> > code references, it ties implementations that should be independent of each
> > other and make future cleanups more complex and required to adequate
> > multiple
> > architecture at once.
>
> OK, no problem. I've gone and replaced the #include with the contents of the
> included file for every instance where we were doing this. I'll include this
> as part of a v3 patch set.
Copying the included file isn't particularly good either. Rather, each
such case, whether a copy from another architecture or a #include from
another architecture, indicates a case where refactoring is needed to
avoid such duplication - if the code can be generic for all new ports it
should be in a generic location, while if it's generic for ports with a
particular property things should be factored so a port only needs to
declare that it has that property. (Of course such refactoring is risky
so not typically appropriate during a release freeze.)
Often, the files for i386 are actually generic for *old* ports and so if
you're copying or including such a file (or one from another old
architecture) you need to be particularly careful that it actually
represents the desired way to do things now, rather than compatibility
with old ABIs or old versions of the syscall interface.
--
Joseph S. Myers
joseph@codesourcery.com