public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] pru: Document that arguments are not passed to main with -minrt
@ 2024-02-21  8:36 Dimitar Dimitrov
  2024-02-21  8:36 ` [committed] pru: Document how -mmcu option uses MCU specs Dimitar Dimitrov
  0 siblings, 1 reply; 2+ messages in thread
From: Dimitar Dimitrov @ 2024-02-21  8:36 UTC (permalink / raw)
  To: gcc-patches; +Cc: Dimitar Dimitrov

The minimal runtime has been documented from the beginning to break some
standard features in order to reduce code size, while keeping
the features required by typical firmware programs.  Document one more
imposed restriction - the main() function must take no arguments.

gcc/ChangeLog:

	* doc/invoke.texi (-minrt): Clarify that main
	must take no arguments.

Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
---
 gcc/doc/invoke.texi | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index e18886e0ac7..69020245b25 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -30091,11 +30091,18 @@ These command-line options are defined for PRU target:
 @table @gcctabopt
 @opindex minrt
 @item -minrt
-Link with a minimum runtime environment, with no support for static
-initializers and constructors.  Using this option can significantly reduce
-the size of the final ELF binary.  Beware that the compiler could still
-generate code with static initializers and constructors.  It is up to the
-programmer to ensure that the source program will not use those features.
+Link with a minimum runtime environment.  This can significantly reduce
+the size of the final ELF binary, but some standard C runtime features
+are removed.
+
+This option disables support for static initializers and constructors.
+Beware that the compiler could still generate code with static initializers
+and constructors.  It is up to the programmer to ensure that the source
+program will not use those features.
+
+The minimal startup code would not pass @code{argc} and @code{argv} arguments
+to @code{main}, so the latter must be declared as @code{int main (void)}.
+This is already the norm for most firmware projects.
 
 @opindex mmcu
 @item -mmcu=@var{mcu}
-- 
2.43.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [committed] pru: Document how -mmcu option uses MCU specs
  2024-02-21  8:36 [committed] pru: Document that arguments are not passed to main with -minrt Dimitar Dimitrov
@ 2024-02-21  8:36 ` Dimitar Dimitrov
  0 siblings, 0 replies; 2+ messages in thread
From: Dimitar Dimitrov @ 2024-02-21  8:36 UTC (permalink / raw)
  To: gcc-patches; +Cc: Dimitar Dimitrov

The plan to maintain PRU hardware-specific specs in newlib tree has been
abandoned in favour of a new distinct GIT project.  Update the
documentation accordingly.

gcc/ChangeLog:

	* doc/invoke.texi (-mmcu): Add information about MCU specs.

Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
---
 gcc/doc/invoke.texi | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 69020245b25..d75b28484bb 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -30106,8 +30106,14 @@ This is already the norm for most firmware projects.
 
 @opindex mmcu
 @item -mmcu=@var{mcu}
-Specify the PRU MCU variant to use.  Check Newlib for the exact list of
-supported MCUs.
+Specify the PRU hardware variant to use.  A correspondingly named
+spec file would be loaded, passing the memory region sizes to
+the linker and defining hardware-specific C macros.
+
+Newlib provides only the @code{sim} spec, intended for running
+regression tests using a simulator.  Specs for real hardware can be
+obtained by installing the
+@w{@uref{https://github.com/dinuxbg/gnuprumcu/,GnuPruMcu}} package.
 
 @opindex mno-relax
 @item -mno-relax
-- 
2.43.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-02-21  8:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-21  8:36 [committed] pru: Document that arguments are not passed to main with -minrt Dimitar Dimitrov
2024-02-21  8:36 ` [committed] pru: Document how -mmcu option uses MCU specs Dimitar Dimitrov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).