All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhangjin Wu <falcon@tinylab.org>
To: thomas@t-8ch.de, w@1wt.eu
Cc: falcon@tinylab.org, arnd@arndb.de, linux-kernel@vger.kernel.org,
	linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org
Subject: [PATCH v1 03/11] tools/nolibc: include crt.h before arch.h
Date: Thu, 29 Jun 2023 02:54:35 +0800	[thread overview]
Message-ID: <c61b5bc53895e8c6b2f30d59f86067973e6bbce0.1687976753.git.falcon@tinylab.org> (raw)
In-Reply-To: <cover.1687976753.git.falcon@tinylab.org>

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.

Signed-off-by: Zhangjin Wu <falcon@tinylab.org>
---
 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 \
 		ctype.h \
 		errno.h \
 		nolibc.h \
diff --git a/tools/include/nolibc/nolibc.h b/tools/include/nolibc/nolibc.h
index 1f8d821000ac..2cc9ccd90d56 100644
--- a/tools/include/nolibc/nolibc.h
+++ b/tools/include/nolibc/nolibc.h
@@ -93,6 +93,7 @@
 #define _NOLIBC_H
 
 #include "std.h"
+#include "crt.h"
 #include "arch.h"
 #include "types.h"
 #include "sys.h"
diff --git a/tools/include/nolibc/signal.h b/tools/include/nolibc/signal.h
index 137552216e46..f0a1418c1cb2 100644
--- a/tools/include/nolibc/signal.h
+++ b/tools/include/nolibc/signal.h
@@ -8,6 +8,7 @@
 #define _NOLIBC_SIGNAL_H
 
 #include "std.h"
+#include "crt.h"
 #include "arch.h"
 #include "types.h"
 #include "sys.h"
diff --git a/tools/include/nolibc/stdio.h b/tools/include/nolibc/stdio.h
index 0eef91daf289..89d3749b3620 100644
--- a/tools/include/nolibc/stdio.h
+++ b/tools/include/nolibc/stdio.h
@@ -10,6 +10,7 @@
 #include <stdarg.h>
 
 #include "std.h"
+#include "crt.h"
 #include "arch.h"
 #include "errno.h"
 #include "types.h"
diff --git a/tools/include/nolibc/stdlib.h b/tools/include/nolibc/stdlib.h
index 902162f80337..0ff7fac40bd4 100644
--- a/tools/include/nolibc/stdlib.h
+++ b/tools/include/nolibc/stdlib.h
@@ -8,6 +8,7 @@
 #define _NOLIBC_STDLIB_H
 
 #include "std.h"
+#include "crt.h"
 #include "arch.h"
 #include "types.h"
 #include "sys.h"
diff --git a/tools/include/nolibc/sys.h b/tools/include/nolibc/sys.h
index 2c302f3feb71..b6c33c40c037 100644
--- a/tools/include/nolibc/sys.h
+++ b/tools/include/nolibc/sys.h
@@ -24,6 +24,7 @@
 #include <linux/reboot.h> /* for LINUX_REBOOT_* */
 #include <linux/prctl.h>
 
+#include "crt.h"
 #include "arch.h"
 #include "errno.h"
 #include "types.h"
diff --git a/tools/include/nolibc/time.h b/tools/include/nolibc/time.h
index 84655361b9ad..bbe8f9aa3e9b 100644
--- a/tools/include/nolibc/time.h
+++ b/tools/include/nolibc/time.h
@@ -8,6 +8,7 @@
 #define _NOLIBC_TIME_H
 
 #include "std.h"
+#include "crt.h"
 #include "arch.h"
 #include "types.h"
 #include "sys.h"
diff --git a/tools/include/nolibc/unistd.h b/tools/include/nolibc/unistd.h
index e38f3660c051..f1677224bb5a 100644
--- a/tools/include/nolibc/unistd.h
+++ b/tools/include/nolibc/unistd.h
@@ -8,6 +8,7 @@
 #define _NOLIBC_UNISTD_H
 
 #include "std.h"
+#include "crt.h"
 #include "arch.h"
 #include "types.h"
 #include "sys.h"
-- 
2.25.1


WARNING: multiple messages have this Message-ID (diff)
From: Zhangjin Wu <falcon@tinylab.org>
To: thomas@t-8ch.de, w@1wt.eu
Cc: falcon@tinylab.org, arnd@arndb.de, linux-kernel@vger.kernel.org,
	linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org
Subject: [PATCH v1 03/11] tools/nolibc: include crt.h before arch.h
Date: Thu, 29 Jun 2023 02:54:35 +0800	[thread overview]
Message-ID: <c61b5bc53895e8c6b2f30d59f86067973e6bbce0.1687976753.git.falcon@tinylab.org> (raw)
In-Reply-To: <cover.1687976753.git.falcon@tinylab.org>

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.

Signed-off-by: Zhangjin Wu <falcon@tinylab.org>
---
 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 \
 		ctype.h \
 		errno.h \
 		nolibc.h \
diff --git a/tools/include/nolibc/nolibc.h b/tools/include/nolibc/nolibc.h
index 1f8d821000ac..2cc9ccd90d56 100644
--- a/tools/include/nolibc/nolibc.h
+++ b/tools/include/nolibc/nolibc.h
@@ -93,6 +93,7 @@
 #define _NOLIBC_H
 
 #include "std.h"
