mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "chenxiang (M)" <chenxiang66@hisilicon.com>
To: Masahiro Yamada <masahiroy@kernel.org>, <linux-kbuild@vger.kernel.org>
Cc: <linux-kernel@vger.kernel.org>,
	Nathan Chancellor <nathan@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Nicolas Schier <nicolas@fjasle.eu>
Subject: Re: [PATCH 11/19] kbuild: rpm-pkg: use a dummy string for _arch when undefined
Date: Tue, 12 Sep 2023 15:09:10 +0800	[thread overview]
Message-ID: <4780dc94-653b-7ae4-0f50-45af625726e7@hisilicon.com> (raw)
In-Reply-To: <20230722044806.3867434-11-masahiroy@kernel.org>

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}
>   


  reply	other threads:[~2023-09-12  7:09 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-22  4:47 [PATCH 01/19] kbuild: rpm-pkg: define _arch conditionally Masahiro Yamada
2023-07-22  4:47 ` [PATCH 02/19] kbuild: rpm-pkg: remove unneeded '-f $srctree/Makefile' in spec file Masahiro Yamada
2023-07-22  4:47 ` [PATCH 03/19] kbuild: rpm-pkg: do not hard-code $MAKE " Masahiro Yamada
2023-07-22  4:47 ` [PATCH 04/19] kbuild: rpm-pkg: use %{makeflags} to pass common Make options Masahiro Yamada
2023-07-22  4:47 ` [PATCH 05/19] kbuild: rpm-pkg: record ARCH option in spec file Masahiro Yamada
2023-07-22  4:47 ` [PATCH 06/19] kbuild: rpm-pkg: replace $__KERNELRELEASE in spec file with %{version} Masahiro Yamada
2023-07-22  4:47 ` [PATCH 07/19] kbuild: rpm-pkg: replace $KERNELRELEASE in spec file with %{KERNELRELEASE} Masahiro Yamada
2023-07-22  4:47 ` [PATCH 08/19] kbuild: add a phony target to run a command with Kbuild env vars Masahiro Yamada
2023-07-24 19:53   ` Nicolas Schier
2023-07-22  4:47 ` [PATCH 09/19] kbuild: refactor kernel-devel RPM package and linux-headers Deb package Masahiro Yamada
2023-07-22  4:47 ` [PATCH 10/19] kbuild: rpm-pkg: derive the Version from %{KERNELRELEASE} Masahiro Yamada
2023-07-22  4:47 ` [PATCH 11/19] kbuild: rpm-pkg: use a dummy string for _arch when undefined Masahiro Yamada
2023-09-12  7:09   ` chenxiang (M) [this message]
2023-09-14  4:58     ` Masahiro Yamada
2023-07-22  4:47 ` [PATCH 12/19] kbuild: rpm-pkg: invoke the kernel build from rpmbuild for binrpm-pkg Masahiro Yamada
2023-07-22  4:48 ` [PATCH 13/19] kbuild: rpm-pkg: run modules_install for non-modular kernel Masahiro Yamada
2023-07-22  4:48 ` [PATCH 14/19] kbuild: rpm-pkg: introduce %{with_devel} switch to select devel package Masahiro Yamada
2023-07-22  4:48 ` [PATCH 15/19] kbuild: rpm-pkg: split out the body of spec file Masahiro Yamada
2023-07-22  4:48 ` [PATCH 16/19] kbuild: rpm-pkg: rename binkernel.spec to kernel.spec Masahiro Yamada
2023-07-22  4:48 ` [PATCH 17/19] kbuild: rpm-pkg: build the kernel in-place for rpm-pkg Masahiro Yamada
2023-07-22  4:48 ` [PATCH 18/19] kbuild: rpm-pkg: refactor *rpm-pkg targets Masahiro Yamada
2023-07-22  4:48 ` [PATCH 19/19] kbuild: rpm-pkg: skip build dependency check on non-rpm systems Masahiro Yamada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4780dc94-653b-7ae4-0f50-45af625726e7@hisilicon.com \
    --to=chenxiang66@hisilicon.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=nicolas@fjasle.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®