Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp1529581rdf; Sun, 5 Nov 2023 03:35:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IFnVlcLQGow+tl9X/BzLtt5qSDqi7o7Vdpxya4FcpwD1b7s8AwPuckNbh/RM2RPtCjpHBpE X-Received: by 2002:a05:6a20:be9e:b0:158:7fdf:66df with SMTP id gf30-20020a056a20be9e00b001587fdf66dfmr19804361pzb.18.1699184134179; Sun, 05 Nov 2023 03:35:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699184134; cv=none; d=google.com; s=arc-20160816; b=HFX2+74pJ+ZbxOeuHAL0xwoCbKRe1a79N1h33ZXkhp/QCtr1xfFQf1OxVKAkegqZNo b12KlZrgv2eJBMhnyvWkOLEUArXVIMOygg4PJfpB1tb02H5nBT7NeZG7ds9gp/0dYzvo uYYl/f66eJulof9FsboA/Sh3tbHHKNLstvKGHYePz3S8HNKG9HIy1WDq34X8WMjhylP1 QrUDxfF2cuZ/GIWV+DAdI/pIwVlkwLj7quv4MIjtAGH3NybjdYAjv1hA5VVH7mP9g1Ip vqz7gt5r09DWLmoTbNSFlRVg8P71TZMoAkqzYB4byVbZrOvYtzZhz2ecvLUdQW4lwFDP UHZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=IFligo1OQR+SG0AAeNQblN6kfOo4n/vpVqKlYUS+ko4=; fh=JRNmh72HsCuY/8FIVPb28sVny+CmDHBEFeZkZsBPzMc=; b=IK/5mxx+etWkpaxHzwQN9SiZ7QQN+KL8EgXt6YWrCinlR5T+KvDrUUUf9IC4u9sJHK mMdeHP+UldYi4XblSkDSFkGPd61HotM24dksxBU2NRdbitFzTZ32gxw/5N1tcYldBjSN hmOQf48MpF2tQ5ZRlk69BOlalp9rSFTfWeGxWxhaTdAC3FOPWI7ypEKcMxhHsNAeCqIN 4i1vENjx5tESLkyc3YqD3ih85KxKA80USMhO2aMGQx8SwlZ/Q5ifiZPvgEDp9VcX9n/u IpHlNKgODro1+qhIhAFhb6xN2kc4sUD/e/yLceIYEU+O3qB73PHgk9BoG0fFDxfmNZt6 Wnkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=Ve2zD0Vq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id y11-20020a056a00190b00b006bebc50b5c0si5972508pfi.46.2023.11.05.03.35.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Nov 2023 03:35:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=Ve2zD0Vq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 5BEF8805794D; Sun, 5 Nov 2023 03:35:27 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230318AbjKELfP (ORCPT + 99 others); Sun, 5 Nov 2023 06:35:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229638AbjKELfJ (ORCPT ); Sun, 5 Nov 2023 06:35:09 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CC6DFA; Sun, 5 Nov 2023 03:35:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1699184102; bh=a+9ND8eF9nLxQ/1grgp4DdoijTDtNpAFxfKUQan+h7M=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Ve2zD0Vq063PtHS4Lxh8WD9DDxhauFe4gHtNgrPbeBRPljXDqfv9QoEwCmNhDHS5G lK+C2gEE8yzKYMICNcftDE47lMiW6NgIo7LWWV3anX8+XsFPaz8Sp1XhSo9XZsdW1H ii5nZg6Avq/KlnIbXcQNrDtFPCCNW2vdI4iLK6GI= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sun, 05 Nov 2023 12:34:59 +0100 Subject: [PATCH v2 2/6] tools/nolibc: move MIPS ABI validation into arch-mips.h MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20231105-nolibc-mips-be-v2-2-4ec993cb5407@weissschuh.net> References: <20231105-nolibc-mips-be-v2-0-4ec993cb5407@weissschuh.net> In-Reply-To: <20231105-nolibc-mips-be-v2-0-4ec993cb5407@weissschuh.net> To: Willy Tarreau , Shuah Khan Cc: Zhangjin Wu , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1699184102; l=1437; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=a+9ND8eF9nLxQ/1grgp4DdoijTDtNpAFxfKUQan+h7M=; b=eJbW210gN9ZiHm9562zmKqj43K5z7WF41/80UWLA634WixdMeLP8a2IsPlrCKGle0tYPZ1JqO GdIZVn6/JIlCIdaJL0d032Me/fqn7ESrBaPMTAywCsnqJU/ue/4XLzz X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Sun, 05 Nov 2023 03:35:27 -0800 (PST) When installing nolibc to a sysroot arch.h is not used so its ABI check is bypassed. This makes is possible to compile nolibc with a non O32 ABI which may build but can not run. Move the check into arch-mips.h so it will always be evaluated. Signed-off-by: Thomas Weißschuh Acked-by: Willy Tarreau --- tools/include/nolibc/arch-mips.h | 4 ++++ tools/include/nolibc/arch.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/include/nolibc/arch-mips.h b/tools/include/nolibc/arch-mips.h index 4ab6fa54beee..3a2c76716b83 100644 --- a/tools/include/nolibc/arch-mips.h +++ b/tools/include/nolibc/arch-mips.h @@ -10,6 +10,10 @@ #include "compiler.h" #include "crt.h" +#if !defined(_ABIO32) +#error Unsupported MIPS ABI +#endif + /* Syscalls for MIPS ABI O32 : * - WARNING! there's always a delayed slot! * - WARNING again, the syntax is different, registers take a '$' and numbers diff --git a/tools/include/nolibc/arch.h b/tools/include/nolibc/arch.h index 2f72ccac0378..c8f4e5d3add9 100644 --- a/tools/include/nolibc/arch.h +++ b/tools/include/nolibc/arch.h @@ -23,7 +23,7 @@ #include "arch-arm.h" #elif defined(__aarch64__) #include "arch-aarch64.h" -#elif defined(__mips__) && defined(_ABIO32) +#elif defined(__mips__) #include "arch-mips.h" #elif defined(__powerpc__) #include "arch-powerpc.h" -- 2.42.1