Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: "Thomas Weißschuh" <thomas@t-8ch.de>
To: Zhangjin Wu <falcon@tinylab.org>
Cc: arnd@arndb.de, linux-kernel@vger.kernel.org,
	linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org,
	w@1wt.eu
Subject: Re: [PATCH v1 03/11] tools/nolibc: include crt.h before arch.h
Date: Mon, 3 Jul 2023 12:11:48 +0200	[thread overview]
Message-ID: <8efbbfe5-1c3f-46df-9bc3-2ba62015f17e@t-8ch.de> (raw)
In-Reply-To: <20230703095832.493137-1-falcon@tinylab.org>

On 2023-07-03 17:58:32+0800, Zhangjin Wu wrote:
> 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 ;-)

While this saves a few lines of code in my opinion it hurts clarity to
rely on implicitly pre-included things.

> every new arch porting

That doesn't seem like a very frequent occurrence :-)

> 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.

Do you have a mechanism in mind that supports init/fini without needing
an ELF parser at runtime? I guess an ELF parser would make it a complete
no-go.

Also the value added by init/fini seems fairly limited for a statically
linked (tiny) application.

> [..]

  reply	other threads:[~2023-07-03 10:11 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-28 18:50 [PATCH v1 00/11] tools/nolibc: shrink arch support Zhangjin Wu
2023-06-28 18:51 ` [PATCH v1 01/11] tools/nolibc: remove old arch specific stat support Zhangjin Wu
2023-06-28 18:53 ` [PATCH v1 02/11] tools/nolibc: add new crt.h with _start_c Zhangjin Wu
2023-06-28 18:54 ` [PATCH v1 03/11] tools/nolibc: include crt.h before arch.h Zhangjin Wu
2023-07-02 18:57   ` Thomas Weißschuh
2023-07-03  9:58     ` Zhangjin Wu
2023-07-03 10:11       ` Thomas Weißschuh [this message]
2023-07-03 14:55         ` Zhangjin Wu
2023-06-28 18:55 ` [PATCH v1 04/11] tools/nolibc: arm: shrink _start with _start_c Zhangjin Wu
2023-06-28 18:57 ` [PATCH v1 05/11] tools/nolibc: aarch64: " Zhangjin Wu
2023-06-28 18:58 ` [PATCH v1 06/11] tools/nolibc: i386: " Zhangjin Wu
2023-06-28 18:59 ` [PATCH v1 07/11] tools/nolibc: x86_64: " Zhangjin Wu
2023-06-28 19:01 ` [PATCH v1 08/11] tools/nolibc: mips: " Zhangjin Wu
2023-06-28 19:02 ` [PATCH v1 09/11] tools/nolibc: loongarch: " Zhangjin Wu
2023-06-28 19:04 ` [PATCH v1 10/11] tools/nolibc: riscv: " Zhangjin Wu
2023-06-28 19:06 ` [PATCH v1 11/11] tools/nolibc: s390: " Zhangjin Wu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8efbbfe5-1c3f-46df-9bc3-2ba62015f17e@t-8ch.de \
    --to=thomas@t-8ch.de \
    --cc=arnd@arndb.de \
    --cc=falcon@tinylab.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=w@1wt.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox