From patchwork Sat Dec 29 16:14:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 208669 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id 12EB82C00B2 for ; Sun, 30 Dec 2012 03:15:49 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 8C37E1004CF; Sat, 29 Dec 2012 16:15:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id a+UX3jMkUOTx; Sat, 29 Dec 2012 16:15:36 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id EAB79101538; Sat, 29 Dec 2012 16:15:35 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id AD9468F753 for ; Sat, 29 Dec 2012 16:15:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id CE49F8B2B6 for ; Sat, 29 Dec 2012 16:15:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dJHR+H-OzEGf for ; Sat, 29 Dec 2012 16:15:37 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (mail.free-electrons.com [94.23.32.191]) by whitealder.osuosl.org (Postfix) with ESMTP id DBFED81444 for ; Sat, 29 Dec 2012 16:15:36 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 106) id 403C522F; Sat, 29 Dec 2012 17:15:36 +0100 (CET) Received: from localhost (unknown [37.160.1.98]) by mail.free-electrons.com (Postfix) with ESMTPSA id DCF08199 for ; Sat, 29 Dec 2012 17:15:29 +0100 (CET) From: Thomas Petazzoni To: buildroot@busybox.net Date: Sat, 29 Dec 2012 17:14:49 +0100 Message-Id: <1fabfe7c83a700bce7a8f77e19a304ace407a96b.1356797653.git.thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Subject: [Buildroot] [PATCH 2/4] Infrastructure to warn the user about missing 32 bits libraries 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 Many users trying to use external toolchains on x86-64 machines get a very confusing message: "Can't execute cross-compiler" They get this message because they forgot to install the 32 bits compatibility libraries that are needed to run binaries compiled for x86 on x86-64 machines. Since this is the case for both external toolchains and certain binary-only tools like SAM-BA, we add a new Kconfig option BR2_HOSTARCH_NEEDS_IA32_LIBS, that packages must select if they need the 32 bits compatibility libraries. When this option is enabled, dependencies.sh checks that the 32 bits dynamic library loader is present on the system, and if not, it stops and shows an error. The path and name of the 32 bits dynamic loader is hardcoded because it is very unlikely to change, as it would break the ABI for all binaries. Also, it is worth noting that the check will be done even if we're running on a 32 bits machine. This is harmless, as 32 bits machines necessarily have the 32 bits dynamic loader installed, so the error will never show up in this case. Signed-off-by: Thomas Petazzoni Acked-by: Arnout Vandecappelle (Essensium/Mind) --- Config.in | 6 ++++++ support/dependencies/dependencies.sh | 11 +++++++++++ 2 files changed, 17 insertions(+) diff --git a/Config.in b/Config.in index b319ac7..af77a83 100644 --- a/Config.in +++ b/Config.in @@ -14,6 +14,12 @@ config BR2_HOSTARCH string option env="HOSTARCH" +# Hidden boolean selected by pre-built packages for x86, when they +# need to run on x86-64 machines (example: pre-built external +# toolchains, binary tools like SAM-BA, etc.). +config BR2_HOSTARCH_NEEDS_IA32_LIBS + bool + source "arch/Config.in" menu "Build options" diff --git a/support/dependencies/dependencies.sh b/support/dependencies/dependencies.sh index 7a02512..03e2742 100755 --- a/support/dependencies/dependencies.sh +++ b/support/dependencies/dependencies.sh @@ -166,3 +166,14 @@ if grep -q ^BR2_PACKAGE_CLASSPATH=y $CONFIG_FILE ; then fi done fi +if grep -q ^BR2_HOSTARCH_NEEDS_IA32_LIBS=y $CONFIG_FILE ; then + if test ! -f /lib/ld-linux.so.2 ; then + /bin/echo -e "\nYour Buildroot configuration uses some pre-built tools for the x86 architecture," + /bin/echo -e "but your build machine uses the x86-64 architecture without the 32 bits compatibility" + /bin/echo -e "library." + /bin/echo -e "If you're running a Debian/Ubuntu distribution, install the libc:i386 package." + /bin/echo -e "For other distributions, refer to the documentation on how to install the 32 bits" + /bin/echo -e "compatibility libraries." + exit 1 + fi +fi