Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[unsolved] Change CHOST not working
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
MarcusXP
Apprentice
Apprentice


Joined: 18 Apr 2007
Posts: 237
Location: Toronto, ON, Canada

PostPosted: Mon May 31, 2010 3:01 am    Post subject: [unsolved] Change CHOST not working Reply with quote

hey there,

I am trying to recompile my gentoo x64 into 32bit.
I am following the guide here (regarding changing the CHOST flags):
http://www.gentoo.org/doc/en/change-chost.xml

So I changed the CHOST to "i686-pc-linux-gnu", and the CFLAGS to "-march=prescott -O2 -pipe -fomit-frame-pointer"
When I run the command: "emerge -av1 binutils gcc glibc"
it crashes when copiling the first package (binutils) with the following errors:

Code:
checking for C compiler default output file name...
configure: error: in `/var/tmp/portage/sys-devel/binutils-2.20.1/work/build':
configure: error: C compiler cannot create executables
See `config.log' for more details.
 * ERROR: sys-devel/binutils-2.20.1 failed:
 *   configure failed
 *
 * Call stack:
 *     ebuild.sh, line   48:  Called src_compile
 *   environment, line 3381:  Called toolchain-binutils_src_compile
 *   environment, line 4017:  Called die
 * The specific snippet of code:
 *       "${S}"/configure ${myconf} || die "configure failed";
 *
 * If you need support, post the output of 'emerge --info =sys-devel/binutils-2.20.1',
 * the complete build log and the output of 'emerge -pqv =sys-devel/binutils-2.20.1'.
 * The complete build log is located at '/var/tmp/portage/sys-devel/binutils-2.20.1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-devel/binutils-2.20.1/temp/environment'.
 * S: '/var/tmp/portage/sys-devel/binutils-2.20.1/work/binutils-2.20.1'

>>> Failed to emerge sys-devel/binutils-2.20.1, Log file:

>>>  '/var/tmp/portage/sys-devel/binutils-2.20.1/temp/build.log'

 * Messages for package sys-devel/binutils-2.20.1:

 * ERROR: sys-devel/binutils-2.20.1 failed:
 *   configure failed
 *
 * Call stack:
 *     ebuild.sh, line   48:  Called src_compile
 *   environment, line 3381:  Called toolchain-binutils_src_compile
 *   environment, line 4017:  Called die
 * The specific snippet of code:
 *       "${S}"/configure ${myconf} || die "configure failed";


a little bit before that, I see that the CFLAGS are still the old ones (-march=prescott -O2 -pipe), although I changed them in make.conf and even I rebooted the computer, it does the same thing:
Code:
 *  CATEGORY: sys-devel
 *    CBUILD: i686-pc-linux-gnu
 *     CHOST: i686-pc-linux-gnu
 *   CTARGET: i686-pc-linux-gnu
 *    CFLAGS:  -march=prescott -O2 -pipe
 *   LDFLAGS: -Wl,-O1


so why when compiling this package, it reads the old CFLAGS???

this is my make.conf file:

Code:
CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
# WARNING: Changing your CHOST is not something that should be done lightly.
# Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing.
CHOST="i686-pc-linux-gnu"
# These are the USE flags that were used in addition to what is provided by the
# profile used for building.
USE="acpi apm java dbus symlink mng mmx sse sse2 hal svg qt3 qt3support qt4 X xorg kde kdeprefix opengl nvidia xvmc dv dvd dts alsa cdr dri nptl mp2 mp3 mp4 midi xvid x264 jpeg png nls samba nfs sql mysql glib glitz gtk xcb mysql webkit -gnome -3dfx -debug -dmx -kdrive -minimal -sdl -xprint"

MAKEOPTS="-j9"
INPUT_DEVICES="evdev synaptics"
VIDEO_CARDS="nvidia"
SYNC="rsync://10.10.10.11/gentoo-portage"
PORTDIR=/usr/portage
DISTDIR=${PORTDIR}/distfiles
PORTDIR_OVERLAY=/usr/local/portage
#ACCEPT_KEYWORDS="~amd64"
ACCEPT_LICENSE="*"


Any help would be greatly appreciated.


THANK YOU!


Last edited by MarcusXP on Fri Jun 04, 2010 2:07 am; edited 1 time in total
Back to top
View user's profile Send private message
MarcusXP
Apprentice
Apprentice


Joined: 18 Apr 2007
Posts: 237
Location: Toronto, ON, Canada

PostPosted: Mon May 31, 2010 3:08 am    Post subject: Reply with quote

I checked about the error "configure: error: C compiler cannot create executables " and it seems to be related to the CFLAGS being wrong, which makes sense, since I changed them and it's still getting wrong ones (that were for amd64, not i686).

My CPU is Xeon E5420 (quad core):

Code:

server ~ # cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 23
model name      : Intel(R) Xeon(R) CPU           E5420  @ 2.50GHz
stepping        : 6
cpu MHz         : 23667.000
cache size      : 6144 KB
physical id     : 0
siblings        : 4
core id         : 3
cpu cores       : 4
apicid          : 3
initial apicid  : 3
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 lahf_lm tpr_shadow vnmi flexpriority
bogomips        : 4987.25
clflush size    : 64
cache_alignment : 64
address sizes   : 38 bits physical, 48 bits virtual
power management:


and according to this link:
http://en.gentoo-wiki.com/wiki/Safe_Cflags/Intel#Intel_Core_Solo.2FDuo.2C_Pentium_Dual-Core_T20xx.2FT21xx

these are the CFLAGS to be used:

