From patchwork Mon May 8 13:30:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 680414 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2B8AC77B75 for ; Mon, 8 May 2023 13:32:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234131AbjEHNcT (ORCPT ); Mon, 8 May 2023 09:32:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234162AbjEHNcS (ORCPT ); Mon, 8 May 2023 09:32:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC8AA25730; Mon, 8 May 2023 06:32:10 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3C06863D1C; Mon, 8 May 2023 13:32:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5A0AEC433D2; Mon, 8 May 2023 13:32:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683552729; bh=BFbcQkbzLb4nPKXqpv19YJcpoC5MeNxkLoWEaXmzKEw=; h=From:Date:Subject:To:Cc:From; b=jIlc9eguDinI2BZ1xGzOU0lpUtej1txyRJ0U7m2jQZIQDUXdcvqR7VRWRdJNsRylW 1oHqGmzuA38luWJfqwy9UBRZ2m7BN/5T6fHAEc2y0+wpN1nlGAfbhwCSYgdOI2//iI zTqdG8eO9YPt71RLp5qhx8bTmCfF7tBi3+3j1vNTlZRKvLIIledEfSXGpet+kylLFx nUxmODKyFqQLf9RQ6de2+hyEtJmJFS4jldACqsXhdSJJuols3X9ADrks70k1hRoV0H xo2dz4xUSiWH26RniJOHjXGIL1G4r71gnqK2U4CLAK4wEA99D52fG3S2fmLMw1XQ8Q R0ElbDtKl6b2g== From: Mark Brown Date: Mon, 08 May 2023 22:30:36 +0900 Subject: [PATCH v2] tools/nolibc: Fix build of stdio.h due to header ordering MIME-Version: 1.0 Message-Id: <20230413-nolibc-stdio-fix-v2-1-6b6bbb045a80@kernel.org> X-B4-Tracking: v=1; b=H4sIAHv5WGQC/32NOw6DMBAFr4JcZyN/SEGq3COi8GcNK5AdrRFJh Lh7DAdIOU9vNJsoyIRF3JtNMK5UKKcK+tIIP9o0IFCoLLTURrbKQMozOQ9lCZQh0geia3VA0wX ZdaJqzhYExzb58RDfmadjfjHW91l69pVHKkvm7xle1bH+aawKFEQrb9EbZ1XEx4SccL5mHkS/7 /sPAEFBbMgAAAA= To: Willy Tarreau , "Paul E. McKenney" , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Cc: Shuah Khan , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Mark Brown X-Mailer: b4 0.13-dev-bfdf5 X-Developer-Signature: v=1; a=openpgp-sha256; l=1444; i=broonie@kernel.org; h=from:subject:message-id; bh=BFbcQkbzLb4nPKXqpv19YJcpoC5MeNxkLoWEaXmzKEw=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBkWPnWK8WVwLwTN8yprcVowzUgMJXNs+7+VOyCg lFnHGPRRiyJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZFj51gAKCRAk1otyXVSH 0F1bB/9GYlh/NzE9G7uwVV4dGZp7MeH2m/4VNUKkwMKNHsbxDy+pwDL7FgsLpfssm8FmLWyF7UY powYh3PLr+gCsrCeL2KddzHMXIp+MsKn3hYQb9RkuLwcZNu5qnlx+Ydowi+SDoIALxhdhgWeJT5 WeipQuNyxzf3nvpta/fVT2V0Otnl1xSyIqmmNR3uEPXkS9EZnUWD8qGzzF7fePsN9QRAB+puN7F gzrcoPAUn1HBT7kp3R2yYW8a6fpNCGYHO7uVuKZpmr6HyRpFkmFzjY1Hfnfm2IZd+wnhv6qfPwU /5NY5c50le71sgCcEL7p6FNHmNTTGZhbHtJloGJG9DPwZ1tu X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org When we added fd based file streams we created references to STx_FILENO in stdio.h but these constants are declared in unistd.h which is the last file included by the top level nolibc.h meaning those constants are not defined when we try to build stdio.h. This causes programs using nolibc.h to fail to build. Reorder the headers to avoid this issue. Fixes: d449546c957f ("tools/nolibc: implement fd-based FILE streams") Acked-by: Willy Tarreau Signed-off-by: Mark Brown --- Changes in v2: - Rebase onto v6.4-rc1. - This is now a fix for Linus' tree. - Link to v1: https://lore.kernel.org/r/20230413-nolibc-stdio-fix-v1-1-fa05fc3ba1fe@kernel.org --- tools/include/nolibc/nolibc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- base-commit: ac9a78681b921877518763ba0e89202254349d1b change-id: 20230413-nolibc-stdio-fix-fb42de39d099 Best regards, diff --git a/tools/include/nolibc/nolibc.h b/tools/include/nolibc/nolibc.h index 04739a6293c4..05a228a6ee78 100644 --- a/tools/include/nolibc/nolibc.h +++ b/tools/include/nolibc/nolibc.h @@ -99,11 +99,11 @@ #include "sys.h" #include "ctype.h" #include "signal.h" +#include "unistd.h" #include "stdio.h" #include "stdlib.h" #include "string.h" #include "time.h" -#include "unistd.h" #include "stackprotector.h" /* Used by programs to avoid std includes */