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: 13793937 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 73BC6CE7B00 for ; Fri, 6 Sep 2024 11:01:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 066A710EA25; Fri, 6 Sep 2024 11:01:50 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="MRCQHnm7"; dkim-atps=neutral Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by gabe.freedesktop.org (Postfix) with ESMTPS id 156A910EA11; Fri, 6 Sep 2024 11:01:43 +0000 (UTC) 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-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: da.gomez@samsung.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 ------------