All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 2/4] Infrastructure to warn the user about missing 32 bits libraries
Date: Mon, 07 Jan 2013 08:55:06 +0100	[thread overview]
Message-ID: <50EA7F5A.4070200@mind.be> (raw)
In-Reply-To: <1fabfe7c83a700bce7a8f77e19a304ace407a96b.1356797653.git.thomas.petazzoni@free-electrons.com>

On 12/29/12 17:14, Thomas Petazzoni wrote:
> 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

  Since x86_64 is also an IA32, I would rather call it 
BR2_HOSTARCH_NEEDS_I386_LIBS.

> 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.

  Perhaps move these two comments to dependencies.sh so we don't forget 
about it?

>
> Signed-off-by: Thomas Petazzoni<thomas.petazzoni@free-electrons.com>

Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

> ---
>   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"

  This line is more than 80 columns.

> +	/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."

  "the documentation" sounds as if it is the buildroot documentation, so 
make it "refer to your distribution's documentation"

  Also this is only for relatively recent Debian/Ubuntu with full 
multilib support. Before that it was called libc-i386 IIRC.

  Is there anyone out there with a Redhat/Fedora who can tell us how to 
install it there?

  And finally, it would be good to mention this in
docs/manual/prerequisite.txt


  Regards,
  Arnout

> +	exit 1
> +    fi
> +fi


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

  reply	other threads:[~2013-01-07  7:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-29 16:14 [Buildroot] [pull request] Pull request for branch pre-built-packages Thomas Petazzoni
2012-12-29 16:14 ` [Buildroot] [PATCH 1/4] toolchain-external: add dependency on BR2_HOST_ARCH Thomas Petazzoni
2012-12-29 16:14 ` [Buildroot] [PATCH 2/4] Infrastructure to warn the user about missing 32 bits libraries Thomas Petazzoni
2013-01-07  7:55   ` Arnout Vandecappelle [this message]
2012-12-29 16:14 ` [Buildroot] [PATCH 3/4] toolchain-external: use BR2_HOSTARCH_NEEDS_IA32_LIBS where needed Thomas Petazzoni
2012-12-29 16:14 ` [Buildroot] [PATCH 4/4] sam-ba: select BR2_HOSTARCH_NEEDS_IA32_LIBS Thomas Petazzoni
2013-01-06 15:43 ` [Buildroot] [pull request] Pull request for branch pre-built-packages Thomas Petazzoni
2013-01-06 20:43 ` Peter Korsgaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50EA7F5A.4070200@mind.be \
    --to=arnout@mind.be \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.