Message ID | 20230722044806.3867434-11-masahiroy@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp627493vqg; Fri, 21 Jul 2023 22:14:41 -0700 (PDT) X-Google-Smtp-Source: APBJJlFqG8B7FEzlJclmAwuM5vCrflGfzuTCh6gmNBME4WOvjqlgR9/iLGs0cb3uC+l0WidtczQn X-Received: by 2002:a05:6a00:2406:b0:668:8705:57cf with SMTP id z6-20020a056a00240600b00668870557cfmr2462273pfh.25.1690002881277; Fri, 21 Jul 2023 22:14:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690002881; cv=none; d=google.com; s=arc-20160816; b=cwjinkzxJSKr+2suBiW4C9RR0vPAsFSrjsQ3q3m5jVYhH75gvC+m3S7T79cGoYVlQh /QS8h+wxCh33Vel/wPc8ZjEFRoMArPhpKZ7+r3xi6K9LwCXNzRhjDFJ10EUvU8jyEoyM UQyPRMCl/snBH6cIfmXbg+aSEpzQ0dChUICd5nq6gHq6yBE8Hd+r1Fixs2xA/uc14XeF ANDID1Us5MXoIkqQg/5FxZjms3GYe1vo0V/qEnOj35X6d81cLlHLvjknQ1jNropaLYo+ xQVHsEHhHSQrMwFFbNuXwitMWDpaE0kwuAtRhZDlwIa6piZZf5zorm8VJhTvFTIVDUph QdOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=HJmypuWomvlMKMJmQlsWo1jILQA3vMJ3iTxQgmk7KDE=; fh=rliOZr6Fz5JmnSfKOt6v3ZHxXv/lQ1TnqU77+ZCO3og=; b=gmMrf6+H/VvK+J6GrVguvYgm5G0EYJ5lSmAXrd14GsIwFQGfKfkuiQROIHKaYD19aJ O/CMifgJv69bu/8aSnYMIr/sOaI1g5sC58SOM0biKj1GG7S/PtFsRTtlXAGF3s+leED0 qPRndGj5fIfXofAC4l6Kl1hDAGho8k6vR0+bxF8PKgckZQO3U0A86hMRRU7Lb7F6dYUA aSj+dZWnlWxoHiLeAEYVsXHA+xiVHDwvW7pTeOCts5QRtHBMNhvez4FCl69n1oZnxVVQ OETKUk2UqDoxRE9WN44n6GHnHAX4xDaF7hm3ChtV48RnnC9LOuZAlx2d0fhwl8OSdFPu OCmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZcYnw9kX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t40-20020a056a0013a800b0067b77e7f472si4486452pfg.402.2023.07.21.22.14.28; Fri, 21 Jul 2023 22:14:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZcYnw9kX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231261AbjGVEt2 (ORCPT <rfc822;assdfgzxcv4@gmail.com> + 99 others); Sat, 22 Jul 2023 00:49:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231145AbjGVEtJ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 22 Jul 2023 00:49:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4BB5420B; Fri, 21 Jul 2023 21:48:31 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 65A7B60A4E; Sat, 22 Jul 2023 04:48:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BC1DCC433CA; Sat, 22 Jul 2023 04:48:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690001310; bh=fBL9JE5iepvra98mZ0IoB0g7RFTsWLA/SDkRPTHrAaE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZcYnw9kXlTlBpvjRum6fzEUZ8kOXy+Q5Eb6/zToLfcb+HO2UVJQBpdYNLPGDI8XLT IScI6lQR/jkzEyHiRUDZ/g5XJsEruKQxZP5vlopbm6PEmB1uOf4dT/V+qSVqXhKt1R XC1+C3X5HpqtS4bhzNx0t1xsGWVC5auC5/7i8rEKDre+e3yJ7K2YDcdzYY3uFlenY7 VGguZPUx0v4EmY3W3Orto4VQim8tnh9Ej9u3NTy5rS6fs7mWjUY2a1U6M8JbYjXBPD D+flhjKFBMIumd/Yv2J0n18AdobDDUk3Xt7xs9l05Oo8OyG7PfJeUUjU/5g0Ye3Tmw dj70gXNaRilLA== From: Masahiro Yamada <masahiroy@kernel.org> To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada <masahiroy@kernel.org>, Nathan Chancellor <nathan@kernel.org>, Nick Desaulniers <ndesaulniers@google.com>, Nicolas Schier <nicolas@fjasle.eu> Subject: [PATCH 11/19] kbuild: rpm-pkg: use a dummy string for _arch when undefined Date: Sat, 22 Jul 2023 13:47:58 +0900 Message-Id: <20230722044806.3867434-11-masahiroy@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230722044806.3867434-1-masahiroy@kernel.org> References: <20230722044806.3867434-1-masahiroy@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772096461308057126 X-GMAIL-MSGID: 1772096461308057126 |
Series |
[01/19] kbuild: rpm-pkg: define _arch conditionally
|
|
Commit Message
Masahiro Yamada
July 22, 2023, 4:47 a.m. UTC
If this affects only %{buildroot}, it should be enough to use a fixed
string for _arch when it is undefined.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
scripts/package/mkspec | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
Comments
Hi, I build the latest kernel (6.6-rc1) for arm64 platform on x86 server (with cross complile), and the complile command is as following: export PATH=$PATH:/opt/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu/bin/ export ARCH=arm64 export CROSS_COMPILE=aarch64-linux-gnu- make -j64 Image (ok) make binrpm-pkg -j64 (failed) But when complile binrpm-pkg, it is failed and the error info is as following: rpmbuild -bb kernel.spec --define='_topdir /home/chenxiang/kernel/mainline/linux-next/rpmbuild' --target aarch64-linux --build-in-place --noprep --define='_smp_mflags %{nil}' $(rpm -q rpm >/dev/null 2>&1 || echo --nodeps) --without devel rpmbuild: --build-in-place: unknown option make[2]: *** [scripts/Makefile.package:92: binrpm-pkg] Error 1 make[1]: *** [/home/chenxiang/kernel/mainline/linux-next/Makefile:1538: binrpm-pkg] Error 2 make: *** [Makefile:234: __sub-make] Error 2 But it is ok with v6.5-rc7, so i bisect the kernel code and find the patch (kbuild: rpm-pkg: use a dummy string for _arch when undefined): 706a741595047797872e (v6.6-rc1) good 0bb80ecc33a8fb5a6(v6.5-rc7) bad [461f35f014466c4e26dca6be0f431f57297df3f2] Merge tag 'drm-next-2023-08-30' of git://anongit.freedesktop.org/drm/drm good [e925992671907314b7db6793a28eb39b36bc21a4] Merge tag 'staging-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging good [3c31041e37324e143bee98604bb31481e905b4b3] Merge tag 'printk-for-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux good [4a0fc73da97efd23a383ca839e6fe86410268f6b] Merge tag 's390-6.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux bad [61401a8724c2ce912b243ef95427a9b2e5a1ed50] Merge tag 'kbuild-v6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild bad [2be6bc48df59c99d35aab16a51d4a814e9bb8c35] Merge tag 'leds-next-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/leds good [3f86ed6ec0b390c033eae7f9c487a3fea268e027] Merge tag 'arc-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc good [4cdb71b6ba3283fb2b7eaccc333f8f2c5b81797b] sparc: replace #include <asm/export.h> with #include <linux/export.h> bad [975667d02d134f7b48d15ee7ff0d49e69a6774cf] kbuild: rpm-pkg: rename binkernel.spec to kernel.spec bad [a06d9ef897d59f719102e2890abd8a2b91e29a60] kbuild: rpm-pkg: record ARCH option in spec file good [d5d2d4cc60888f02dd4a6b2bfb03ff2fd7be4fc2] kbuild: rpm-pkg: derive the Version from %{KERNELRELEASE} good [b537925fdd689ca33b6d9eed4569bc625550b3ef] kbuild: rpm-pkg: run modules_install for non-modular kernel bad [1789fc9125414bd9ca4d50a8966752ee6103d547] kbuild: rpm-pkg: invoke the kernel build from rpmbuild for binrpm-pkg bad [d4f651277e9208b580b55da212e17ddd309c91e7] kbuild: rpm-pkg: use a dummy string for _arch when undefined Do you have any idea about this issue? Thanks Xiang Chen 在 2023/7/22 星期六 12:47, Masahiro Yamada 写道: > If this affects only %{buildroot}, it should be enough to use a fixed > string for _arch when it is undefined. > > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> > --- > > scripts/package/mkspec | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/scripts/package/mkspec b/scripts/package/mkspec > index 783e1997d94a..22b980cf3d00 100755 > --- a/scripts/package/mkspec > +++ b/scripts/package/mkspec > @@ -36,6 +36,8 @@ sed -e '/^DEL/d' -e 's/^\t*//' <<EOF > %define ARCH ${ARCH} > %define KERNELRELEASE ${KERNELRELEASE} > > +# _arch is undefined if /usr/lib/rpm/platform/*/macros was not included. > +%{!?_arch: %define _arch dummy} > %{!?make: %define make make} > %define makeflags %{?_smp_mflags} ARCH=%{ARCH} > > @@ -55,9 +57,6 @@ $S BuildRequires: bc binutils bison dwarves > $S BuildRequires: (elfutils-libelf-devel or libelf-devel) flex > $S BuildRequires: gcc make openssl openssl-devel perl python3 rsync > > - # $UTS_MACHINE as a fallback of _arch in case > - # /usr/lib/rpm/platform/*/macros was not included. > - %{!?_arch: %define _arch $UTS_MACHINE} > %define __spec_install_post /usr/lib/rpm/brp-compress || : > %define debug_package %{nil} >
On Tue, Sep 12, 2023 at 4:09 PM chenxiang (M) <chenxiang66@hisilicon.com> wrote: > > Hi, > > I build the latest kernel (6.6-rc1) for arm64 platform on x86 server > (with cross complile), and the complile command is as following: > > export > PATH=$PATH:/opt/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu/bin/ > export ARCH=arm64 > export CROSS_COMPILE=aarch64-linux-gnu- > > make -j64 Image (ok) > > make binrpm-pkg -j64 (failed) > > But when complile binrpm-pkg, it is failed and the error info is as > following: > > rpmbuild -bb kernel.spec --define='_topdir > /home/chenxiang/kernel/mainline/linux-next/rpmbuild' --target > aarch64-linux --build-in-place --noprep --define='_smp_mflags %{nil}' > $(rpm -q rpm >/dev/null 2>&1 || echo --nodeps) --without devel > rpmbuild: --build-in-place: unknown option I cannot reproduce it on my build environment, but the error message: rpmbuild: --build-in-place: unknown option describes the issue. Which version of rpmbuild did you use? Using a newer version fixes the issue? -- Best Regards Masahiro Yamada
diff --git a/scripts/package/mkspec b/scripts/package/mkspec index 783e1997d94a..22b980cf3d00 100755 --- a/scripts/package/mkspec +++ b/scripts/package/mkspec @@ -36,6 +36,8 @@ sed -e '/^DEL/d' -e 's/^\t*//' <<EOF %define ARCH ${ARCH} %define KERNELRELEASE ${KERNELRELEASE} +# _arch is undefined if /usr/lib/rpm/platform/*/macros was not included. +%{!?_arch: %define _arch dummy} %{!?make: %define make make} %define makeflags %{?_smp_mflags} ARCH=%{ARCH} @@ -55,9 +57,6 @@ $S BuildRequires: bc binutils bison dwarves $S BuildRequires: (elfutils-libelf-devel or libelf-devel) flex $S BuildRequires: gcc make openssl openssl-devel perl python3 rsync - # $UTS_MACHINE as a fallback of _arch in case - # /usr/lib/rpm/platform/*/macros was not included. - %{!?_arch: %define _arch $UTS_MACHINE} %define __spec_install_post /usr/lib/rpm/brp-compress || : %define debug_package %{nil}