This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2 10/15] RISC-V: Linux Syscall Interface


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]