Re: [PATCH v1 03/11] tools/nolibc: include crt.h before arch.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, Thomas

> 
> On 2023-06-29 02:54:35+0800, Zhangjin Wu wrote:
> > The crt.h provides a new _start_c() function, which is required by the
> > new assembly _start entry of arch-<ARCH>.h (included by arch.h), let's
> > include crt.h before arch.h.
> > 
> > This '#include "crt.h"' doesn't let the new _start_c() work immediately,
> > but it is a base of the coming patches to move most of the assembly
> > _start operations to the _start_c() function for every supported
> > architecture.
> 
> Why don't the arch-*.h files include this new header?
> They are the users of the new symbol.
>

I have tried so, but since crt.h itself is not architecture specific, add it
before arch.h will avoid every new arch porting add the same thing again and
again, currently, we only need to add once. I have even planned to move
compiler.h out of arch-*.h, but not yet ;-)

And also, crt.h may require more features in the future, like init/fini
support, it may be not only used by arch-*.h files.

> > 
> > Signed-off-by: Zhangjin Wu <falcon@xxxxxxxxxxx>
> > ---
> >  tools/include/nolibc/Makefile | 1 +
> >  tools/include/nolibc/nolibc.h | 1 +
> >  tools/include/nolibc/signal.h | 1 +
> >  tools/include/nolibc/stdio.h  | 1 +
> >  tools/include/nolibc/stdlib.h | 1 +
> >  tools/include/nolibc/sys.h    | 1 +
> >  tools/include/nolibc/time.h   | 1 +
> >  tools/include/nolibc/unistd.h | 1 +
> >  8 files changed, 8 insertions(+)
> > 
> > diff --git a/tools/include/nolibc/Makefile b/tools/include/nolibc/Makefile
> > index 875e13e3c851..00471e59b11e 100644
> > --- a/tools/include/nolibc/Makefile
> > +++ b/tools/include/nolibc/Makefile
> > @@ -37,6 +37,7 @@ NARCH            = $(or $(NARCH_$(ARCH)),$(ARCH))
> >  arch_file := arch-$(NARCH).h
> >  all_files := \
> >  		compiler.h \
> > +		crt.h \
> 
> This should be part of the patch adding the file.
>

Ok, thanks very much.

Best regards,
Zhangjin

> >  		ctype.h \
> >  		errno.h \
> >  		nolibc.h \



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux