From patchwork Tue Jan 25 13:19:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Juraj_Linke=C5=A1?= X-Patchwork-Id: 106518 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A48C0A00C2; Tue, 25 Jan 2022 14:20:13 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 792F8429DB; Tue, 25 Jan 2022 14:20:08 +0100 (CET) Received: from lb.pantheon.sk (lb.pantheon.sk [46.229.239.20]) by mails.dpdk.org (Postfix) with ESMTP id A2E07426E4 for ; Tue, 25 Jan 2022 14:20:06 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by lb.pantheon.sk (Postfix) with ESMTP id 9467D13C695; Tue, 25 Jan 2022 14:20:05 +0100 (CET) X-Virus-Scanned: amavisd-new at siecit.sk Received: from lb.pantheon.sk ([127.0.0.1]) by localhost (lb.pantheon.sk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1sLuduw1nwTT; Tue, 25 Jan 2022 14:20:03 +0100 (CET) Received: from service-node1.lab.pantheon.local (unknown [46.229.239.141]) by lb.pantheon.sk (Postfix) with ESMTP id 6562213C67E; Tue, 25 Jan 2022 14:20:03 +0100 (CET) From: =?utf-8?q?Juraj_Linke=C5=A1?= To: thomas@monjalon.net, david.marchand@redhat.com, Honnappa.Nagarahalli@arm.com, Ruifeng.Wang@arm.com, ferruh.yigit@intel.com, jerinjacobk@gmail.com Cc: dev@dpdk.org, =?utf-8?q?Juraj_Linke=C5=A1?= Subject: [PATCH v3 1/4] doc: arm64 cross build CFLAGS/LDFLAGS alternatives Date: Tue, 25 Jan 2022 14:19:59 +0100 Message-Id: <1643116802-26466-2-git-send-email-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1643116802-26466-1-git-send-email-juraj.linkes@pantheon.tech> References: <1638875109-5544-1-git-send-email-juraj.linkes@pantheon.tech> <1643116802-26466-1-git-send-email-juraj.linkes@pantheon.tech> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Remove CFLAGS and LDFLAGS since Meson doesn't support them well enough. Add Meson alternatives: -Dc_args and -Dc_link_args on the command line and in cross files. Signed-off-by: Juraj Linkeš Acked-by: Ruifeng Wang --- .../linux_gsg/cross_build_dpdk_for_arm64.rst | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst index d59af58235..d6131055c5 100644 --- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst +++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst @@ -98,10 +98,6 @@ For aarch32:: Augment the GNU toolchain with NUMA support ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. note:: - - This way is optional, an alternative is to use extra CFLAGS and LDFLAGS. - Copy the NUMA header files and lib to the cross compiler's directories: .. code-block:: console @@ -110,6 +106,27 @@ Copy the NUMA header files and lib to the cross compiler's directories: cp /lib/libnuma.a /gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu/lib/gcc/aarch64-none-linux-gnu/9.2.1/ cp /lib/libnuma.so /gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu/lib/gcc/aarch64-none-linux-gnu/9.2.1/ +.. note:: + + Using LDFLAGS and CFLAGS is not a viable alternative to copying the files. + The Meson docs say it is not recommended, as there are many caveats to their + use with Meson, especially when rebuilding the project. A viable alternative + would be to use the ``c_args`` and ``c_link_args`` options with Meson 0.51.0 + and higher: + + .. code-block:: console + + -Dc_args=-I/include -Dc_link_args=-L/lib + +For Meson versions lower than 0.51.0, the ``c_args`` and ``c_link_args`` +options don't apply to cross compilation. However, the compiler/linker flags +may be added to cross files under [properties]: + +.. code-block:: console + + c_args = ['-I/include'] + c_link_args = ['-L/lib'] + Cross Compiling DPDK with GNU toolchain using Meson ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From patchwork Tue Jan 25 13:20:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Juraj_Linke=C5=A1?= X-Patchwork-Id: 106519 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 70C9AA00C2; Tue, 25 Jan 2022 14:20:19 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 79414429E1; Tue, 25 Jan 2022 14:20:10 +0100 (CET) Received: from lb.pantheon.sk (lb.pantheon.sk [46.229.239.20]) by mails.dpdk.org (Postfix) with ESMTP id D0D34429D6 for ; Tue, 25 Jan 2022 14:20:07 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by lb.pantheon.sk (Postfix) with ESMTP id 23AFB13C67E; Tue, 25 Jan 2022 14:20:07 +0100 (CET) X-Virus-Scanned: amavisd-new at siecit.sk Received: from lb.pantheon.sk ([127.0.0.1]) by localhost (lb.pantheon.sk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WOyYjh7mC3l8; Tue, 25 Jan 2022 14:20:05 +0100 (CET) Received: from service-node1.lab.pantheon.local (unknown [46.229.239.141]) by lb.pantheon.sk (Postfix) with ESMTP id D741B13C685; Tue, 25 Jan 2022 14:20:03 +0100 (CET) From: =?utf-8?q?Juraj_Linke=C5=A1?= To: thomas@monjalon.net, david.marchand@redhat.com, Honnappa.Nagarahalli@arm.com, Ruifeng.Wang@arm.com, ferruh.yigit@intel.com, jerinjacobk@gmail.com Cc: dev@dpdk.org, =?utf-8?q?Juraj_Linke=C5=A1?= Subject: [PATCH v3 2/4] doc: arm64 cross build binary names update Date: Tue, 25 Jan 2022 14:20:00 +0100 Message-Id: <1643116802-26466-3-git-send-email-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1643116802-26466-1-git-send-email-juraj.linkes@pantheon.tech> References: <1638875109-5544-1-git-send-email-juraj.linkes@pantheon.tech> <1643116802-26466-1-git-send-email-juraj.linkes@pantheon.tech> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The newer versions have an extra -none- in the name. Signed-off-by: Juraj Linkeš Acked-by: Ruifeng Wang --- doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst index d6131055c5..d53407c679 100644 --- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst +++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst @@ -130,6 +130,12 @@ may be added to cross files under [properties]: Cross Compiling DPDK with GNU toolchain using Meson ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.. note:: + + The names of gcc binaries in cross files differ from the downloaded + ones, which have an extra "-none-" in their name. Please modify the cross + file binaries accordingly when using the downloaded cross compilers. + To cross-compile DPDK on a desired target machine we can use the following command:: @@ -137,12 +143,13 @@ command:: ninja -C cross-build For example if the target machine is aarch64 we can use the following -command:: +command, provided the cross file has been modified accordingly:: meson aarch64-build-gcc --cross-file config/arm/arm64_armv8_linux_gcc ninja -C aarch64-build-gcc -If the target machine is aarch32 we can use the following command:: +If the target machine is aarch32 we can use the following command, provided +the cross file has been modified accordingly:: meson aarch32-build --cross-file config/arm/arm32_armv8_linux_gcc ninja -C aarch32-build From patchwork Tue Jan 25 13:20:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Juraj_Linke=C5=A1?= X-Patchwork-Id: 106520 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 14F9CA00C2; Tue, 25 Jan 2022 14:20:25 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 69645429E7; Tue, 25 Jan 2022 14:20:11 +0100 (CET) Received: from lb.pantheon.sk (lb.pantheon.sk [46.229.239.20]) by mails.dpdk.org (Postfix) with ESMTP id 5E702429D8 for ; Tue, 25 Jan 2022 14:20:08 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by lb.pantheon.sk (Postfix) with ESMTP id 9FE2C13C67D; Tue, 25 Jan 2022 14:20:07 +0100 (CET) X-Virus-Scanned: amavisd-new at siecit.sk Received: from lb.pantheon.sk ([127.0.0.1]) by localhost (lb.pantheon.sk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Nm5VXtDGBLTP; Tue, 25 Jan 2022 14:20:06 +0100 (CET) Received: from service-node1.lab.pantheon.local (unknown [46.229.239.141]) by lb.pantheon.sk (Postfix) with ESMTP id 515C213C692; Tue, 25 Jan 2022 14:20:04 +0100 (CET) From: =?utf-8?q?Juraj_Linke=C5=A1?= To: thomas@monjalon.net, david.marchand@redhat.com, Honnappa.Nagarahalli@arm.com, Ruifeng.Wang@arm.com, ferruh.yigit@intel.com, jerinjacobk@gmail.com Cc: dev@dpdk.org, =?utf-8?q?Juraj_Linke=C5=A1?= Subject: [PATCH v3 3/4] doc: arm64 cross build numactl compilers Date: Tue, 25 Jan 2022 14:20:01 +0100 Message-Id: <1643116802-26466-4-git-send-email-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1643116802-26466-1-git-send-email-juraj.linkes@pantheon.tech> References: <1638875109-5544-1-git-send-email-juraj.linkes@pantheon.tech> <1643116802-26466-1-git-send-email-juraj.linkes@pantheon.tech> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Numactl cross compilation doesn't work with clang, remove it and fix the gcc cross compiler executable name. Signed-off-by: Juraj Linkeš Acked-by: Ruifeng Wang --- doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst index d53407c679..045cc05c65 100644 --- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst +++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst @@ -35,13 +35,14 @@ NUMA is required by most modern machines, not needed for non-NUMA architectures. git checkout v2.0.13 -b v2.0.13 ./autogen.sh autoconf -i - ./configure --host=aarch64-linux-gnu CC= --prefix= + ./configure --host=aarch64-linux-gnu CC=aarch64-none-linux-gnu-gcc --prefix= make install .. note:: - The compiler above can be either aarch64-linux-gnu-gcc or clang. - See below for information on how to get specific compilers. + The compiler is aarch64-none-linux-gnu-gcc if you download gcc using the + below guide. If you're using a different compiler, make sure you're using + the proper executable name. The numa header files and lib file is generated in the include and lib folder respectively under ````. From patchwork Tue Jan 25 13:20:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Juraj_Linke=C5=A1?= X-Patchwork-Id: 106521 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9D26DA00C2; Tue, 25 Jan 2022 14:20:30 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 56170429EE; Tue, 25 Jan 2022 14:20:12 +0100 (CET) Received: from lb.pantheon.sk (lb.pantheon.sk [46.229.239.20]) by mails.dpdk.org (Postfix) with ESMTP id 8B67F429E4 for ; Tue, 25 Jan 2022 14:20:10 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by lb.pantheon.sk (Postfix) with ESMTP id D9D9213C685; Tue, 25 Jan 2022 14:20:09 +0100 (CET) X-Virus-Scanned: amavisd-new at siecit.sk Received: from lb.pantheon.sk ([127.0.0.1]) by localhost (lb.pantheon.sk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WT8As4MPyP7Y; Tue, 25 Jan 2022 14:20:07 +0100 (CET) Received: from service-node1.lab.pantheon.local (unknown [46.229.239.141]) by lb.pantheon.sk (Postfix) with ESMTP id DB21B13C693; Tue, 25 Jan 2022 14:20:04 +0100 (CET) From: =?utf-8?q?Juraj_Linke=C5=A1?= To: thomas@monjalon.net, david.marchand@redhat.com, Honnappa.Nagarahalli@arm.com, Ruifeng.Wang@arm.com, ferruh.yigit@intel.com, jerinjacobk@gmail.com Cc: dev@dpdk.org, =?utf-8?q?Juraj_Linke=C5=A1?= Subject: [PATCH v3 4/4] doc: add an example arm64 cross file Date: Tue, 25 Jan 2022 14:20:02 +0100 Message-Id: <1643116802-26466-5-git-send-email-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1643116802-26466-1-git-send-email-juraj.linkes@pantheon.tech> References: <1638875109-5544-1-git-send-email-juraj.linkes@pantheon.tech> <1643116802-26466-1-git-send-email-juraj.linkes@pantheon.tech> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The docs mention modifications and additions to the cross file, but there is no demonstration of how those should look like. Signed-off-by: Juraj Linkeš Acked-by: Ruifeng Wang --- .../linux_gsg/cross_build_dpdk_for_arm64.rst | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst index 045cc05c65..f491725948 100644 --- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst +++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst @@ -137,6 +137,32 @@ Cross Compiling DPDK with GNU toolchain using Meson ones, which have an extra "-none-" in their name. Please modify the cross file binaries accordingly when using the downloaded cross compilers. + An example cross file with modified names and added numa paths would look + like this: + + .. code-block:: console + + [binaries] + c = 'aarch64-none-linux-gnu-gcc' + cpp = 'aarch64-none-linux-gnu-cpp' + ar = 'aarch64-none-linux-gnu-gcc-ar' + strip = 'aarch64-none-linux-gnu-strip' + pkgconfig = 'aarch64-linux-gnu-pkg-config' # the downloaded binaries + # don't contain a pkgconfig binary, so it's not modified + pcap-config = '' + + [host_machine] + system = 'linux' + cpu_family = 'aarch64' + cpu = 'armv8-a' + endian = 'little' + + [properties] + # Generate binaries that are portable across all Armv8 machines + platform = 'generic' + c_args = ['-I/include'] # replace + c_link_args = ['-L/lib'] # with your path + To cross-compile DPDK on a desired target machine we can use the following command::