From patchwork Fri Sep 6 11:01:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Gomez via B4 Relay X-Patchwork-Id: 13793969 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7F2D0CE7B00 for ; Fri, 6 Sep 2024 11:10:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Reply-To:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To: References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version: Subject:Date:From:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=JSK1vc159ouMx8jma7FTOywyxuNG3lX2Mt5zNw9qUH0=; b=GRJgPLKyGhqJOF5d4zPlTGgCcV xO/ZIzvuWUDwWe/455mTUcmNYgowmRNOM8AgLgTgjKjdnEje3FSc5wjsyAY2kWky8+mDIJG0bUlx8 lCXthpZcfq1C3kndbFA9upMPuDjrBGUE8MrucXUZtOLJshdLUiGzVgoGhoQMEcmTVjUrUFMcF72+p V8y3NU1MuWY+Dr4uU6Lhq/9G1cgzELCfmWenD0Zp1VDsYCLv9TLjq4uzx4Y3aLe6avST1N2OhNCmx b8EUmtCgLoA7a5JGDgrHrOm4A6rVzM1AODCr0SaiMlm+zhRz8N2QYFaIjor8FLZJ0MMv0ALn1OaA7 /0a5mbLQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1smWrQ-0000000BuRA-0WOk; Fri, 06 Sep 2024 11:10:40 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1smWil-0000000BsLV-2npY for linux-arm-kernel@lists.infradead.org; Fri, 06 Sep 2024 11:01:47 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 107BA5C5AA5; Fri, 6 Sep 2024 11:01:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id C72E0C4AF55; Fri, 6 Sep 2024 11:01:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725620500; bh=XLEFleBi1dpezrCN0L236rCr8UnL4qKgiVJMT/gVdZo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=MRCQHnm7DALEbPuviJjS6zZwzYuQkJA9x6div0Fqn6MZQ06mWVihWBozJsiUvGcAc bJR6fiu5HZGRuaPcnQFN1Genvd4fYchjFtcLVcT23784VO+uuEQRHSxBO8fDEBnhHa RtINq3H7JdCCsRq12zSOhLMcz03TSXWgNcf/eqBmlmVUYzaKGBFIks6ZbLh2hADNAK cs6fBUh/DRTcvIwpUpNC0qgp0hKNjsyVf276mku+BTTSmdHMdImMz5MqqH2VlWkXWF KN9Rw33I1rINwOweAvT5vZKBA1rJiD1bAr2c5/O7k5JHtpE474mXigAC3KJkRU30W8 ouI72lr0Is0kw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id BBCBDCE7B00; Fri, 6 Sep 2024 11:01:40 +0000 (UTC) From: Daniel Gomez via B4 Relay Date: Fri, 06 Sep 2024 13:01:35 +0200 Subject: [PATCH v2 8/8] Documentation: add howto build in macos MIME-Version: 1.0 Message-Id: <20240906-macos-build-support-v2-8-06beff418848@samsung.com> References: <20240906-macos-build-support-v2-0-06beff418848@samsung.com> In-Reply-To: <20240906-macos-build-support-v2-0-06beff418848@samsung.com> To: Masahiro Yamada , Nathan Chancellor , Nicolas Schier , Lucas De Marchi , =?utf-8?q?Thomas_Hellstr=C3=B6?= =?utf-8?q?m?= , Rodrigo Vivi , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , William Hubbs , Chris Brannon , Kirk Reiser , Samuel Thibault , Paul Moore , Stephen Smalley , Ondrej Mosnacek , Catalin Marinas , Will Deacon , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Greg Kroah-Hartman , Jiri Slaby , Nick Desaulniers , Bill Wendling , Justin Stitt , Simona Vetter Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org, speakup@linux-speakup.org, selinux@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-serial@vger.kernel.org, llvm@lists.linux.dev, Finn Behrens , "Daniel Gomez (Samsung)" , gost.dev@samsung.com, Daniel Gomez X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1725620498; l=3295; i=da.gomez@samsung.com; s=20240621; h=from:subject:message-id; bh=d0Jf83ehBVzZd/6sDJAXa3klyzghUuKXMDUak+RyqVk=; b=HHVXUAKYpwg0oAq4Llj7Qicr7YTY8yOi8z/Ymdnnl/W0ykKZJbrrJ5EOU8LrjlVkcwlA+JR2O 50rFNWri/6gCAgythyvckdtJX73zV3YaMq3ZWFUY7eZPAc4+9wznTjX X-Developer-Key: i=da.gomez@samsung.com; a=ed25519; pk=BqYk31UHkmv0WZShES6pIZcdmPPGay5LbzifAdZ2Ia4= X-Endpoint-Received: by B4 Relay for da.gomez@samsung.com/20240621 with auth_id=175 X-Original-From: Daniel Gomez X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240906_040143_897337_4369A5DB X-CRM114-Status: GOOD ( 14.35 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: da.gomez@samsung.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Daniel Gomez Add documentation under kbuild/llvm to inform about the experimental support for building the Linux kernel in macOS hosts environments. Signed-off-by: Daniel Gomez --- Documentation/kbuild/llvm.rst | 78 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/Documentation/kbuild/llvm.rst b/Documentation/kbuild/llvm.rst index 6dc66b4f31a7..de3bde925793 100644 --- a/Documentation/kbuild/llvm.rst +++ b/Documentation/kbuild/llvm.rst @@ -186,6 +186,84 @@ yet. Bug reports are always welcome at the issue tracker below! - Supported - ``LLVM=1`` +Experimental Build in macOS +--------------------------- + +Building on macOS with LLVM is experimental. This section provides steps to +install dependencies via Homebrew, set up the environment, and start the build +process. + +1. **Create a Case-Sensitive Volume** + + For fetching and building the project, you need a case-sensitive volume. Use the following + command to create one: + + .. code-block:: shell + + diskutil apfs addVolume /dev/disk "Case-sensitive APFS" linux + + Replace `/dev/disk` with the appropriate disk identifier. + +2. **Install Build Dependencies** + +Use Homebrew to install the required build dependencies. + +- **Core Utilities**: `coreutils`, `findutils`, `gnu-sed`, `gnu-tar`, `grep`, + `llvm`, `make`, and `pkg-config`. + + .. code-block:: shell + + brew install coreutils findutils gnu-sed gnu-tar grep llvm make pkg-config + +- **Bee Headers**: Install byteswap, elf and endian headers using the + `Bee Headers Project `_. + + .. code-block:: shell + + brew tap bee-headers/bee-headers + brew install bee-headers/bee-headers/bee-headers + + After installation, verify the `CFLAGS` with `pkg-config`: + + .. code-block:: shell + + pkg-config --cflags bee-headers + -I/opt/homebrew/Cellar/bee-headers/0.1/include + +3. **Configure the PATH** + + Include all the required GNU tools and LLVM in your `PATH`. This ensures that + the necessary tools are available during the build process. + + .. code-block:: shell + + PATH="/opt/homebrew/opt/coreutils/libexec/gnubin:$PATH" + PATH="/opt/homebrew/opt/findutils/libexec/gnubin:$PATH" + PATH="/opt/homebrew/opt/gnu-sed/libexec/gnubin:$PATH" + PATH="/opt/homebrew/opt/gnu-tar/libexec/gnubin:$PATH" + PATH="/opt/homebrew/opt/grep/libexec/gnubin:$PATH" + PATH="/opt/homebrew/opt/make/libexec/gnubin:$PATH" + PATH="/opt/homebrew/opt/llvm/bin:$PATH" + +Building the Project +-------------------- + +Once the environment is set up, you can start the build process using LLVM. Run +the following commands to initiate the build: + +.. code-block:: shell + + make LLVM=1 allyesconfig + make LLVM=1 -j$(nproc) + +Supported in macOS +~~~~~~~~~~~~~~~~~~ + +At the moment, only arm64 is supported and tested with `allyesconfig` Makefile +configuration target. Other Kconfig options not included in `allyesconfig` +target and architectures may be supported as well as support in macOS is based +on LLVM effort and maintenance. + Getting Help ------------