From patchwork Tue May 18 11:36:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas De Schampheleire X-Patchwork-Id: 1480202 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=smtp2.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=UgoP+9AN; dkim-atps=neutral Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (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 4FkvB9217lz9sW8 for ; Tue, 18 May 2021 21:37:37 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id B1531400AE; Tue, 18 May 2021 11:37:35 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4yjueZ66Noaa; Tue, 18 May 2021 11:37:31 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id E8B53401AD; Tue, 18 May 2021 11:37:30 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 9A5BE1BF397 for ; Tue, 18 May 2021 11:37:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 96F9060B22 for ; Tue, 18 May 2021 11:37:06 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp3.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lR62fnqlzSac for ; Tue, 18 May 2021 11:37:02 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by smtp3.osuosl.org (Postfix) with ESMTPS id 1586760B26 for ; Tue, 18 May 2021 11:37:01 +0000 (UTC) Received: by mail-ed1-x532.google.com with SMTP id w12so2979627edx.1 for ; Tue, 18 May 2021 04:37:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+NMKy7Qv5UYmRoxuDAMIxd0YqiXSzeqU6vOu5I5erS8=; b=UgoP+9ANH1bCqEDWa8WFbHJ7PZEP5fWUJMu/vfHCTUWcKVSbSCaALPLiEAsVprZsEe 3k8s/7oHDrpABjkk3cOyH/qybK+1YMfvM//tEdawTZpC7uabX+iDTZFYg5eytjArODkc q6LvabSHyqOICx3xtrbdziv+jIahfVrizCocV3xRhNgP0lnwZEJ8HyUjypDkNisYEANh YGpenLkaEOEt2VQ86blmcSMsIz+UmCkQ+TT9XUPR7lrRulALYVYn0JLLvubyNTAxkTFn 6HU60GWV/4A4TbSy0tEfhd0D/9Kg92chsu0ar1h4NcowWJY3mnNEYtgAS+J+P3k4EIpb le7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+NMKy7Qv5UYmRoxuDAMIxd0YqiXSzeqU6vOu5I5erS8=; b=mkaWKOwVI7SnheBzJaDa4WZORtS0M7Qkwv+2iOQdQ16IHe/Jm+B1+/mMf2MZgXa8LV jT7mjWjBwVsgTOwVDbKs8hDlZXEWqzXWqNqbVYkYdESxZ09PeYBWKVu+km0DQPw1c576 7MYSSku2wn8uOmB4ZaNRwb6dEXUwNXvZ7D54BpSubYuTNZFvzyLOP606wJUPma+43CUr nDrq/xiv8glU4AVFgTo5gfAdARdA5aL07zzaKJ0BDWWZk2JxsSbQBVKR0KJh3aX8+xAR rsqvesev+6v5pZzUj5t9B9A2530cATX3QcNjxGk3sK5Cwx9nkc6EMBTmbkSImE2GdIFH TJ7g== X-Gm-Message-State: AOAM533jW2stJqpoXqzXppIB/ZwDyyzgGEUE6W3CXQCRLxQWuAMv6A3a 9n1cWDTPy+iLLEL+1SdM+777OO20otVFAWBIH2w= X-Google-Smtp-Source: ABdhPJy7D5fS24+Y14noU3ACzYONxcVfL8YAb27N5UjcPGRnfhDbjwxLEel4rgQJxt76L1Szj4gZnA== X-Received: by 2002:aa7:cd16:: with SMTP id b22mr6307139edw.335.1621337820313; Tue, 18 May 2021 04:37:00 -0700 (PDT) Received: from localhost (ptr-5gw9txf6g5tndjqqqz.18120a2.ip6.access.telenet.be. [2a02:1810:510:3800:1b15:18e4:57d1:eb]) by smtp.gmail.com with ESMTPSA id i2sm6396831edc.96.2021.05.18.04.36.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 May 2021 04:36:59 -0700 (PDT) From: Thomas De Schampheleire To: buildroot@buildroot.org Date: Tue, 18 May 2021 13:36:48 +0200 Message-Id: <20210518113652.29609-2-patrickdepinguin@gmail.com> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210518113652.29609-1-patrickdepinguin@gmail.com> References: <20210518113652.29609-1-patrickdepinguin@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/4] arch: move definition of KERNEL_ARCH to Config.in. files X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ARC Maintainers , Guo Ren , Mark Corbin , Alexander Egorenkov , Nylon Chen , Thomas Petazzoni , Spenser Gilliland , Cyril Bur , Thomas De Schampheleire Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Thomas De Schampheleire Similar to other arch-specific strings, the 'KERNEL_ARCH' variable can be determined from Config.in. files. Besides aligning with similar strings, this also means simplification: the big 'sed' covers several architectures not even supported by Buildroot. Signed-off-by: Thomas De Schampheleire Reviewed-by: Romain Naour --- Makefile | 17 +---------------- arch/Config.in | 3 +++ arch/Config.in.arc | 3 +++ arch/Config.in.arm | 4 ++++ arch/Config.in.csky | 3 +++ arch/Config.in.m68k | 3 +++ arch/Config.in.microblaze | 3 +++ arch/Config.in.mips | 3 +++ arch/Config.in.nds32 | 3 +++ arch/Config.in.nios2 | 3 +++ arch/Config.in.or1k | 3 +++ arch/Config.in.powerpc | 3 +++ arch/Config.in.riscv | 3 +++ arch/Config.in.s390x | 3 +++ arch/Config.in.sh | 3 +++ arch/Config.in.sparc | 4 ++++ arch/Config.in.x86 | 4 ++++ arch/Config.in.xtensa | 3 +++ 18 files changed, 55 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index c3305f46e9..7b6998fde6 100644 --- a/Makefile +++ b/Makefile @@ -433,22 +433,7 @@ QUIET := $(if $(findstring s,$(filter-out --%,$(MAKEFLAGS))),-q) # Strip off the annoying quoting ARCH := $(call qstrip,$(BR2_ARCH)) - -KERNEL_ARCH := $(shell echo "$(ARCH)" | sed -e "s/-.*//" \ - -e s/i.86/i386/ -e s/sun4u/sparc64/ \ - -e s/arcle/arc/ \ - -e s/arceb/arc/ \ - -e s/arm.*/arm/ -e s/sa110/arm/ \ - -e s/aarch64.*/arm64/ \ - -e s/nds32.*/nds32/ \ - -e s/or1k/openrisc/ \ - -e s/parisc64/parisc/ \ - -e s/powerpc64.*/powerpc/ \ - -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \ - -e s/riscv.*/riscv/ \ - -e s/sh.*/sh/ \ - -e s/s390x/s390/ \ - -e s/microblazeel/microblaze/) +KERNEL_ARCH := $(call qstrip,$(BR2_KERNEL_ARCH)) ZCAT := $(call qstrip,$(BR2_ZCAT)) BZCAT := $(call qstrip,$(BR2_BZCAT)) diff --git a/arch/Config.in b/arch/Config.in index 155403c363..7575acf48c 100644 --- a/arch/Config.in +++ b/arch/Config.in @@ -326,6 +326,9 @@ config BR2_ARCH_NEEDS_GCC_AT_LEAST_10 config BR2_ARCH string +config BR2_KERNEL_ARCH + string + config BR2_ENDIAN string diff --git a/arch/Config.in.arc b/arch/Config.in.arc index f7a6d920b5..cc55c9e68f 100644 --- a/arch/Config.in.arc +++ b/arch/Config.in.arc @@ -62,6 +62,9 @@ config BR2_ARCH default "arc" if BR2_arcle default "arceb" if BR2_arceb +config BR2_KERNEL_ARCH + default "arc" + config BR2_arc bool default y if BR2_arcle || BR2_arceb diff --git a/arch/Config.in.arm b/arch/Config.in.arm index 4c0910e4f8..0f50512fad 100644 --- a/arch/Config.in.arm +++ b/arch/Config.in.arm @@ -822,6 +822,10 @@ config BR2_ARCH default "aarch64" if BR2_aarch64 default "aarch64_be" if BR2_aarch64_be +config BR2_KERNEL_ARCH + default "arm" if BR2_arm || BR2_armeb + default "arm64" if BR2_aarch64 || BR2_aarch64_be + config BR2_ENDIAN default "LITTLE" if (BR2_arm || BR2_aarch64) default "BIG" if (BR2_armeb || BR2_aarch64_be) diff --git a/arch/Config.in.csky b/arch/Config.in.csky index 7e2029f759..df9e7ab75b 100644 --- a/arch/Config.in.csky +++ b/arch/Config.in.csky @@ -39,6 +39,9 @@ config BR2_GCC_TARGET_FLOAT_ABI config BR2_ARCH default "csky" +config BR2_KERNEL_ARCH + default "csky" + config BR2_ENDIAN default "LITTLE" diff --git a/arch/Config.in.m68k b/arch/Config.in.m68k index 275f47f1d3..7f3aec7232 100644 --- a/arch/Config.in.m68k +++ b/arch/Config.in.m68k @@ -1,6 +1,9 @@ config BR2_ARCH default "m68k" if BR2_m68k +config BR2_KERNEL_ARCH + default "m68k" + config BR2_ENDIAN default "BIG" diff --git a/arch/Config.in.microblaze b/arch/Config.in.microblaze index 5fe2906d40..52aa252a2c 100644 --- a/arch/Config.in.microblaze +++ b/arch/Config.in.microblaze @@ -2,6 +2,9 @@ config BR2_ARCH default "microblazeel" if BR2_microblazeel default "microblaze" if BR2_microblazebe +config BR2_KERNEL_ARCH + default "microblaze" + config BR2_ENDIAN default "LITTLE" if BR2_microblazeel default "BIG" if BR2_microblazebe diff --git a/arch/Config.in.mips b/arch/Config.in.mips index 619456c2d5..b4923f8484 100644 --- a/arch/Config.in.mips +++ b/arch/Config.in.mips @@ -235,6 +235,9 @@ config BR2_ARCH default "mips64" if BR2_mips64 default "mips64el" if BR2_mips64el +config BR2_KERNEL_ARCH + default "mips" + config BR2_ENDIAN default "LITTLE" if BR2_mipsel || BR2_mips64el default "BIG" if BR2_mips || BR2_mips64 diff --git a/arch/Config.in.nds32 b/arch/Config.in.nds32 index 322ff49f2e..61fc346260 100644 --- a/arch/Config.in.nds32 +++ b/arch/Config.in.nds32 @@ -1,6 +1,9 @@ config BR2_ARCH default "nds32le" +config BR2_KERNEL_ARCH + default "nds32" + config BR2_GCC_TARGET_ARCH default "v3" diff --git a/arch/Config.in.nios2 b/arch/Config.in.nios2 index aae435fa17..c77b1a1c59 100644 --- a/arch/Config.in.nios2 +++ b/arch/Config.in.nios2 @@ -1,6 +1,9 @@ config BR2_ARCH default "nios2" +config BR2_KERNEL_ARCH + default "nios2" + config BR2_ENDIAN default "LITTLE" diff --git a/arch/Config.in.or1k b/arch/Config.in.or1k index abdf498fb8..ef1bded453 100644 --- a/arch/Config.in.or1k +++ b/arch/Config.in.or1k @@ -1,6 +1,9 @@ config BR2_ARCH default "or1k" +config BR2_KERNEL_ARCH + default "openrisc" + config BR2_ENDIAN default "BIG" diff --git a/arch/Config.in.powerpc b/arch/Config.in.powerpc index ba56c9c721..33b2471cf9 100644 --- a/arch/Config.in.powerpc +++ b/arch/Config.in.powerpc @@ -157,6 +157,9 @@ config BR2_ARCH default "powerpc64" if BR2_powerpc64 default "powerpc64le" if BR2_powerpc64le +config BR2_KERNEL_ARCH + default "powerpc" + config BR2_ENDIAN default "BIG" if BR2_powerpc || BR2_powerpc64 default "LITTLE" if BR2_powerpc64le diff --git a/arch/Config.in.riscv b/arch/Config.in.riscv index 1fc20e5de7..e8b6ddc833 100644 --- a/arch/Config.in.riscv +++ b/arch/Config.in.riscv @@ -116,6 +116,9 @@ config BR2_ARCH default "riscv32" if !BR2_ARCH_IS_64 default "riscv64" if BR2_ARCH_IS_64 +config BR2_KERNEL_ARCH + default "riscv" + config BR2_ENDIAN default "LITTLE" diff --git a/arch/Config.in.s390x b/arch/Config.in.s390x index ad866b421e..bf4b70f957 100644 --- a/arch/Config.in.s390x +++ b/arch/Config.in.s390x @@ -17,6 +17,9 @@ endchoice config BR2_ARCH default "s390x" if BR2_s390x +config BR2_KERNEL_ARCH + default "s390" + config BR2_ENDIAN default "BIG" diff --git a/arch/Config.in.sh b/arch/Config.in.sh index b5cce18e22..fde42dfce2 100644 --- a/arch/Config.in.sh +++ b/arch/Config.in.sh @@ -24,6 +24,9 @@ config BR2_ARCH default "sh4a" if BR2_sh4a default "sh4aeb" if BR2_sh4aeb +config BR2_KERNEL_ARCH + default "sh" + config BR2_ENDIAN default "LITTLE" if BR2_sh4 || BR2_sh4a default "BIG" if BR2_sh2a || BR2_sh4eb || BR2_sh4aeb diff --git a/arch/Config.in.sparc b/arch/Config.in.sparc index 4c4dc61745..b91df6892b 100644 --- a/arch/Config.in.sparc +++ b/arch/Config.in.sparc @@ -21,6 +21,10 @@ config BR2_ARCH default "sparc" if BR2_sparc default "sparc64" if BR2_sparc64 +config BR2_KERNEL_ARCH + default "sparc" if BR2_sparc + default "sparc64" if BR2_sparc64 + config BR2_ENDIAN default "BIG" diff --git a/arch/Config.in.x86 b/arch/Config.in.x86 index 7aae3cafb7..88ac9cdc44 100644 --- a/arch/Config.in.x86 +++ b/arch/Config.in.x86 @@ -266,6 +266,10 @@ config BR2_ARCH default "i686" if BR2_x86_athlon_4 default "x86_64" if BR2_x86_64 +config BR2_KERNEL_ARCH + default "i386" if !BR2_x86_64 + default "x86_64" if BR2_x86_64 + config BR2_ENDIAN default "LITTLE" diff --git a/arch/Config.in.xtensa b/arch/Config.in.xtensa index a79d906985..acc340eca6 100644 --- a/arch/Config.in.xtensa +++ b/arch/Config.in.xtensa @@ -48,6 +48,9 @@ config BR2_ENDIAN config BR2_ARCH default "xtensa" if BR2_xtensa +config BR2_KERNEL_ARCH + default "xtensa" + config BR2_READELF_ARCH_NAME default "Tensilica Xtensa Processor" From patchwork Tue May 18 11:36:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas De Schampheleire X-Patchwork-Id: 1480201 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=ND3sK34m; dkim-atps=neutral Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (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 4Fkv9s35fgz9sW8 for ; Tue, 18 May 2021 21:37:21 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 534B440611; Tue, 18 May 2021 11:37:19 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Efdi6a0WpXz5; Tue, 18 May 2021 11:37:18 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 090A04061B; Tue, 18 May 2021 11:37:17 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 677E31BF397 for ; Tue, 18 May 2021 11:37:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 56C01403C3 for ; Tue, 18 May 2021 11:37:06 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp2.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uR_XsIM_VzRC for ; Tue, 18 May 2021 11:37:05 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by smtp2.osuosl.org (Postfix) with ESMTPS id 2193440409 for ; Tue, 18 May 2021 11:37:05 +0000 (UTC) Received: by mail-ed1-x536.google.com with SMTP id b17so10749542ede.0 for ; Tue, 18 May 2021 04:37:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Kfv9GE7AaiF7VIM9TLSo/M7dDX1stVSO2mYCbHC7ci4=; b=ND3sK34mB696yzYKqyYxjbB3ruuCvtLjs3YIr87YR1I+ecHso13uXRUBHrkibzf7vj OaJ/QX5vTV/aN4pL0IKOf+p+grGkExApdMn2TjKb6iwjJKJVWGC7LZur/s+bvuI5hN2o dUp+C29B6KeVcS+YU+eqQNDlQVpxRwEWOtNSlr8ptKWWsFmzTZXq1SasyUgGSDWkI60k w+mu/58cCU7aX6x3Ilv3NFzIFtXwEKN+YzOgUghLGyQrssY0Rf3q4fxlKoeatO7GdytY SDO1ql+t9YB2ukBbjSwu1jcblcs+Bewwdy/hijHz7BFjfopfJCYNAFQ5WTwXoVC0zp+I Kolw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Kfv9GE7AaiF7VIM9TLSo/M7dDX1stVSO2mYCbHC7ci4=; b=lDpGecT0MlmKVmY0YZZ6uiGLklilvGqp5AE6PpchPiwf2i2/AU1UiG+DLjS1wu/U77 jUopf2pCJ6w9kuSUn6hU89ClA05XZIMwvBeUVF7wbzfhL31T1UIvz2WGSC2F+3LaGDho +0W1/MYmiRs2F+XVz7/vDq1m6xoIPHQFwtL3IV1k/TN7TC64+WH7VPr5tX2eN+TJY7De euexLiRwUQ/Fgu25JtQVJNy26MuPjy/ZXdGVsFsMB4ZqQqYq2TlaJQJx7+YB+PY9Xudm RsMuS4XkzZLbx9KNfrXFQXT11SbYMQGRX76lqwjbklyn3AQnYKdjwZegfR6YC28BB0Te /SMg== X-Gm-Message-State: AOAM533kTW39Y+oS7PsaOzNvZ+J5Vq+GKifvJUp1kPDjfg0nGvWvu1B5 87U4kvlxsLb6ldKSSKoGNLQ3ajypBksMEsMjkuc= X-Google-Smtp-Source: ABdhPJyTP8qBqn1wKBDLLMwPzGs+IZ22f7+IisFiGcrBFfBCRdzyt/j8O1nA9Dkgu45mCXpx/nWQ6Q== X-Received: by 2002:a05:6402:2298:: with SMTP id cw24mr6500599edb.156.1621337823272; Tue, 18 May 2021 04:37:03 -0700 (PDT) Received: from localhost (ptr-5gw9txf6g5tndjqqqz.18120a2.ip6.access.telenet.be. [2a02:1810:510:3800:1b15:18e4:57d1:eb]) by smtp.gmail.com with ESMTPSA id u11sm12823765edr.13.2021.05.18.04.37.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 May 2021 04:37:02 -0700 (PDT) From: Thomas De Schampheleire To: buildroot@buildroot.org Date: Tue, 18 May 2021 13:36:49 +0200 Message-Id: <20210518113652.29609-3-patrickdepinguin@gmail.com> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210518113652.29609-1-patrickdepinguin@gmail.com> References: <20210518113652.29609-1-patrickdepinguin@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 2/4] core: introduce NORMALIZED_ARCH as non-kernel replacement for KERNEL_ARCH X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marcus Folkesson , Antoine Tenart , "Yann E. MORIN" , Clayton Shotwell , Matt Weber , Thomas De Schampheleire Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Thomas De Schampheleire The variable 'KERNEL_ARCH' is actually a normalized version of 'ARCH'/'BR2_ARCH'. For example, 'arcle' and 'arceb' both become 'arc', just as all powerpc variants become 'powerpc'. It is presumably called 'KERNEL_ARCH' because the Linux kernel is typically the first place where support for a new architecture is added, and thus is the entity that defines the normalized name. However, the term 'KERNEL_ARCH' can also be interpreted as 'the architecture used by the kernel', which need not be exactly the same as 'the normalized name for a certain arch'. In particular, for cases where a 64-bit architecture is running a 64-bit kernel but 32-bit userspace. Examples include: * aarch64 architecture, with aarch64 kernel and 32-bit (ARM) userspace * x86_64 architecture, with x86_64 kernel and 32-bit (i386) userspace In such cases, the 'architecture used by the kernel' needs to refer to the 64-bit name (aarch64, x86_64), whereas all userspace applications need to refer the, potentially normalized, 32-bit name. This means that there need to be two different variables: KERNEL_ARCH: the architecture used by the kernel NORMALIZED_ARCH: the normalized name for the current userspace architecture At this moment, both will actually have the same content. But a subsequent patch will add basic support for situations described above, in which KERNEL_ARCH may become overwritten to the 64-bit architecture, while NORMALIZED_ARCH needs to remain the same (32-bit) case. This commit replaces use of KERNEL_ARCH where actually the userspace arch is needed. Places that use KERNEL_ARCH in combination with building of kernel modules are not touched. There may be cases where a package builds both a kernel module as userspace, in which case it may need to know about both KERNEL_ARCH and NORMALIZED_ARCH, for the case where they differ. But this is to be fixed on a per-need basis. Signed-off-by: Thomas De Schampheleire Reviewed-by: Romain Naour --- Makefile | 1 + boot/barebox/barebox.mk | 10 +++++----- boot/uboot/uboot.mk | 6 +++--- package/busybox/busybox.mk | 2 +- package/environment-setup/environment-setup.mk | 2 +- package/kvmtool/kvmtool.mk | 4 ++-- package/libselinux/libselinux.mk | 2 +- package/linux-tools/linux-tool-perf.mk.in | 4 ++-- package/linux-tools/linux-tool-selftests.mk.in | 6 +++--- package/olsr/olsr.mk | 4 ++-- package/pciutils/pciutils.mk | 2 +- package/uboot-tools/uboot-tools.mk | 10 +++++----- 12 files changed, 27 insertions(+), 26 deletions(-) diff --git a/Makefile b/Makefile index 7b6998fde6..c5399e9a35 100644 --- a/Makefile +++ b/Makefile @@ -433,6 +433,7 @@ QUIET := $(if $(findstring s,$(filter-out --%,$(MAKEFLAGS))),-q) # Strip off the annoying quoting ARCH := $(call qstrip,$(BR2_ARCH)) +NORMALIZED_ARCH := $(call qstrip,$(BR2_KERNEL_ARCH)) KERNEL_ARCH := $(call qstrip,$(BR2_KERNEL_ARCH)) ZCAT := $(call qstrip,$(BR2_ZCAT)) diff --git a/boot/barebox/barebox.mk b/boot/barebox/barebox.mk index 8f02f9f9e1..6506294d6d 100644 --- a/boot/barebox/barebox.mk +++ b/boot/barebox/barebox.mk @@ -59,16 +59,16 @@ ifneq ($$(BR2_TARGET_$(1)_BAREBOXENV),y) $(1)_INSTALL_TARGET = NO endif -ifeq ($$(KERNEL_ARCH),i386) +ifeq ($$(NORMALIZED_ARCH),i386) $(1)_ARCH = x86 -else ifeq ($$(KERNEL_ARCH),x86_64) +else ifeq ($$(NORMALIZED_ARCH),x86_64) $(1)_ARCH = x86 -else ifeq ($$(KERNEL_ARCH),powerpc) +else ifeq ($$(NORMALIZED_ARCH),powerpc) $(1)_ARCH = ppc -else ifeq ($$(KERNEL_ARCH),arm64) +else ifeq ($$(NORMALIZED_ARCH),arm64) $(1)_ARCH = arm else -$(1)_ARCH = $$(KERNEL_ARCH) +$(1)_ARCH = $$(NORMALIZED_ARCH) endif $(1)_MAKE_FLAGS = ARCH=$$($(1)_ARCH) CROSS_COMPILE="$$(TARGET_CROSS)" diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk index dbe82e65b1..77df9c8bba 100644 --- a/boot/uboot/uboot.mk +++ b/boot/uboot/uboot.mk @@ -139,12 +139,12 @@ endif # The kernel calls AArch64 'arm64', but U-Boot calls it just 'arm', so # we have to special case it. Similar for i386/x86_64 -> x86 -ifeq ($(KERNEL_ARCH),arm64) +ifeq ($(NORMALIZED_ARCH),arm64) UBOOT_ARCH = arm -else ifneq ($(filter $(KERNEL_ARCH),i386 x86_64),) +else ifneq ($(filter $(NORMALIZED_ARCH),i386 x86_64),) UBOOT_ARCH = x86 else -UBOOT_ARCH = $(KERNEL_ARCH) +UBOOT_ARCH = $(NORMALIZED_ARCH) endif UBOOT_MAKE_OPTS += \ diff --git a/package/busybox/busybox.mk b/package/busybox/busybox.mk index e979ac4f4b..456ed04a73 100644 --- a/package/busybox/busybox.mk +++ b/package/busybox/busybox.mk @@ -99,7 +99,7 @@ endif BUSYBOX_MAKE_OPTS = \ CC="$(TARGET_CC)" \ - ARCH=$(KERNEL_ARCH) \ + ARCH=$(NORMALIZED_ARCH) \ PREFIX="$(TARGET_DIR)" \ EXTRA_LDFLAGS="$(BUSYBOX_LDFLAGS)" \ CROSS_COMPILE="$(TARGET_CROSS)" \ diff --git a/package/environment-setup/environment-setup.mk b/package/environment-setup/environment-setup.mk index fcad013f0d..8e0fdff208 100644 --- a/package/environment-setup/environment-setup.mk +++ b/package/environment-setup/environment-setup.mk @@ -11,7 +11,7 @@ define HOST_ENVIRONMENT_SETUP_INSTALL_CMDS for var in $(TARGET_CONFIGURE_OPTS); do \ printf "export \"$$var\"\n" >> $(ENVIRONMENT_SETUP_FILE); \ done - printf "export \"ARCH=$(KERNEL_ARCH)\"\n" >> $(ENVIRONMENT_SETUP_FILE) + printf "export \"ARCH=$(NORMALIZED_ARCH)\"\n" >> $(ENVIRONMENT_SETUP_FILE) printf "export \"CROSS_COMPILE=$(TARGET_CROSS)\"\n" >> $(ENVIRONMENT_SETUP_FILE) printf "export \"CONFIGURE_FLAGS=--target=$(GNU_TARGET_NAME) \ --host=$(GNU_TARGET_NAME) \ diff --git a/package/kvmtool/kvmtool.mk b/package/kvmtool/kvmtool.mk index 2984817c7e..df6ae7e0f1 100644 --- a/package/kvmtool/kvmtool.mk +++ b/package/kvmtool/kvmtool.mk @@ -25,11 +25,11 @@ KVMTOOL_MAKE_OPTS = \ WERROR=0 define KVMTOOL_BUILD_CMDS - $(TARGET_MAKE_ENV) ARCH=$(KERNEL_ARCH) $(MAKE) -C $(@D) $(KVMTOOL_MAKE_OPTS) + $(TARGET_MAKE_ENV) ARCH=$(NORMALIZED_ARCH) $(MAKE) -C $(@D) $(KVMTOOL_MAKE_OPTS) endef define KVMTOOL_INSTALL_TARGET_CMDS - $(TARGET_MAKE_ENV) ARCH=$(KERNEL_ARCH) $(MAKE) -C $(@D) \ + $(TARGET_MAKE_ENV) ARCH=$(NORMALIZED_ARCH) $(MAKE) -C $(@D) \ $(KVMTOOL_MAKE_OPTS) install DESTDIR=$(TARGET_DIR) prefix=/usr endef diff --git a/package/libselinux/libselinux.mk b/package/libselinux/libselinux.mk index fdd13aa942..5a62b8d829 100644 --- a/package/libselinux/libselinux.mk +++ b/package/libselinux/libselinux.mk @@ -18,7 +18,7 @@ LIBSELINUX_INSTALL_STAGING = YES # we won't have to use a relative path in 0002-revert-ln-relative.patch LIBSELINUX_MAKE_OPTS = \ $(TARGET_CONFIGURE_OPTS) \ - ARCH=$(KERNEL_ARCH) \ + ARCH=$(NORMALIZED_ARCH) \ SHLIBDIR=/usr/lib LIBSELINUX_MAKE_INSTALL_TARGETS = install diff --git a/package/linux-tools/linux-tool-perf.mk.in b/package/linux-tools/linux-tool-perf.mk.in index efa747cf8d..4e28129f50 100644 --- a/package/linux-tools/linux-tool-perf.mk.in +++ b/package/linux-tools/linux-tool-perf.mk.in @@ -8,10 +8,10 @@ LINUX_TOOLS += perf PERF_DEPENDENCIES = host-flex host-bison -ifeq ($(KERNEL_ARCH),x86_64) +ifeq ($(NORMALIZED_ARCH),x86_64) PERF_ARCH=x86 else -PERF_ARCH=$(KERNEL_ARCH) +PERF_ARCH=$(NORMALIZED_ARCH) endif PERF_MAKE_FLAGS = \ diff --git a/package/linux-tools/linux-tool-selftests.mk.in b/package/linux-tools/linux-tool-selftests.mk.in index c4e5bf0fea..b824c11bd6 100644 --- a/package/linux-tools/linux-tool-selftests.mk.in +++ b/package/linux-tools/linux-tool-selftests.mk.in @@ -6,13 +6,13 @@ LINUX_TOOLS += selftests -ifeq ($(KERNEL_ARCH),x86_64) +ifeq ($(NORMALIZED_ARCH),x86_64) SELFTESTS_ARCH=x86 else -ifeq ($(KERNEL_ARCH),i386) +ifeq ($(NORMALIZED_ARCH),i386) SELFTESTS_ARCH=x86 else -SELFTESTS_ARCH=$(KERNEL_ARCH) +SELFTESTS_ARCH=$(NORMALIZED_ARCH) endif endif diff --git a/package/olsr/olsr.mk b/package/olsr/olsr.mk index b2c8e7e001..4ad88991f2 100644 --- a/package/olsr/olsr.mk +++ b/package/olsr/olsr.mk @@ -27,10 +27,10 @@ OLSR_PLUGINS += pud endif define OLSR_BUILD_CMDS - $(TARGET_CONFIGURE_OPTS) $(MAKE) ARCH=$(KERNEL_ARCH) \ + $(TARGET_CONFIGURE_OPTS) $(MAKE) ARCH=$(NORMALIZED_ARCH) \ CFLAGS="$(OLSR_CFLAGS)" -C $(@D) olsrd $(foreach p,$(OLSR_PLUGINS), \ - $(TARGET_CONFIGURE_OPTS) $(MAKE) ARCH=$(KERNEL_ARCH) \ + $(TARGET_CONFIGURE_OPTS) $(MAKE) ARCH=$(NORMALIZED_ARCH) \ CFLAGS="$(OLSR_CFLAGS)" -C $(@D)/lib/$(p) ) endef diff --git a/package/pciutils/pciutils.mk b/package/pciutils/pciutils.mk index 9b83b62b55..67defcc743 100644 --- a/package/pciutils/pciutils.mk +++ b/package/pciutils/pciutils.mk @@ -12,7 +12,7 @@ PCIUTILS_LICENSE = GPL-2.0+ PCIUTILS_LICENSE_FILES = COPYING PCIUTILS_MAKE_OPTS = \ CROSS_COMPILE="$(TARGET_CROSS)" \ - HOST="$(KERNEL_ARCH)-linux" \ + HOST="$(NORMALIZED_ARCH)-linux" \ OPT="$(TARGET_CFLAGS)" \ LDFLAGS="$(TARGET_LDFLAGS)" \ DNS=no \ diff --git a/package/uboot-tools/uboot-tools.mk b/package/uboot-tools/uboot-tools.mk index 8963d6182e..d60aaa7668 100644 --- a/package/uboot-tools/uboot-tools.mk +++ b/package/uboot-tools/uboot-tools.mk @@ -206,14 +206,14 @@ $(eval $(host-generic-package)) MKIMAGE = $(HOST_DIR)/bin/mkimage # mkimage supports arm blackfin m68k microblaze mips mips64 nios2 powerpc ppc sh sparc sparc64 x86 -# KERNEL_ARCH can be arm64 arc arm blackfin m68k microblaze mips nios2 powerpc sh sparc i386 x86_64 xtensa -# For arm64, arc, xtensa we'll just keep KERNEL_ARCH +# NORMALIZED_ARCH can be arm64 arc arm blackfin m68k microblaze mips nios2 powerpc sh sparc i386 x86_64 xtensa +# For arm64, arc, xtensa we'll just keep NORMALIZED_ARCH # For mips64, we'll just keep mips # For i386 and x86_64, we need to convert -ifeq ($(KERNEL_ARCH),x86_64) +ifeq ($(NORMALIZED_ARCH),x86_64) MKIMAGE_ARCH = x86 -else ifeq ($(KERNEL_ARCH),i386) +else ifeq ($(NORMALIZED_ARCH),i386) MKIMAGE_ARCH = x86 else -MKIMAGE_ARCH = $(KERNEL_ARCH) +MKIMAGE_ARCH = $(NORMALIZED_ARCH) endif From patchwork Tue May 18 11:36:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas De Schampheleire X-Patchwork-Id: 1480203 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=2605:bc80:3010::133; helo=smtp2.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=NNnYl2I6; dkim-atps=neutral Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (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 4FkvBM6nR6z9sW8 for ; Tue, 18 May 2021 21:37:47 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id D52C8403BC; Tue, 18 May 2021 11:37:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mBnT_152-OZb; Tue, 18 May 2021 11:37:45 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id 0606C403B2; Tue, 18 May 2021 11:37:43 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 5C58D1BF397 for ; Tue, 18 May 2021 11:37:08 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 4876640406 for ; Tue, 18 May 2021 11:37:08 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TquZ3SyxPXOP for ; Tue, 18 May 2021 11:37:07 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by smtp2.osuosl.org (Postfix) with ESMTPS id 6A065403C3 for ; Tue, 18 May 2021 11:37:07 +0000 (UTC) Received: by mail-ej1-x62e.google.com with SMTP id u21so13963104ejo.13 for ; Tue, 18 May 2021 04:37:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=52xA0FNj1pRwD33kbgV1yySObgtWoQ0H4Dk6EEFgPRo=; b=NNnYl2I6q1/sgazhsd0mfwDGfAZnCLXtkPiGkS2wLqtMWqYI8aDRHNxzZzr/FMjKOe 1hbPXq5nea52eTzwCxBXrwq3JkZLG4sLaehjiGZC1Ia1xGELkxt7U9aX0Wsoqnr1zSCO 8AhJDmW20XVrLUbi14u30I4YGKxUWOk0BNcPd5haHp05OeGuZBvSWFxduzA8IBym6CtG 4T3EUXUpvMrpOcsq15OhKSJ8Vuo8ieNxOuku7/Hkz5GPKlvqDtAD2RjvpDmgvggdXD6Q ZeXQJEhfhS0UF8lMjliiJWvBq7TANQx0RTSvcW0Ym/82SwgmdRTcMzhfnMowm6fyucNF 4Q6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=52xA0FNj1pRwD33kbgV1yySObgtWoQ0H4Dk6EEFgPRo=; b=GR/qu4+S1SJI+mjd0S1+xI+DGUASLQBpQ2dMOrkWDMPyKvVl0HdDTmsq7C6rDsHY6y B3FcSCDGwEE1HMgguEKvAkczvYnv0huBghjcEF4NhA5wNtqpTZyfgsRI5HinaqDJPf6+ 03TtDq9eD1SJfUXErkstkBuqZlDb1GN0ImAOctJ6IaX23dF/8a7djUPhxw5NpBRaKR9h 7QKUy/xlnk6kr+1fx1kwFBemgN1xW1YtccE3Tev+3JgctHb1vH9OZ3mcH0eWMURP7IyY mt8GWdGNz6VjnrfTLK4PgSC0ACHeWEhI7l8hk5SqXZnyutO6PxhbyYxnYhJT2AunFEvl VsDA== X-Gm-Message-State: AOAM5314nls3BEJt5fUaWFqe3DNyKe4WbsfdKAam4ZaxxRIKaQxmoYWG YdWndhz3DfLKgeiK5PYWQP2GPj2JbiEf7/Qp X-Google-Smtp-Source: ABdhPJwzBblDMam01hWD4EL4xgVcFL++alJF9TdjoqNWxOc/ZdGLahML3Tp5GTkjPPp5dt26m0J6Qw== X-Received: by 2002:a17:906:dfc1:: with SMTP id jt1mr5539718ejc.473.1621337825717; Tue, 18 May 2021 04:37:05 -0700 (PDT) Received: from localhost (ptr-5gw9txf6g5tndjqqqz.18120a2.ip6.access.telenet.be. [2a02:1810:510:3800:1b15:18e4:57d1:eb]) by smtp.gmail.com with ESMTPSA id n12sm3215586edr.84.2021.05.18.04.37.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 May 2021 04:37:05 -0700 (PDT) From: Thomas De Schampheleire To: buildroot@buildroot.org Date: Tue, 18 May 2021 13:36:50 +0200 Message-Id: <20210518113652.29609-4-patrickdepinguin@gmail.com> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210518113652.29609-1-patrickdepinguin@gmail.com> References: <20210518113652.29609-1-patrickdepinguin@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 3/4] core: introduce BR2_KERNEL_ARCH_OVERRIDE X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas De Schampheleire Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Thomas De Schampheleire There are cases where a 64-bit architecture is running a 64-bit kernel but 32-bit userspace. Examples include: * aarch64 architecture, with aarch64 kernel and 32-bit (ARM) userspace * x86_64 architecture, with x86_64 kernel and 32-bit (i386) userspace In Buildroot, the ARCH/BR2_ARCH and NORMALIZED_ARCH variables will refer to the 32-bit architecture, but the kernel needs to be built with the 64-bit architecture. Make it possible to define the correct architecture to be used for the kernel, in a new config option 'BR2_KERNEL_ARCH_OVERRIDE'. The user is expected to know the valid values. Signed-off-by: Thomas De Schampheleire --- Makefile | 4 ++++ arch/Config.in | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/Makefile b/Makefile index c5399e9a35..d09cf7c958 100644 --- a/Makefile +++ b/Makefile @@ -434,7 +434,11 @@ QUIET := $(if $(findstring s,$(filter-out --%,$(MAKEFLAGS))),-q) # Strip off the annoying quoting ARCH := $(call qstrip,$(BR2_ARCH)) NORMALIZED_ARCH := $(call qstrip,$(BR2_KERNEL_ARCH)) +ifeq ($(call qstrip,$(BR2_KERNEL_ARCH_OVERRIDE)),) KERNEL_ARCH := $(call qstrip,$(BR2_KERNEL_ARCH)) +else +KERNEL_ARCH := $(call qstrip,$(BR2_KERNEL_ARCH_OVERRIDE)) +endif ZCAT := $(call qstrip,$(BR2_ZCAT)) BZCAT := $(call qstrip,$(BR2_BZCAT)) diff --git a/arch/Config.in b/arch/Config.in index 7575acf48c..c82100f541 100644 --- a/arch/Config.in +++ b/arch/Config.in @@ -329,6 +329,21 @@ config BR2_ARCH config BR2_KERNEL_ARCH string +config BR2_KERNEL_ARCH_OVERRIDE + string "Kernel architecture override" + help + Normally, the correct kernel architecture value is derived + from the selected architecture, and you should keep this + option empty. + However, there are cases where you may want to enter a custom + value, for example when using a 64-bit architecture but + running userspace in 32-bit mode. + As an example, in case of an x86_64 processor where you want + 32-bit userspace, BR2_ARCH will be 'i386'/'i486'/'i686' and + BR2_KERNEL_ARCH_OVERRIDE should be set to 'x86_64'. Note that + in this example you will also need a multilib toolchain and + pass '-m32' via BR2_TARGET_OPTIMIZATION. + config BR2_ENDIAN string From patchwork Tue May 18 11:36:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas De Schampheleire X-Patchwork-Id: 1480204 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=MtBbvrIp; dkim-atps=neutral Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (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 4FkvBc6hbFz9sW8 for ; Tue, 18 May 2021 21:38:00 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id D53AD4061A; Tue, 18 May 2021 11:37:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PTYJZ-RGmrVS; Tue, 18 May 2021 11:37:58 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 04FA440616; Tue, 18 May 2021 11:37:56 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 61FA91BF397 for ; Tue, 18 May 2021 11:37:13 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 50E0960B32 for ; Tue, 18 May 2021 11:37:13 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp3.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id buXkfL2d0AS7 for ; Tue, 18 May 2021 11:37:10 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by smtp3.osuosl.org (Postfix) with ESMTPS id 705B660B34 for ; Tue, 18 May 2021 11:37:10 +0000 (UTC) Received: by mail-ej1-x632.google.com with SMTP id et19so6966126ejc.4 for ; Tue, 18 May 2021 04:37:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XbQlwHaffF5XgsjfSrlmTdTHqeDi1LwSbqo3b7ShKSw=; b=MtBbvrIpyD1UmR+w/a9SnwxxXdtpkXO9eVbpKpOaUxqsf1juaMsuzBJKMHfyCoRxBX jB1Nt1cca5wHVJFYStlgUqAmDvkwkDrlt/GbVj+AE30WBnwHsA3O2ZZ4WF1yrb7R5XST oV5D4+jbOa8s4L4EoiLKaDcsGbqfKa7N4zd9mxgJuBAAipdtWR+ua4C4bxpPFwcs90n/ MLkEXzYE9aCTMkuYvi0NSkKI3HC8jfUNpbNAsTrQ9lng5aNh7Bf+AhuNT67NKHywlhHy /QrQxnb9PhTyr6HKXwj7nWVTT1xDOE1Wh/V132w5VeSQqTHDN/xJMcbcnlO/CBARYyNS BtNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XbQlwHaffF5XgsjfSrlmTdTHqeDi1LwSbqo3b7ShKSw=; b=CbhqxS53+G9Rt4lfdFb36wMiwoJLl68i7pGrdRFcDJcOmSO2b0voPE8PVExmMlBl1j rzhDVPnjNlzNCHLfs8h70vfuJb33pZng/1ZMPoTlzulgti/+qrjCzE0gqNFB1S5BI/4r oSkmiNJe0qzF4LAL1ePI+CBKHlEPOHxj+ghlz3/sfjAxOWXva0bA2DvJohzQ+GSM0sdU hqp4uxA1k32vIMHRbEWZDTcegj/yesVyYGMTnS8kIlSK/aUXyLW7yo5/2XCEdECEShWh 1LUJxrw4BhFtzC1hFX9xw+LKiTlDTdTB/enGRkMYNGK3HrZxzBc22TM2jcnELJXGHdx9 2ijg== X-Gm-Message-State: AOAM531piltTwPVQJg8lklgZFm4nkgbwelAHAKapox4uuKZMpu7UW0/8 eP9B6IuT6YLLvTglWPzbgQXimQMAz0a0KWLucN0= X-Google-Smtp-Source: ABdhPJwbS1ZpM4WLDOVtS5vsqq8VGJhnGKrebTmodRKNvjzuHFNWCwdloIJKWEkBWSE0k0UQQLEgxQ== X-Received: by 2002:a17:907:9705:: with SMTP id jg5mr5700145ejc.138.1621337828669; Tue, 18 May 2021 04:37:08 -0700 (PDT) Received: from localhost (ptr-5gw9txf6g5tndjqqqz.18120a2.ip6.access.telenet.be. [2a02:1810:510:3800:1b15:18e4:57d1:eb]) by smtp.gmail.com with ESMTPSA id f20sm5811510edu.24.2021.05.18.04.37.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 May 2021 04:37:08 -0700 (PDT) From: Thomas De Schampheleire To: buildroot@buildroot.org Date: Tue, 18 May 2021 13:36:51 +0200 Message-Id: <20210518113652.29609-5-patrickdepinguin@gmail.com> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210518113652.29609-1-patrickdepinguin@gmail.com> References: <20210518113652.29609-1-patrickdepinguin@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 4/4] perf: fix compilation in case of i386 userspace with x86_64 kernel X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Yann E. MORIN" , Thomas De Schampheleire Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Thomas De Schampheleire If a 64-bit kernel is combined with 32-bit userspace, and this is achieved via a multilib toolchain that defaults to 64-bit with '-m32' in BR2_TARGET_OPTIMIZATION, the '-ld' command will still default to 64-bit output. In this case, packages that use 'ld' directly need to be instructed to use the correct ABI via the '-m' parameter. 'perf' is one such package. Signed-off-by: Thomas De Schampheleire --- package/linux-tools/linux-tool-perf.mk.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package/linux-tools/linux-tool-perf.mk.in b/package/linux-tools/linux-tool-perf.mk.in index 4e28129f50..b84b5fd415 100644 --- a/package/linux-tools/linux-tool-perf.mk.in +++ b/package/linux-tools/linux-tool-perf.mk.in @@ -45,6 +45,9 @@ PERF_MAKE_FLAGS += LD="$(TARGET_LD) -m elf32ltsmipn32" else PERF_MAKE_FLAGS += LD="$(TARGET_LD) -m elf64ltsmip" endif +# case for x86 toolchain that defaults to 64-bit output +else ifeq ($(BR2_i386):$(call qstrip,$(BR2_KERNEL_ARCH_OVERRIDE)),y:x86_64) +PERF_MAKE_FLAGS += LD="$(TARGET_LD) -m elf_i386" endif # The call to backtrace() function fails for ARC, because for some