From patchwork Sat Sep 5 08:58:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1357944 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gmx.de Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=gmx.net header.i=@gmx.net header.a=rsa-sha256 header.s=badeba3b8450 header.b=dA+o8M84; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Bk7l72L52z9sTH for ; Sat, 5 Sep 2020 18:59:12 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C152682294; Sat, 5 Sep 2020 10:59:05 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; secure) header.d=gmx.net header.i=@gmx.net header.b="dA+o8M84"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1B825822AF; Sat, 5 Sep 2020 10:59:04 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FROM,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A36B082286 for ; Sat, 5 Sep 2020 10:59:00 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=xypron.glpk@gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1599296339; bh=AEiudZC2qpXWYXmxh+fXdiyso+2/LE/+wgBK8SkPhog=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=dA+o8M84I8GXWbxIpf6tOdpKZ3iI5JBe9EbFPSfwOSOpPL/qaWvevBfNCfuJ6TM0N YUNlkkCr/p9QqUo5rzcdMcQ4IqTuFzRKMYDogMmtt7nMCUhl0kbIF2PkMP0aEgj7Qf ZiCA92+b/cHMn76hJ25Kq3eJ+FV7ZvzSJJrGxnVM= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from LT02.fritz.box ([178.202.41.107]) by mail.gmx.com (mrgmx105 [212.227.17.174]) with ESMTPSA (Nemesis) id 1MgesG-1kmiOF10hw-00h60L; Sat, 05 Sep 2020 10:58:59 +0200 From: Heinrich Schuchardt To: Tom Rini Cc: Bin Meng , u-boot@lists.denx.de, Heinrich Schuchardt Subject: [PATCH 2/2] doc: describe building with GCC Date: Sat, 5 Sep 2020 10:58:53 +0200 Message-Id: <20200905085853.29081-3-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200905085853.29081-1-xypron.glpk@gmx.de> References: <20200905085853.29081-1-xypron.glpk@gmx.de> MIME-Version: 1.0 X-Provags-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VOLofPed8/AdhivcZE BK9Fg7/o9erVLUhFQdU7mQWmyS4ZL0x5kgVW+7XreJ4BGnSlsiCcPwajeH3+KiSbOaUXxZ5za Rrd0RX/PFzna6F/im4Tk3s5J4wIxyKvrF4m5G8/1fTNjo0KkAuBhKRrygRI9O/N4xN0Py4rn1 D9l/YlPQwm1vBDlyHPC1gOlcwMVaLxTkV4g7Sm7+wK1SSXy8j/1rxyYwZlakPIoJZdu5Xs5Hz cg+pAVL/AlhGYgBIFeNgFUdeNAwgtuOHsy3gxV4nfEGXCJ4g+WZfYlnCCYLXqslsou9tCcv1t v4DEGAgHfOiSP2DN3efZQx73fZ1b50rkktxnRuPEYrzjRnEDTrQ8xsHGDM3e9ubtX77HkGnt1 i4c8mFtcCQoRhWstVKnY7ynLY/se/zQxEbqTsOeIi1RX6dstUdf8v23rTumHImJejX4GFC4oM PY3LufiStw28TCgJ9W7rzqf1Xq5pn+fOmYB4qOA== X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean Provide a description of the U-Boot build process with GCC in the HTML documentation. Signed-off-by: Heinrich Schuchardt --- doc/build/gcc.rst | 119 ++++++++++++++++++++++++++++++++++++++++++++ doc/build/index.rst | 1 + 2 files changed, 120 insertions(+) create mode 100644 doc/build/gcc.rst -- 2.28.0 diff --git a/doc/build/gcc.rst b/doc/build/gcc.rst new file mode 100644 index 0000000000..fcb0b1ffb3 --- /dev/null +++ b/doc/build/gcc.rst @@ -0,0 +1,119 @@ +Building with GCC +================= + +Dependencies +------------ + +For building U-Boot you need a GCC compiler for your host platform. If you +are not building on the target platform you further need a GCC cross compiler. + +Debian based +~~~~~~~~~~~~ + +On Debian based systems the cross compiler packages are named +gcc--linux-gnu. + +You could install GCC and the GCC cross compiler for the ARMv8 architecture with + +.. code-block:: bash + + sudo apt-get gcc gcc-aarch64-linux-gnu + +Depending on the build targets further packages maybe needed + +.. code-block:: bash + + sudo apt-get install bc bison build-essential coccinelle \ + device-tree-compiler dfu-util efitools flex gdisk liblz4-tool \ + libguestfs-tools libncurses-dev libpython3-dev libsdl2-dev libssl-dev \ + lzma-alone openssl python3 python3-coverage python3-pyelftools \ + python3-pytest python3-sphinxcontrib.apidoc python3-sphinx-rtd-theme swig + +Prerequisites +------------- + +For some boards you have to build prerequisite files before you can build +U-Boot, e.g. for the some boards you will need to build the ARM Trusted Firmware +beforehand. Please, refer to the board specific documentation +:doc:`../board/index`. + +Configuration +------------- + +Directory configs/ contains the template configuration files for the maintained +boards following the naming scheme:: + + _defconfig + +These files have been stripped of default settings. So you cannot use them +directly. Instead their name serves as a make target to generate the actual +configuration file .config. For instance the configuration template for the +Odroid C2 board is called odroid-c2_defconfig. The corresponding .config file +is generated by + +.. code-block:: bash + + make odroid-c2_defconfig + +You can adjust the configuration using + +.. code-block:: bash + + make menuconfig + +Building +-------- + +When cross compiling you will have to specify the prefix of the cross-compiler. +You can either specify the value of the CROSS_COMPILE variable on the make +command line or export it beforehand. + +.. code-block:: bash + + CROSS_COMPILE= make + +Assuming cross compiling on Debian for ARMv8 this would be + +.. code-block:: bash + + CROSS_COMPILE=aarch64-linux-gnu- make + +Build parameters +~~~~~~~~~~~~~~~~ + +A list of available parameters for the make command can be obtained via + +.. code-block:: bash + + make help + +You can speed up compilation by parallelization using the -j parameter, e.g. + +.. code-block:: bash + + CROSS_COMPILE=aarch64-linux-gnu- make -j$(nproc) + +Further important build parameters are + +* O= - generate all output files in directory , including .config +* V=1 - verbose build + +Other build targets +~~~~~~~~~~~~~~~~~~~ + +A list of all make targets can be obtained via + +.. code-block:: bash + + make help + +Important ones are + +* clean - remove most generated files but keep the configuration +* mrproper - remove all generated files + config + various backup files + +Installation +------------ + +The process for installing U-Boot on the target device is device specific. +Please, refer to the board specific documentation :doc:`../board/index`. diff --git a/doc/build/index.rst b/doc/build/index.rst index 5051a97e70..5f90f95aca 100644 --- a/doc/build/index.rst +++ b/doc/build/index.rst @@ -7,5 +7,6 @@ Build U-Boot :maxdepth: 2 source + gcc clang tools