Code:
Core 2 Duo/Quad, Xeon 51xx/53xx/54xx, Pentium Dual-Core T23xx+/Exxxx, Celeron Dual-Core

vendor_id  : GenuineIntel
cpu family  : 6
model  : 15
model name  : Intel(R) Core(TM)2 CPU XXXX @ XXXGHz

32 bit profile (x86):

CHOST="i686-pc-linux-gnu"
CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"

64 bit profile (amd64):

CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=nocona -O2 -pipe"
CXXFLAGS="${CFLAGS}"
Back to top
View user's profile Send private message
alacheesu
Tux's lil' helper
Tux's lil' helper


Joined: 01 Jun 2005
Posts: 113

PostPosted: Mon May 31, 2010 3:40 am    Post subject: Reply with quote

Reinstalling would probably be the best. I don't think the guide is meant for changing from 32-bit to 64-bit or vice versa, but for less "dangerous" changes like i386 to i686. I'm not an expert on this, but AFAIK there's no simple way to change between 32-bit and 64-bit without reinstalling.
Back to top
View user's profile Send private message
cach0rr0
Bodhisattva
Bodhisattva


Joined: 13 Nov 2008
Posts: 4123
Location: Houston, Republic of Texas

PostPosted: Mon May 31, 2010 9:47 am    Post subject: Reply with quote

if your cpu supports it, there's no reason to go back to a 32bit install.
a few years ago yes, today no

there are the requisite 32bit emulation libraries for everything under the sun, and theyre pulled automatically through portage. even 32bit flash should operate fine.
_________________
Lost configuring your system?
dump lspci -n here | see Pappy's guide | Link Stash
Back to top
View user's profile Send private message
xaviermiller
Bodhisattva
Bodhisattva


Joined: 23 Jul 2004
Posts: 8723
Location: ~Brussels - Belgique

PostPosted: Mon May 31, 2010 10:36 am    Post subject: Reply with quote

Hello,

The x86_64 and i686 architectures are too different to be able to change the CHOST from 64 to 32 bits. This operation is impossible, you will need to install a new 32 bits version from a fresh stage3.
_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Mon May 31, 2010 11:07 am    Post subject: Reply with quote

MarcusXP wrote:

Code:

cpu MHz         : 23667.000


:D i want one like that too !


don't trust the wiki, -march is valid for a cpu for 32 or 64bits, so using the same -march for both will work, just take the good one for your cpu without taking care of 32 or 64bits.
It's CHOST that will define if your env will be 32 or 64bits, not the -march flags

So using nocona for 64 and using prescott for 32bits is stupid, use nocona for both.

On another note, if cpu family 6 = core2 cpu than you better use -march=core2 (again, i repeat myself, for 32 or 64 bits env)
And last, if you are not sure who you should trust, you might just trust gcc and use -march=native.
Back to top
View user's profile Send private message
xaviermiller
Bodhisattva
Bodhisattva


Joined: 23 Jul 2004
Posts: 8723
Location: ~Brussels - Belgique

PostPosted: Mon May 31, 2010 11:14 am    Post subject: Reply with quote

i use "-march=native" everywhere
_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
MarcusXP
Apprentice
Apprentice


Joined: 18 Apr 2007
Posts: 237
Location: Toronto, ON, Canada

PostPosted: Mon May 31, 2010 11:30 am    Post subject: Reply with quote

XavierMiller wrote:
Hello,

The x86_64 and i686 architectures are too different to be able to change the CHOST from 64 to 32 bits. This operation is impossible, you will need to install a new 32 bits version from a fresh stage3.


I don't know what to say about that.. the guide doesn't say anything about it.
And this doesn't explain why binutils is using wrong flags, does it? I think there is something to look into right there.

cach0rr0 wrote:
if your cpu supports it, there's no reason to go back to a 32bit install.
a few years ago yes, today no

there are the requisite 32bit emulation libraries for everything under the sun, and theyre pulled automatically through portage. even 32bit flash should operate fine.


Why I am trying to go back is not relevant. But if you want to know, I want to have a "clone" of the system on a new hard drive, but in 32bit version. (for benchmarking reasons)
I cloned the hard drive on another one using DD and systemrescuecd, and now I am trying to convert the "clone" to 32bit.
Maybe this is wrong way to do it? I could just try a clean install and using the other world file to install the exact same package?

I will try "-march=native" and "-march=core2", as per later suggestions, and see how it works

thanks a lot for your input so far!
Back to top
View user's profile Send private message
MarcusXP
Apprentice
Apprentice


Joined: 18 Apr 2007
Posts: 237
Location: Toronto, ON, Canada

PostPosted: Mon May 31, 2010 11:41 am    Post subject: Reply with quote

Quote:
I will try "-march=native" and "-march=core2", as per later suggestions, and see how it works


binutils failed compiling while using both; the good part is that it is using the correct CFLAGS this time (whatever I had set in make.conf), but it still fails with the same error.. "configure: error: C compiler cannot create executables"
Maybe I need to "manually" install a 32bit GCC and choose that one as default, but that is a bit more difficult for my skills :)
A clean install might be what I need, it seems..
Back to top
View user's profile Send private message
xaviermiller
Bodhisattva
Bodhisattva


Joined: 23 Jul 2004
Posts: 8723
Location: ~Brussels - Belgique

PostPosted: Mon May 31, 2010 11:42 am    Post subject: Reply with quote

Hello,

The guide was written for migrate old Gentoo with i486 CHOST to i686. Not from AMD64 to i686.
This is quite old (dated 2008), and was not updated to warn the reader about it.

Believe me, the architectures are too different, this is almost as cross-compile.
_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum