Message ID | 20230312200731.599706-4-masahiroy@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp861146wrd; Sun, 12 Mar 2023 13:16:43 -0700 (PDT) X-Google-Smtp-Source: AK7set8ATnk9piEbn8TjD8AZsB4j2Al/48BTPzlcRA5mtZH/M8Tx8LgsVgY6drzyoo02oEEd747A X-Received: by 2002:a05:6a20:8e10:b0:cb:f76c:e1a8 with SMTP id y16-20020a056a208e1000b000cbf76ce1a8mr9695064pzj.15.1678652203483; Sun, 12 Mar 2023 13:16:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678652203; cv=none; d=google.com; s=arc-20160816; b=pU4u1PFN2Slz86VLYrvTiMvh6WmcNV+HO+xmYUugEsO1/ZkG6X0AM2goPH4IsPL3Mt LpwkwhCCaSGXcwI4dizJvZfrPheDj9eqx8C432IpGVcLp7cHidV/oXY/53CJqx6p8+FS ORyMO2gPBXLqPPWWy3YkM3JGiBLCcslxfqDCZaso4NATEnvUAW7eH4xYRc0M7TPvczi9 UILeb0nHViB5EapaccC3d4FCx+4YeEf+8wdbd1vuSpWMX6fjvb5cRq1A7s4rcaMa1Omv uY32zlInI/NjvGuIlVoNILql8wR3TOFwEQYTq11JQaZu9LnmUN0wohDiiB0CEIRTOuwE 3WPw== 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=Ey3ghlrHhq0Yh1FISaoxV+FcuAIOOrpv3eLQ+2QcA5s=; b=cUKbv/wKMZcQxZkdmRK+FX+Jac61foMUk/K9NdrRJjYaIWpkZnT0fopB3yDmg3nQF3 Ac4LwEVbxRC7gSf0Aa2C0z0OYbWx3IRQDebWy7KuQBF3DYE3i7Y5LdT3T5Q4uNRJjjX+ ngAo4VfnU668H9gFZsUWhfJ68pPv3TOLEnxYHL1+85trqhJcwluFA/e13M9MUo7Iv7d5 IGoqRC/pWAXehQzoKy2z856Cgt9xeZCB6Tap+nEC0ungBzvE/1e9cczLz7JCTlXzgL8T tcYjFDpFwWOuy69GwUlclD8SdU65omikz60GAqXXwBYmyswM4NySS8pG8ayy0VHouLD+ qtAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ICqCjNzl; 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 k17-20020a63d851000000b00502f86adf3asi4863969pgj.73.2023.03.12.13.16.31; Sun, 12 Mar 2023 13:16:43 -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=ICqCjNzl; 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 S230501AbjCLUHv (ORCPT <rfc822;realc9580@gmail.com> + 99 others); Sun, 12 Mar 2023 16:07:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229552AbjCLUHq (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 12 Mar 2023 16:07:46 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01B892BEEE; Sun, 12 Mar 2023 13:07:43 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B4FF7B80C63; Sun, 12 Mar 2023 20:07:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 42B51C433A0; Sun, 12 Mar 2023 20:07:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678651661; bh=eb6XlOAtcwsmZEKl2YAULQA72a4PFBl0XG4e86AOG7E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ICqCjNzlG7BWQLdlKpX31emGfOIsOxMXT6zT8FxpAHcTHChHGk0bYhF7OmPqOuw2D 2DyHUx7FZSQUNOUCXpCahhEGayoWM1xj87lExVQTn3tSkaGQSIH8Hn6aTG1F/fcWKq e7pE0cI5aErc9gg5AvEW6rBZ36cqmoc0dX7YvuBNp6T2YsOQyqyuYG31063hO2fqlS dgNPxn7QGynCuOUARe0F5qqKCChLundrYQ564n5WW+8112tkYIC7l+5pbcahPc7Bn7 n7zjuBzgIP33jBSLtNR3MUeuF4auXvgn8sc2vhyHJ3DC7YASAdPxeKZNWQ0B0f28cV uAfScRKIPDnHQ== From: Masahiro Yamada <masahiroy@kernel.org> To: linux-kbuild@vger.kernel.org Cc: Linus Torvalds <torvalds@linux-foundation.org>, 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 3/6] kbuild: deb-pkg: set CROSS_COMPILE only when undefined Date: Mon, 13 Mar 2023 05:07:28 +0900 Message-Id: <20230312200731.599706-4-masahiroy@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230312200731.599706-1-masahiroy@kernel.org> References: <20230312200731.599706-1-masahiroy@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760194412441992213?= X-GMAIL-MSGID: =?utf-8?q?1760194412441992213?= |
Series |
kbuild: fix some packaging issues, and use git-archive for source package
|
|
Commit Message
Masahiro Yamada
March 12, 2023, 8:07 p.m. UTC
Commit 3ab18a625ce4 ("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: 3ab18a625ce4 ("kbuild: deb-pkg: improve the usability of source package")
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
scripts/package/deb-build-option | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/scripts/package/deb-build-option b/scripts/package/deb-build-option index bd53624318f2..7950eff01781 100755 --- a/scripts/package/deb-build-option +++ b/scripts/package/deb-build-option @@ -1,9 +1,8 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0-only -# Set up CROSS_COMPILE if we are cross-compiling, but not called from the -# kernel toplevel Makefile -if [ -z "${CROSS_COMPILE}${cross_compiling}" -a "${DEB_HOST_ARCH}" != "${DEB_BUILD_ARCH}" ]; then +# Set up CROSS_COMPILE if not defined yet +if [ "${CROSS_COMPILE+set}" != "set" -a "${DEB_HOST_ARCH}" != "${DEB_BUILD_ARCH}" ]; then echo CROSS_COMPILE=${DEB_HOST_GNU_TYPE}- fi