From patchwork Wed Feb 21 08:36:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dimitar Dimitrov X-Patchwork-Id: 86115 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7CAAB3858C53 for ; Wed, 21 Feb 2024 08:39:10 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from server28.superhosting.bg (server28.superhosting.bg [217.174.156.11]) by sourceware.org (Postfix) with ESMTPS id C53113858D39 for ; Wed, 21 Feb 2024 08:36:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C53113858D39 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dinux.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dinux.eu ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C53113858D39 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=217.174.156.11 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708504616; cv=none; b=NXqWOqSk3e0heYsKhcex07s8Km4Qjfvqi+oGzeCk+z0KYp0xPWI24rAGR/5dFLQC8cLQciJWMLtB1w3EpCa6DxnaoOjIZvdFC3aWY4Y3Rz7mEjEIoxLx6JgsqbcsFvxJkMJ1MXvT3+srJnUXvaE288ix2KLe90nYz1HWRgBwPBU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708504616; c=relaxed/simple; bh=hzG/eSyPGrIwFcz9FN4C66GsWsNXabe52EDQqr+LwH0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=JEKR6IvUf0x1PggRjkoLvHzs/43BZmTd46y8T2TsVy6AyyqcxAoIKfqIpJmZRgQupAhREyCuNBTIDyip/nj8MBsiA4Ukm9hB1/Hqrt1CYLfNyxvxphKhkkf2zOCvZOkNmJN9HGIr92uXhuU47kKNEVL8NUFoqj2JYjhAIRvwCDk= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dinux.eu; s=default; h=Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject: Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=X3LywYvMKQhJQ6/HrjQdkHIeeYKnPbgOXNtS/YPGBUE=; b=t9JatxJmmZA2FbjAlcjY/xqOJT i3oaZRej2dJ9n0SrlpQ5qSanPoPkW4WEusohYSchHbMR1pkmgpelnRFiAe2QKrdOcN6xoAzYHGC1J M3K1pU/KKz4A0R5nogMq/aHm7ZuG6GRZrvEctcOA5Q5tZ2EON13Tv8LYbVZhmteu6CFPOaNJQjDOC RFbySVP9iLNAA1ubGTSmfvxGMBi8QI6NHwoDRxvoQxF//6sN6ipPnJ/FAMcVbm2UDEth300B8214P YEexFqBZOG7hd9PdcksQYKbKLQY4rbsD/naLcFXaREMcbXrrFPOxSyvEDosqhyDOQFlW2n48rGMyu MncKfLlg==; Received: from 95-42-20-142.ip.btc-net.bg ([95.42.20.142]:33620 helo=kendros.lan) by server28.superhosting.bg with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1rci5q-0004Iy-1Z; Wed, 21 Feb 2024 10:36:44 +0200 From: Dimitar Dimitrov To: gcc-patches@gcc.gnu.org Cc: Dimitar Dimitrov Subject: [committed] pru: Document that arguments are not passed to main with -minrt Date: Wed, 21 Feb 2024 10:36:36 +0200 Message-ID: <20240221083637.1543198-1-dimitar@dinux.eu> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server28.superhosting.bg X-AntiAbuse: Original Domain - gcc.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - dinux.eu X-Get-Message-Sender-Via: server28.superhosting.bg: authenticated_id: dimitar@dinux.eu X-Authenticated-Sender: server28.superhosting.bg: dimitar@dinux.eu X-Source: X-Source-Args: X-Source-Dir: X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org 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 --- 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}