From patchwork Mon Nov 11 16:47:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 290391 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 794852C008C for ; Tue, 12 Nov 2013 03:47:51 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 9FFA78D07D; Mon, 11 Nov 2013 16:47:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id j5eGvDqZ6qXD; Mon, 11 Nov 2013 16:47:47 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 90AA18CAC5; Mon, 11 Nov 2013 16:47:47 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id B3CAE1BF855 for ; Mon, 11 Nov 2013 16:47:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id B095F93B8F for ; Mon, 11 Nov 2013 16:47:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YWeVnNsAyMcE for ; Mon, 11 Nov 2013 16:47:43 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (top.free-electrons.com [176.31.233.9]) by hemlock.osuosl.org (Postfix) with ESMTP id 17B4993AA4 for ; Mon, 11 Nov 2013 16:47:43 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 106) id 53779868; Mon, 11 Nov 2013 17:47:44 +0100 (CET) Received: from localhost (AToulouse-651-1-90-186.w90-16.abo.wanadoo.fr [90.16.209.186]) by mail.free-electrons.com (Postfix) with ESMTPSA id 0DDC57CA for ; Mon, 11 Nov 2013 17:47:44 +0100 (CET) From: Thomas Petazzoni To: buildroot@uclibc.org Date: Mon, 11 Nov 2013 17:47:25 +0100 Message-Id: <1384188459-1332-2-git-send-email-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1384188459-1332-1-git-send-email-thomas.petazzoni@free-electrons.com> References: <1384188459-1332-1-git-send-email-thomas.petazzoni@free-electrons.com> Subject: [Buildroot] [PATCH 01/15] core: add BR2_HOSTARCH_NEEDS_IA32_COMPILER option X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net Some bootloaders (such as Grub) need to be built for x86 (i.e IA32) even if the target architecture is x86-64. However, when the target architecture is x86-64, the cross-compiler generated by Buildroot is not able to generate 32 bits code. To solve this, we will rely on the host compiler being a x86 + x86-64 compiler. Therefore, this commit introduces the BR2_HOSTARCH_NEEDS_IA32_COMPILER option, which tells the dependency checking logic to verify that the host compiler is indeed capable of building x86 32 bits code. Signed-off-by: Thomas Petazzoni --- Config.in | 6 ++++++ support/dependencies/dependencies.sh | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/Config.in b/Config.in index af720ec..8716687 100644 --- a/Config.in +++ b/Config.in @@ -20,6 +20,12 @@ config BR2_HOSTARCH config BR2_HOSTARCH_NEEDS_IA32_LIBS bool +# Hidden boolean selected by packages that need to build 32 bits +# binaries with the host compiler, even on 64 bits build machines (e.g +# bootloaders). +config BR2_HOSTARCH_NEEDS_IA32_COMPILER + bool + source "arch/Config.in" menu "Build options" diff --git a/support/dependencies/dependencies.sh b/support/dependencies/dependencies.sh index b563f60..32b8fea 100755 --- a/support/dependencies/dependencies.sh +++ b/support/dependencies/dependencies.sh @@ -186,6 +186,15 @@ if grep -q ^BR2_HOSTARCH_NEEDS_IA32_LIBS=y $BUILDROOT_CONFIG ; then fi fi +if grep -q ^BR2_HOSTARCH_NEEDS_IA32_COMPILER=y $BUILDROOT_CONFIG ; then + if ! echo "int main(void) {}" | gcc -m32 -x c - ; then + /bin/echo -e "\nYour Buildroot configuration needs a compiler capable of building 32 bits binaries." + /bin/echo -e "If you're running a Debian/Ubuntu distribution, install the gcc-multilib package." + /bin/echo -e "For other distributions, refer to their documentation." + exit 1 + fi +fi + # Check that the Perl installation is complete enough to build # host-autoconf. if ! perl -e "require Data::Dumper" > /dev/null 2>&1 ; then