]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
pru: Document that arguments are not passed to main with -minrt
authorDimitar Dimitrov <dimitar@dinux.eu>
Thu, 1 Feb 2024 17:19:54 +0000 (19:19 +0200)
committerDimitar Dimitrov <dimitar@dinux.eu>
Wed, 21 Feb 2024 08:35:40 +0000 (10:35 +0200)
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

index e18886e0ac7bacaf136adf1bb647281c50e1d4f7..69020245b2565cb5fbe59255127a405fb3a454f7 100644 (file)
@@ -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}