Patchwork populate_sdk_base.bbclass: Allow installation of ix86 SDK on x86_64 host

login
register
mail settings
Submitter Wolfgang Denk
Date Jan. 22, 2013, 12:18 p.m.
Message ID <1358857085-16549-1-git-send-email-wd@denx.de>
Download mbox | patch
Permalink /patch/43185/
State Accepted
Commit c3256233c6ce27e8ef0cecfbd4939bb3bedc16ad
Headers show

Comments

Wolfgang Denk - Jan. 22, 2013, 12:18 p.m.
Commit c04f5435 "populate_sdk_base.bbclass: use SDK_ARCH instead
of SDKMACHINE" prevents not only the installation of 64 bit SDK
configurations on 32 bit hosts (which indeed cannot work), but also
the legitimate installation of a 32 bit SDK on a 64 bit host.

Fix this.

While there, also make sure we use the same patterns ("i[3-6]86" resp.
"x86[-_]64" to get unified strings for both INST_ARCH and SDK_ARCH.

Signed-off-by: Wolfgang Denk <wd@denx.de>
---
 meta/classes/populate_sdk_base.bbclass | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
Mark Hatle - Jan. 22, 2013, 4:13 p.m.
On 1/22/13 6:18 AM, Wolfgang Denk wrote:
> Commit c04f5435 "populate_sdk_base.bbclass: use SDK_ARCH instead
> of SDKMACHINE" prevents not only the installation of 64 bit SDK
> configurations on 32 bit hosts (which indeed cannot work), but also
> the legitimate installation of a 32 bit SDK on a 64 bit host.
>
> Fix this.
>
> While there, also make sure we use the same patterns ("i[3-6]86" resp.
> "x86[-_]64" to get unified strings for both INST_ARCH and SDK_ARCH.

As far as I am aware, this is intentional.  For various SDK items 
pseudo/libpseudo may be used.  On a 32-bit SDK, only a 32-bit pseudo/libpseudo 
is available.  This will prevent it from working with any host system binaries 
that are x86_64.

If you don't care, the "workaround" is to use setarch and install it by telling 
the system you are an ix86 target.

--Mark

> Signed-off-by: Wolfgang Denk <wd@denx.de>
> ---
>   meta/classes/populate_sdk_base.bbclass | 9 ++++++---
>   1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass
> index da846b4..c587af8 100644
> --- a/meta/classes/populate_sdk_base.bbclass
> +++ b/meta/classes/populate_sdk_base.bbclass
> @@ -122,11 +122,14 @@ fakeroot create_shar() {
>   #!/bin/bash
>
>   INST_ARCH=$(uname -m | sed -e "s/i[3-6]86/ix86/" -e "s/x86[-_]64/x86_64/")
> -SDK_ARCH=$(echo ${SDK_ARCH} | sed -e "s/i[5-6]86/ix86/")
> +SDK_ARCH=$(echo ${SDK_ARCH} | sed -e "s/i[3-6]86/ix86/" -e "s/x86[-_]64/x86_64/")
>
>   if [ "$INST_ARCH" != "$SDK_ARCH" ]; then
> -	echo "Error: Installation machine not supported!"
> -	exit 1
> +	# Allow for installation of ix86 SDK on x86_64 host
> +	if [ "$INST_ARCH" != x86_64 -o "$SDK_ARCH" != ix86 ]; then
> +		echo "Error: Installation machine not supported!"
> +		exit 1
> +	fi
>   fi
>
>   DEFAULT_INSTALL_DIR="${SDKPATH}"
>
Laurentiu Palcu - Jan. 24, 2013, 9:23 a.m.
On 01/22/2013 06:13 PM, Mark Hatle wrote:
> On 1/22/13 6:18 AM, Wolfgang Denk wrote:
>> > Commit c04f5435 "populate_sdk_base.bbclass: use SDK_ARCH instead
>> > of SDKMACHINE" prevents not only the installation of 64 bit SDK
>> > configurations on 32 bit hosts (which indeed cannot work), but also
>> > the legitimate installation of a 32 bit SDK on a 64 bit host.
>> >
>> > Fix this.
>> >
>> > While there, also make sure we use the same patterns ("i[3-6]86" resp.
>> > "x86[-_]64" to get unified strings for both INST_ARCH and SDK_ARCH.
> As far as I am aware, this is intentional.  For various SDK items 
> pseudo/libpseudo may be used.  On a 32-bit SDK, only a 32-bit pseudo/libpseudo 
> is available.  This will prevent it from working with any host system binaries 
> that are x86_64.
> 
> If you don't care, the "workaround" is to use setarch and install it by telling 
> the system you are an ix86 target.
> 
> --Mark
> 
>> > 
Hi Mark,

There was a discussion on the yocto mailing list about this:
https://lists.yoctoproject.org/pipermail/yocto/2013-January/013889.html

Also, a bug filed:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=3770

It turns out that people would like to be able to install 32-bit SDKs on
64-bit machines. Provided they have the 32-bit libraries in place.

Thanks,
Laurentiu

Patch

diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass
index da846b4..c587af8 100644
--- a/meta/classes/populate_sdk_base.bbclass
+++ b/meta/classes/populate_sdk_base.bbclass
@@ -122,11 +122,14 @@  fakeroot create_shar() {
 #!/bin/bash
 
 INST_ARCH=$(uname -m | sed -e "s/i[3-6]86/ix86/" -e "s/x86[-_]64/x86_64/")
-SDK_ARCH=$(echo ${SDK_ARCH} | sed -e "s/i[5-6]86/ix86/")
+SDK_ARCH=$(echo ${SDK_ARCH} | sed -e "s/i[3-6]86/ix86/" -e "s/x86[-_]64/x86_64/")
 
 if [ "$INST_ARCH" != "$SDK_ARCH" ]; then
-	echo "Error: Installation machine not supported!"
-	exit 1
+	# Allow for installation of ix86 SDK on x86_64 host
+	if [ "$INST_ARCH" != x86_64 -o "$SDK_ARCH" != ix86 ]; then
+		echo "Error: Installation machine not supported!"
+		exit 1
+	fi
 fi
 
 DEFAULT_INSTALL_DIR="${SDKPATH}"