Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 264343 - emerge-wrapper from sys-devel/crossdev-wrappers does not correctly handle CHOST
Summary: emerge-wrapper from sys-devel/crossdev-wrappers does not correctly handle CHOST
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: High normal
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-31 01:24 UTC by T Parys
Modified: 2009-12-09 23:32 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to resolve posed issue (unhandled_chosts.patch,1.54 KB, patch)
2009-03-31 01:25 UTC, T Parys
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description T Parys 2009-03-31 01:24:23 UTC
After installing a crossdev toolchain (i586-unknown-linux-uclibc), 'emerge-wrapper --init' does not correctly detect the toolchain as an x86 ARCH, due to an incorrect logic check. This logic check ( ${chost:3:4} == "86" ) always fails because ${chost:3:4} returns a four character string, and thus is incomparable with the string "86". Furthermore, this is a silent error, and manifests itself by leaving ARCH set to __ARCH__ in the cross compiler toolchain's make.conf, or by changing it to an invalid value (left over from a previous toolchain configuration, such as arm-unknown-linux-uclibc). The error is visible later, as emerging anything with this cross compiler toolchain results in a failure, as portage does not recognize the incorrect ARCH.

While fixing the comparison addresses this issue ( ${chost:2:2} == "86" ), it still leaves the tool to fail silently if the user uses a unhandled toolchain. As such, this patch changes the block if statements to a single case statement, with a fall-through case, which will notify the user that something has not gone well.

Reproducible: Always

Steps to Reproduce:
1. emerge crossdev
2. run " crossdev i586-unknown-linux-uclibc " (takes a while)
3. emerge crossdev-wrappers (or run emerge-wrapper --init)
4. inspect /usr/i586-unknown-linux-uclibc/etc/make.conf, and check ARCH

Actual Results:  
Subsequent emerges using the cross compiler toolchain fail, as ARCH is incorrectly set.

Expected Results:  
Script should set ARCH correctly, at least for known CHOST tuples.
Comment 1 T Parys 2009-03-31 01:25:42 UTC
Created attachment 186823 [details, diff]
Patch to resolve posed issue
Comment 2 SpanKY gentoo-dev 2009-12-09 23:32:59 UTC
ive never used emerge-wrapper and dont really know what it's for, but your patch looks sane in general, so i've added it

http://sources.gentoo.org/gentoo-projects/crossdev-wrappers/emerge-wrapper?r1=1.6&r2=1.7