+#include "crt.h"
 #include "arch.h"
 #include "types.h"
 #include "sys.h"
diff --git a/tools/include/nolibc/signal.h b/tools/include/nolibc/signal.h
index 137552216e46..f0a1418c1cb2 100644
--- a/tools/include/nolibc/signal.h
+++ b/tools/include/nolibc/signal.h
@@ -8,6 +8,7 @@
 #define _NOLIBC_SIGNAL_H
 
 #include "std.h"
+#include "crt.h"
 #include "arch.h"
 #include "types.h"
 #include "sys.h"
diff --git a/tools/include/nolibc/stdio.h b/tools/include/nolibc/stdio.h
index 0eef91daf289..89d3749b3620 100644
--- a/tools/include/nolibc/stdio.h
+++ b/tools/include/nolibc/stdio.h
@@ -10,6 +10,7 @@
 #include <stdarg.h>
 
 #include "std.h"
+#include "crt.h"
 #include "arch.h"
 #include "errno.h"
 #include "types.h"
diff --git a/tools/include/nolibc/stdlib.h b/tools/include/nolibc/stdlib.h
index 902162f80337..0ff7fac40bd4 100644
--- a/tools/include/nolibc/stdlib.h
+++ b/tools/include/nolibc/stdlib.h
@@ -8,6 +8,7 @@
 #define _NOLIBC_STDLIB_H
 
 #include "std.h"
+#include "crt.h"
 #include "arch.h"
 #include "types.h"
 #include "sys.h"
diff --git a/tools/include/nolibc/sys.h b/tools/include/nolibc/sys.h
index 2c302f3feb71..b6c33c40c037 100644
--- a/tools/include/nolibc/sys.h
+++ b/tools/include/nolibc/sys.h
@@ -24,6 +24,7 @@
 #include <linux/reboot.h> /* for LINUX_REBOOT_* */
 #include <linux/prctl.h>
 
+#include "crt.h"
 #include "arch.h"
 #include "errno.h"
 #include "types.h"
diff --git a/tools/include/nolibc/time.h b/tools/include/nolibc/time.h
index 84655361b9ad..bbe8f9aa3e9b 100644
--- a/tools/include/nolibc/time.h
+++ b/tools/include/nolibc/time.h
@@ -8,6 +8,7 @@
 #define _NOLIBC_TIME_H
 
 #include "std.h"
+#include "crt.h"
 #include "arch.h"
 #include "types.h"
 #include "sys.h"
diff --git a/tools/include/nolibc/unistd.h b/tools/include/nolibc/unistd.h
index e38f3660c051..f1677224bb5a 100644
--- a/tools/include/nolibc/unistd.h
+++ b/tools/include/nolibc/unistd.h
@@ -8,6 +8,7 @@
 #define _NOLIBC_UNISTD_H
 
 #include "std.h"
+#include "crt.h"
 #include "arch.h"
 #include "types.h"
 #include "sys.h"
-- 
2.25.1


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  parent reply	other threads:[~2023-06-28 18:57 UTC|newest]

Thread overview: 32+ 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:50 ` 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:51   ` 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:53   ` Zhangjin Wu
2023-06-28 18:54 ` Zhangjin Wu [this message]
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-02 18:57     ` Thomas Weißschuh
2023-07-03  9:58     ` Zhangjin Wu
2023-07-03  9:58       ` Zhangjin Wu
2023-07-03 10:11       ` Thomas Weißschuh
2023-07-03 10:11         ` Thomas Weißschuh
2023-07-03 14:55         ` Zhangjin Wu
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:55   ` Zhangjin Wu
2023-06-28 18:57 ` [PATCH v1 05/11] tools/nolibc: aarch64: " Zhangjin Wu
2023-06-28 18:57   ` Zhangjin Wu
2023-06-28 18:58 ` [PATCH v1 06/11] tools/nolibc: i386: " Zhangjin Wu
2023-06-28 18:58   ` Zhangjin Wu
2023-06-28 18:59 ` [PATCH v1 07/11] tools/nolibc: x86_64: " Zhangjin Wu
2023-06-28 18:59   ` Zhangjin Wu
2023-06-28 19:01 ` [PATCH v1 08/11] tools/nolibc: mips: " Zhangjin Wu
2023-06-28 19:01   ` Zhangjin Wu
2023-06-28 19:02 ` [PATCH v1 09/11] tools/nolibc: loongarch: " Zhangjin Wu
2023-06-28 19:02   ` Zhangjin Wu
2023-06-28 19:04 ` [PATCH v1 10/11] tools/nolibc: riscv: " Zhangjin Wu
2023-06-28 19:04   ` Zhangjin Wu
2023-06-28 19:06 ` [PATCH v1 11/11] tools/nolibc: s390: " Zhangjin Wu
2023-06-28 19:06   ` 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=c61b5bc53895e8c6b2f30d59f86067973e6bbce0.1687976753.git.falcon@tinylab.org \
    --to=falcon@tinylab.org \
    --cc=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=thomas@t-8ch.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.