Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 352353 - crossdev-*: setting wrong E_MACHINE for i?86 and CHOST arch in crossdev scripts
Summary: crossdev-*: setting wrong E_MACHINE for i?86 and CHOST arch in crossdev scripts
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Embedded Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-21 18:30 UTC by Jörg Bachmann
Modified: 2011-01-24 22:29 UTC (History)
1 user (show)

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


Attachments
patch for emerge-wrapper (emerge-wrapper.chost_and_e_machine_bugfix.patch,613 bytes, patch)
2011-01-21 18:32 UTC, Jörg Bachmann
Details | Diff
patch for emerge-wrapper (emerge-wrapper.chost_and_e_machine_bugfix.patch,614 bytes, patch)
2011-01-22 08:22 UTC, Jörg Bachmann
Details | Diff
patch for emerge-wrapper, corrects setting of E_MACHINE and CHOST (emerge-wrapper.chost_and_e_machine_bugfix.patch,613 bytes, patch)
2011-01-22 08:25 UTC, Jörg Bachmann
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jörg Bachmann 2011-01-21 18:30:47 UTC
emerge-wrapper (part of crossdev) sets the wrong E_MACHINE for i386,...,i686 and no CHOST (leaves it as atom __CHOST__).
in make.conf there will be

CHOST=__CHOST__
E_MACHINE=EM_X86

for all of them. compiling allways throws (confusing) errors, telling

* Wrong EM_TYPE. Expected EM_X86
EM_386 ./usr/lib/libform.so.5.7
EM_386 ./usr/lib/libpanel.so.5.7
EM_386 ./usr/lib/libmenu.so.5.7
...

then. changing it to

E_MACHINE=i386

corrects this behaviour. the patch for emerge-wrapper is pretty simple.

--- emerge-wrapper.orig	2011-01-21 18:41:44.060000001 +0100
+++ emerge-wrapper	2011-01-21 20:29:59.910000002 +0100
@@ -53,6 +53,7 @@
 		hppa)  E_MACHINE=PARISC ;;
 		ia64)  E_MACHINE=IA_64  ;;
 		m68k)  E_MACHINE=68K    ;;
+		i?86)  E_MACHINE=386    ;;
 		*)     E_MACHINE=`echo ${ARCH} | tr '[:lower:]' '[:upper:]'` ;;
 	esac
 	E_MACHINE="EM_${E_MACHINE}"
@@ -69,6 +70,7 @@
 		-e "s:__E_MACHINE__:${E_MACHINE}:g" \
 		-e "s:__ARCH__:${ARCH}:g" \
 		-e "s:__CBUILD__:${CBUILD}:g" \
+		-e "s:__CHOST__:${CHOST}:g" \
 		"${conf}"
 	[[ ${EM_MACHINE} == "EM_UNKNOWN" ]] \
 		&& sed -i '/^E_MACHINE/s:^:#:' "${conf}"


Reproducible: Always

Steps to Reproduce:
1. crossdev -S -t i585-pc-linux-gnu
2. emerge-i585-pc-linux-gnu bash
Comment 1 Jörg Bachmann 2011-01-21 18:32:36 UTC
Created attachment 260458 [details, diff]
patch for emerge-wrapper
Comment 2 Jörg Bachmann 2011-01-22 08:22:43 UTC
Created attachment 260484 [details, diff]
patch for emerge-wrapper

"typo" in last patch, this one is correct (tested), sorry
Comment 3 Jörg Bachmann 2011-01-22 08:25:13 UTC
Created attachment 260485 [details, diff]
patch for emerge-wrapper, corrects setting of E_MACHINE and CHOST