# Unable to build udev [SOLVED]

## madchaz

Hello all. Not 100% sure this is the right forum, but if need be, please move to the appropriate forum. 

I am currently building a new home server. Old dual p2 is dying, so got a nice P4 1.7Ghz. 

I got the base system installed and booting and I figured I would update everything before I started to install more stuff. 

```
emerge --sync

emerge -uaD world
```

Then, I get to sys-fs/udev-124-r1 and it fails. 

Here is the call stack

 *Quote:*   

> /usr/bin/i686-pc-linux-gnu-ar
> 
>   GENHDR   udev_version.h
> 
>   CC       udev_device.o
> ...

 

```
kami ~ # emerge --info

Portage 2.1.4.4 (default/linux/x86/2008.0, gcc-4.1.2, glibc-2.6.1-r0, 2.6.25-gentoo-r8kami_01 i686)

=================================================================

System uname: 2.6.25-gentoo-r8kami_01 i686 Intel(R) Pentium(R) 4 CPU 1.70GHz

Timestamp of tree: Wed, 08 Oct 2008 16:07:01 +0000

app-shells/bash:     3.2_p33

dev-lang/python:     2.4.4-r13

dev-python/pycrypto: 2.0.1-r6

sys-apps/baselayout: 1.12.11.1

sys-apps/sandbox:    1.2.18.1-r2

sys-devel/autoconf:  2.61-r2

sys-devel/automake:  1.10.1-r1

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="i686-pc-linux-gnu"

CFLAGS="-march=pentium4 -Os -pipe"

CHOST="i686-pc-linux-gnu"

CONFIG_PROTECT="/etc"

CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d"

CXXFLAGS="-march=pentium4 -Os -pipe"

DISTDIR="/usr/portage/distfiles"

FEATURES="distlocks metadata-transfer sandbox sfperms strict unmerge-orphans userfetch"

GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"

LDFLAGS="-Wl,-O1"

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"

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="acl apache2 berkdb bzip2 cli cracklib crypt ctype dri fortran gdbm gpm iconv isdnlog latin1 midi mudflap mysql ncurses nls nptl nptlonly openmp pam pcre perl pppd python readline reflection session spl ssl sysfs tcpd unicode x86 xorg 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 evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="fbdev glint i810 mach64 mga neomagic nv r128 radeon savage sis tdfx trident vesa vga via vmware voodoo"

Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
```

Tried to figure it out, but I am a bit lost. Anyone as an idea?

----------

## Kosmas

 *Quote:*   

> make: i686-pc-linux-gnu-gcc: Command not found 

 

I think there resides your problem with the compiler. 

I would sujest gcc-config -l to see what gcc versions are installed and set the correct one.

Hope I gave a hint  :Wink: 

----------

## d2_racing

Also, you should use this kind of config :

```

CFLAGS="-O2 -march=pentium4 -pipe -fomit-frame-pointer"

CHOST="i686-pc-linux-gnu"

CXXFLAGS="${CFLAGS}"

```

----------

## madchaz

 *Kosmas wrote:*   

>  *Quote:*   make: i686-pc-linux-gnu-gcc: Command not found  
> 
> I think there resides your problem with the compiler. 
> 
> I would sujest gcc-config -l to see what gcc versions are installed and set the correct one.
> ...

 

It does, actually. I had no profile selected.

```
kami / # gcc-config -l

 * gcc-config: No gcc profile is active!

 * gcc-config: No gcc profile is active; please select one!

 [1] i486-pc-linux-gnu-4.1.2

```

Not sure how this happenned. 

So I forced it to use the only available one. 

```
gcc-config -f i486-pc-linux-gnu-4.1.2

```

Unfortunatly, this leaves me with the same exact problem. Looks like something fucked up gcc during the update ...

----------

## madchaz

 *d2_racing wrote:*   

> Also, you should use this kind of config :
> 
> ```
> 
> CFLAGS="-O2 -march=pentium4 -pipe -fomit-frame-pointer"
> ...

 

The reason my CFLAGS is at -Os and not -O2 is because I want to optimise for size, not performance. I did add the fomit-frame-pointer now, but doesn't really change a thing.

As for CHOST, you will notice that is what it is set at in emerge --info

----------

## zyko

Your CHOST in emerge --info says "i686-pc-linux-gnu", but your gcc-profile says "i486-pc-linux-gnu-4.1.2". That can't work.

How did this happen? Did you start out with CHOST="i486-pc-linux-gnu" and then change to CHOST="i686-..."? Changing CHOST within the i*86 family is generally not a problem, but some special adjustments are necessary. There is a guide for this maneuver: http://gentoo.org/doc/en/change-chost.xml

If you just changed CHOST in your make.conf without any further modifications (=re-compilations) to your core system components, you can just change it back.

----------

## madchaz

Looks like that was the problem, more or less. 

Not 100% sure how it happenned. Re-emerged gcc and now have the right profile. Everything works fine now. 

Strange, because I KNOW I did not change it in make.conf

Running world update, will keep you posted

Edit: I think I have a possible explanation. I may have downloaded the wrong stage3 tarbal. As I overwrote the original make.conf with the make.conf.example, then edited, it is possible the example one had the 686 flag.

----------

## madchaz

Well, I am following the chost change tutorial. I am now convinced this was caused by a mistake in downloading the tarball.

----------

## d2_racing

Yeah, a wrong Stage tarball can create a real mess.

----------

## pmatos

What happened to me just now was that after a clean install on a laptop with a 2008.0 livecd, through a stage 3 tarball, even though it's a i686, the profile that comes installed by default is i486.

I would say that's a bug on the stage3 tarball, although easily solvable.

----------

## d2_racing

You know that you can use the Stages from http://www.funtoo.org/linux

There are up to date.

----------

## pmatos

 *d2_racing wrote:*   

> You know that you can use the Stages from http://www.funtoo.org/linux
> 
> There are up to date.

 

Cool, didn't know 'bout this! Seems drobbins found himself another pet project!  :Smile: 

----------

## d2_racing

Are he is rocking with the Metro Project. It's Catalyst a the power 10.

I will try is tool this weekend, but one of my friend is already building  Stage 3 for is ~amd64 without any problem.

Git is a awesome tool.

----------

