From patchwork Thu Aug 23 16:42:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seth Forshee X-Patchwork-Id: 961484 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41x9Fh06bGz9s2P; Fri, 24 Aug 2018 02:43:03 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1fsshF-0004DL-MD; Thu, 23 Aug 2018 16:42:57 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1fsshC-0004Bz-92 for kernel-team@lists.ubuntu.com; Thu, 23 Aug 2018 16:42:54 +0000 Received: from mail-it0-f71.google.com ([209.85.214.71]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1fsshB-0001DV-UL for kernel-team@lists.ubuntu.com; Thu, 23 Aug 2018 16:42:54 +0000 Received: by mail-it0-f71.google.com with SMTP id h17-v6so5730215itj.0 for ; Thu, 23 Aug 2018 09:42:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=2t1tW8O12kthxC1mW2tP2FmKcYPli/g23KxvOhTMJjE=; b=KboEzO114pwoMvJfLnUYHCgAiDqvS+jDy1cUQE16foPqyi+R7hcYiAleQGOsgQvSlG XSKoPPC+wC/o6Wep6Ahsq/NvMROfdIxrlSJSt6aPF6+o8qrVD1Z/U+zvX5gKA5+tCH9Q O5Q2S6ccUE1djffixWC/9KCZAuj+h83Td4Xrgt63EIpezIIXdlmRfCrA128YtG1xKbDK zqpz3AMPkdP1Z5XO85zAdiCtrdotsnzW8HTCuf3cbCgRBJhNX9BUDf6dCoZGyAwaCa/b QKpN2VWnM/ZlYOhgLM82oNNMnR8wV63a6MG7wTGq3XCTjc8sO2Gcyop/6pNKzSxEFCBI JTiQ== X-Gm-Message-State: AOUpUlHJWUjfRokAAGHoHKT/+X4YwBaK4kGkjsUuAX9DDdX1pjyhBBBM RcDvjeDcFB8NQxwu7XwPtegca+eJeDh0M49JGThqsUOOKHvEAXBHsJ1A5gOBzvLYyiEPrliEY4W fQXeNl53EDqPvsmNs5Iu5P8XNNfrYWM1Afopv0EFpjw== X-Received: by 2002:a6b:cac3:: with SMTP id a186-v6mr49693545iog.116.1535042572778; Thu, 23 Aug 2018 09:42:52 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwaUBjYXv7POgJJgaOTk1VwIyGnGUNa8yrn9OYEJgZENH+zVJ4au+ILJGQIx2pG/id2Oxhbqg== X-Received: by 2002:a6b:cac3:: with SMTP id a186-v6mr49693533iog.116.1535042572400; Thu, 23 Aug 2018 09:42:52 -0700 (PDT) Received: from localhost ([2605:a601:ac7:2a20:bc49:5962:7730:d134]) by smtp.gmail.com with ESMTPSA id b85-v6sm2266293itd.37.2018.08.23.09.42.51 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Aug 2018 09:42:51 -0700 (PDT) From: Seth Forshee To: kernel-team@lists.ubuntu.com Subject: [RFC 1/1][Unstable] UBUNTU: [Debian] set CROSS_COMPILE when generating kernel configs Date: Thu, 23 Aug 2018 11:42:50 -0500 Message-Id: <20180823164250.23603-2-seth.forshee@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180823164250.23603-1-seth.forshee@canonical.com> References: <20180823164250.23603-1-seth.forshee@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" Recently Kconfig files have started using scripts which test compiler features to set config values, e.g. on powerpc: config MPROFILE_KERNEL depends on PPC64 && CPU_LITTLE_ENDIAN def_bool $(success,$(srctree)/arch/powerpc/tools/gcc-check-mprofile-kernel.sh $(CC) -I$(srctree)/include -D__KERNEL__) These tests may not yield the correct results when the host architecture does not match the kernel target architecture, as is often the case when updating the Ubuntu configs. We will get better results if a cross compiler for the target architecture is used for these tests. Update kernelconfig to set CROSS_COMPILE when invoking config make targets whenever the host architecture does not match the build target architecture. Signed-off-by: Seth Forshee --- debian/scripts/misc/kernelconfig | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/debian/scripts/misc/kernelconfig b/debian/scripts/misc/kernelconfig index 769acbb2ed05..9795f678a9db 100755 --- a/debian/scripts/misc/kernelconfig +++ b/debian/scripts/misc/kernelconfig @@ -54,6 +54,15 @@ for arch in $archs; do *) kernarch="$arch" ;; esac + # Determine cross toolchain to use for Kconfig compiler tests + cross_compile="" + deb_build_arch=$(dpkg-architecture -qDEB_BUILD_ARCH -a$arch 2>/dev/null) + deb_host_arch=$(dpkg-architecture -qDEB_HOST_ARCH -a$arch 2>/dev/null) + [ $deb_build_arch != $deb_host_arch ] && cross_compile="$(dpkg-architecture -qDEB_HOST_GNU_TYPE -a$arch 2>/dev/null)-" + + # Environment variables for 'make *config' + env="ARCH=$kernarch CROSS_COMPILE=$cross_compile" + archconfdir=$confdir/$arch flavourconfigs=$(cd $archconfdir && ls config.flavour.*) @@ -94,13 +103,13 @@ for arch in $archs; do case "$choice" in y* | Y* | "" ) - make O=`pwd`/build ARCH=$kernarch menuconfig + make O=`pwd`/build $env menuconfig break ;; n* | N* ) # 'syncconfig' prevents # errors for '-' options set # in common config fragments - make O=`pwd`/build ARCH=$kernarch syncconfig + make O=`pwd`/build $env syncconfig break ;; *) echo "Entry not valid" @@ -110,9 +119,9 @@ for arch in $archs; do *) echo "* Run $mode (yes=$yes) on $arch/$config ..." if [ "$yes" -eq 1 ]; then - yes "" | make O=`pwd`/build ARCH=$kernarch "$mode" + yes "" | make O=`pwd`/build $env "$mode" else - make O=`pwd`/build ARCH=$kernarch "$mode" + make O=`pwd`/build $env "$mode" fi ;; esac cat build/.config > $archconfdir/$config