linux-stable/scripts/package
Masahiro Yamada f50aa51c44 kbuild: deb-pkg: set CROSS_COMPILE only when undefined
Commit 3ab18a625c ("kbuild: deb-pkg: improve the usability of source
package") set needless CROSS_COMPILE.

For example, 'make allnoconfig bindeb-pkg' on a x86_64 system will set
CROSS_COMPILE=i686-linux-gnu-, where the biarch compiler 'gcc' should
work for building the i386 kernel.

  $ uname -m
  x86_64
  $ make allnoconfig bindeb-pkg >/dev/null
  dpkg-architecture: warning: specified GNU system type i686-linux-gnu does not match CC system type x86_64-linux-gnu, try setting a correct CC environment variable
   dpkg-source --before-build .
   debian/rules binary
  scripts/Kconfig.include:39: C compiler 'i686-linux-gnu-gcc' not found
  make[6]: *** [scripts/kconfig/Makefile:77: olddefconfig] Error 1
  make[5]: *** [Makefile:693: olddefconfig] Error 2
  make[4]: *** [Makefile:358: __build_one_by_one] Error 2
  make[3]: *** [debian/rules:7: build-arch] Error 2
  dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
  make[2]: *** [scripts/Makefile.package:127: bindeb-pkg] Error 2
  make[1]: *** [Makefile:1657: bindeb-pkg] Error 2
  make: *** [Makefile:358: __build_one_by_one] Error 2

Check whether CROSS_COMPILE is defined, instead of whether it is non-empty.

If you invoke debian/rules via Kbuild, CROSS_COMPILE is always defined
in the top Makefile.

Fixes: 3ab18a625c ("kbuild: deb-pkg: improve the usability of source package")
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2023-03-15 15:15:07 +09:00
..
builddeb builddeb: Consolidate consecutive chmod calls into one 2023-01-26 12:43:33 +09:00
buildtar kbuild: tar-pkg: use tar rules in scripts/Makefile.package 2023-02-26 15:23:30 +09:00
deb-build-option kbuild: deb-pkg: set CROSS_COMPILE only when undefined 2023-03-15 15:15:07 +09:00
mkdebian kbuild: deb-pkg: do not take KERNELRELEASE from the source version 2023-03-15 15:15:07 +09:00
mkspec kbuild: rpm-pkg: remove unneeded KERNELRELEASE from modules/headers_install 2023-02-26 16:54:12 +09:00
snapcraft.template scripts/package: snap-pkg target 2017-12-13 00:00:18 +09:00