Gentoo Forums
Gentoo Forums
Quick Search: in
broke my system after changing CHOST [SOLVED]
View unanswered posts
View posts from last 24 hours

rackathon
 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
opensas
Guru
Guru


Joined: 24 Nov 2004
Posts: 408
Location: Buenos Aires - Argentina

PostPosted: Sat Sep 20, 2008 1:58 am    Post subject: broke my system after changing CHOST [SOLVED] Reply with quote

I changed my CHOST flag, without folloeing the HowTo (yes, I'm guilty!)


I tried to change it from i486-pc-linux-gnu to i686-pc-linux-gnu

now I want to come back to i486, but there's no way i can compile gcc...

here's my make.conf

Code:

..
CFLAGS="-O2 -march=prescott -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"

CHOST="i486-pc-linux-gnu"

MAKEOPTS="-j3"
..


and here's the output of emerge gcc

/var/tmp/portage/sys-devel/gcc-4.1.2/temp/build.log
Code:


..
   --enable-__cxa_atexit
   --enable-clocale=gnu

/var/tmp/portage/sys-devel/gcc-4.1.2/work/gcc-4.1.2/configure --prefix=/usr --bindir=/usr/i486-pc-linux-gnu/gcc-bin/4.1.2 --includedir=/usr/lib/gcc/i486-pc-linux-gnu/4.1.2/include --datadir=/usr/share/gcc-data/i486-pc-linux-gnu/4.1.2 --mandir=/usr/share/gcc-data/i486-pc-linux-gnu/4.1.2/man --infodir=/usr/share/gcc-data/i486-pc-linux-gnu/4.1.2/info --with-gxx-include-dir=/usr/lib/gcc/i486-pc-linux-gnu/4.1.2/include/g++-v4 --host=i486-pc-linux-gnu --build=i486-pc-linux-gnu --disable-altivec --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --enable-secureplt --disable-multilib --enable-libmudflap --disable-libssp --disable-libgcj --with-arch=i486 --enable-languages=c,c++,treelang,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
creating cache ./config.cache
checking host system type... i486-pc-linux-gnu
checking target system type... i486-pc-linux-gnu
checking build system type... i486-pc-linux-gnu
checking for a BSD compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for gcc... gcc
checking whether the C compiler (gcc -O2 -march=prescott -pipe -Wl,-O1) works... no
configure: error: installation or configuration problem: C compiler cannot create executables.
  [31;01m* [0m
  [31;01m* [0m ERROR: sys-devel/gcc-4.1.2 failed.
..


some info from my environment

Code:

ARCH=x86
BINPATH=/usr/i486-pc-linux-gnu/gcc-bin/4.1.2
BRANCH_UPDATE=
BRANDING_GCC_PKGVERSION='Gentoo 4.1.2 p1.1'
CBUILD=i486-pc-linux-gnu
CDEFINE_default=__unix__
CFLAGS='-O2 -march=prescott -pipe -fomit-frame-pointer'
CFLAGS_default=
CHOST=i486-pc-linux-gnu
CHOST_default=i486-pc-linux-gnu
CTARGET=i486-pc-linux-gnu
CTARGET_default=i486-pc-linux-gnu
CVS_RSH=ssh
CXXFLAGS='-O2 -march=prescott -pipe -fomit-frame-pointer'
DATAPATH=/usr/share/gcc-data/i486-pc-linux-gnu/4.1.2
..


and some more info

Code:

gentoo ~ # gcc-config -l
 [1] i486-pc-linux-gnu-4.1.2 *

gentoo ~ # emerge --info
Portage 2.1.4.4 (default/linux/x86/2008.0/desktop, gcc-4.1.2, glibc-2.6.1-r0, 2.6.25-gentoo-r7 i686)
=================================================================
System uname: 2.6.25-gentoo-r7 i686 Intel(R) Core(TM) Duo CPU T2250 @ 1.73GHz
Timestamp of tree: Sat, 20 Sep 2008 04:06:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p33
dev-lang/python:     2.5.2-r7
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r2
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.23-r3
ACCEPT_KEYWORDS="x86"
CBUILD="i486-pc-linux-gnu"
CFLAGS="-O2 -march=prescott -pipe -fomit-frame-pointer"
CHOST="i486-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O2 -march=prescott -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="buildpkg ccache distlocks metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://gentoo.localhost.net.ar/ ftp://mirrors.localhost.net.ar/pub/mirrors/gentoo ftp://distro.ibiblio.org/pub/linux/distributions/gentoo/ http://distro.ibiblio.org/pub/linux/distributions/gentoo/"
LDFLAGS="-Wl,-O1"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage/local/layman/sabayon"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X acl acpi alsa apache2 bash-completion berkdb bluetooth branding bzip2 cairo cdr cli cracklib crypt ctype cups dbus dri dvd dvdr dvdread eds emboss encode esd evo fbcon firefox fortran gdbm gif gpm gstreamer gtk hal iconv ipv6 isdnlog jabber javascript jpeg kde kerberos ldap libnotify mad midi mikmod mozilla mp3 mpeg mudflap mysql mysqli ncurses networkmanager nls nptl nptlonly ogg opengl openmp pam pcre pdf perl png ppds pppd python qt3 qt3support qt4 quicktime rdesktop readline reflection ruby samba sdl session spell spl ssl startup-notification svg sysfs tcpd tiff truetype unicode usb vorbis wifi win32codecs wxwindows x86 xml xorg xv yahoo zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="vga vesa"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS



some more info
Code:

gentoo ~ # find /etc -name *pc-linux*
/etc/eselect/compiler/i486-pc-linux-gnu-4.1.2.conf
/etc/env.d/05gcc-i486-pc-linux-gnu
/etc/env.d/gcc/i486-pc-linux-gnu-4.1.2
/etc/env.d/gcc/config-i486-pc-linux-gnu
/etc/env.d/binutils/config-i686-pc-linux-gnu
/etc/env.d/binutils/config-i486-pc-linux-gnu
/etc/env.d/binutils/i686-pc-linux-gnu-2.18


mmm that /etc/env.d/binutils/i686-pc-linux-gnu-2.18 doesn't look too good...

and this is
/var/tmp/portage/sys-devel/gcc-4.1.2/work/build/config.log

Code:

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

configure:600: checking host system type
configure:621: checking target system type
configure:639: checking build system type
configure:694: checking for a BSD compatible install
configure:747: checking whether ln works
configure:771: checking whether ln -s works
configure:1825: checking for gcc
configure:1938: checking whether the C compiler (gcc -O2 -march=prescott -pipe -Wl,-O1) works
configure:1954: gcc -o conftest -O2 -march=prescott -pipe  -Wl,-O1 conftest.c  1>&5
gcc: error trying to exec 'as': execvp: No such file or directory
configure: failed program was:

#line 1949 "configure"
#include "confdefs.h"

main(){return(0);}


so I guess the error is "gcc: error trying to exec 'as': execvp: No such file or directory"

any idea???


Last edited by opensas on Sat Sep 20, 2008 5:40 am; edited 1 time in total
Back to top
View user's profile Send private message
skellr
Guru
Guru


Joined: 17 Jun 2005
Posts: 536
Location: The Village

PostPosted: Sat Sep 20, 2008 2:36 am    Post subject: Reply with quote

Hi,

Does 'binutils-config -l' list i486* as an option? If not then I would try and recompile binutils with the i486 CHOST and try again.

Edit: I just noticed your other post. You just want to recompile binutils with the CHOST you want to use, then make sure it's selected with binutils-config.
http://forums.gentoo.org/viewtopic-t-708354-highlight-.html
_________________
Вопрос остается только один
Back to top
View user's profile Send private message
opensas
Guru
Guru


Joined: 24 Nov 2004
Posts: 408
Location: Buenos Aires - Argentina

PostPosted: Sat Sep 20, 2008 3:38 am    Post subject: Reply with quote

thanks a lot for your reply

well, i guess now i knoe where the problem is:

Code:

gentoo ~ # binutils-config -l
 [1] i686-pc-linux-gnu-2.18 *
gentoo ~ # gcc-config -l
 [1] i486-pc-linux-gnu-4.1.2 *


I had already tried what you said, but no luck...

this is the build.log
Code:

...
./configure --prefix=/usr --host=i486-pc-linux-gnu --target=i486-pc-linux-gnu --datadir=/usr/share/binutils-data/i486-pc-linux-gnu/2.18 --infodir=/usr/share/binutils-data/i486-pc-linux-gnu/2.18/info --mandir=/usr/share/binutils-data/i486-pc-linux-gnu/2.18/man --bindir=/usr/i486-pc-linux-gnu/binutils-bin/2.18 --libdir=/usr/lib/binutils/i486-pc-linux-gnu/2.18 --libexecdir=/usr/lib/binutils/i486-pc-linux-gnu/2.18 --includedir=/usr/lib/binutils/i486-pc-linux-gnu/2.18/include --enable-64-bit-bfd --enable-shared --disable-werror --without-included-gettext --build=i486-pc-linux-gnu --enable-secureplt
checking build system type... i486-pc-linux-gnu
checking host system type... i486-pc-linux-gnu
checking target system type... i486-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for i486-pc-linux-gnu-gcc... i486-pc-linux-gnu-gcc
checking for C compiler default output file name... configure: error: C compiler cannot create executables
See `config.log' for more details.
  [31;01m* [0m
  [31;01m* [0m ERROR: sys-devel/binutils-2.18-r3 failed.
  [31;01m* [0m Call stack:
...


and this is the config.log
Code:

configure:2782: checking for i486-pc-linux-gnu-gcc
configure:2798: found /usr/bin/i486-pc-linux-gnu-gcc
configure:2808: result: i486-pc-linux-gnu-gcc
configure:3090: checking for C compiler version
configure:3093: i486-pc-linux-gnu-gcc --version </dev/null >&5
i486-pc-linux-gnu-gcc (GCC) 4.1.2 (Gentoo 4.1.2 p1.1)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:3096: $? = 0
configure:3098: i486-pc-linux-gnu-gcc -v </dev/null >&5
Using built-in specs.
Target: i486-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.1.2/work/gcc-4.1.2/configure --prefix=/usr --bindir=/usr/i486-pc-linux-gnu/gcc-bin/4.1.2 --includedir=/usr/lib/gcc/i486-pc-linux-gnu/4.1.2/include --datadir=/usr/share/gcc-data/i486-pc-linux-gnu/4.1.2 --mandir=/usr/share/gcc-data/i486-pc-linux-gnu/4.1.2/man --infodir=/usr/share/gcc-data/i486-pc-linux-gnu/4.1.2/info --with-gxx-include-dir=/usr/lib/gcc/i486-pc-linux-gnu/4.1.2/include/g++-v4 --host=i486-pc-linux-gnu --build=i486-pc-linux-gnu --disable-altivec --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --enable-secureplt --disable-multilib --enable-libmudflap --disable-libssp --disable-libgcj --with-arch=i486 --enable-languages=c,c++,treelang,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
Thread model: posix
gcc version 4.1.2 (Gentoo 4.1.2 p1.1)
configure:3101: $? = 0
configure:3103: i486-pc-linux-gnu-gcc -V </dev/null >&5
i486-pc-linux-gnu-gcc: '-V' option must have argument
configure:3106: $? = 1
configure:3129: checking for C compiler default output file name
configure:3132: i486-pc-linux-gnu-gcc  -O2 -march=prescott -pipe  -Wl,-O1 conftest.c  >&5
i486-pc-linux-gnu-gcc: error trying to exec 'as': execvp: No such file or directory
configure:3135: $? = 2
configure: failed program was:
| /* confdefs.h.  */
|
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""


i think I have an i486 gcc and a i686 binutils... so i can't compile anything

maybe I coul get a whole toolchain in a binary package???

...

anyway, I kept going around and found that "as" is a command

so

Code:

gentoo / # find / -name as
/usr/share/locale/as
/usr/libexec/gcc/i686-pc-linux-gnu/as
/usr/i486-pc-linux-gnu/bin/as
/usr/i486-pc-linux-gnu/i686-pc-linux-gnu/binutils-bin/2.18/as
/usr/bin/as
/usr/kde/3.5/share/locale/l10n/as


and saw that in usr/bin i have a bunch of broken symlinks

i had to

ln -s /usr/bin/as /usr/i486-pc-linux-gnu/i686-pc-linux-gnu/binutils-bin/2.18/as

and then I had to do the same with ld, ar, well... and who knows what else

right now it is compiling...

i hope that when this thing finishes, if it does, it will fix all the symlinks...
Back to top
View user's profile Send private message
opensas
Guru
Guru


Joined: 24 Nov 2004
Posts: 408
Location: Buenos Aires - Argentina

PostPosted: Sat Sep 20, 2008 4:22 am    Post subject: Reply with quote

wel it compiled!!!

now I have
Code:

gentoo / # find / -name as
/usr/share/locale/as
/usr/i486-pc-linux-gnu/binutils-bin/2.18/as
/usr/i486-pc-linux-gnu/bin/as
/usr/bin/as
/usr/kde/3.5/share/locale/l10n/as


which is good, no i686 anywhere

but the symlinks are still broken...

i just did

gentoo bin # ln -s i486-pc-linux-gnu-ar ar
gentoo bin # ln -s i486-pc-linux-gnu-as as
gentoo bin # ln -s i486-pc-linux-gnu-ld ld

...

binutils has compiled, now i'm compiling gcc
Back to top
View user's profile Send private message
skellr
Guru
Guru


Joined: 17 Jun 2005
Posts: 536
Location: The Village

PostPosted: Sat Sep 20, 2008 5:05 am    Post subject: Reply with quote

Looks like you have it now. Good work. :)
_________________
Вопрос остается только один
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT - 5 Hours
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