# crossdev glibc: i686-pc-linux-gnu/ld: cannot find -lgcc_eh

## Max Steel

Hallo Leute,

Ich versuche gerade eine cross-toolchain für i686 mittels crossdev zu erstellen.

Dazu verwende ich den folgenden Befehl:

```
crossdev --b 2.22.90 --g 4.6.3 --l 2.15-r2 --k 3.5 --target i686-pc-linux-gnu --lenv 'CFLAGS="${CFLAGS/ -fstack-protector/ -flto=n}"

CXXFLAGS="${CFLAGS}"' --genv 'CFLAGS="${CFLAGS/ -fstack-protector/ -flto=n}"

CXXFLAGS="${CFLAGS}"' -v
```

(Die Versionsnummern versuche ich damit es mit dem Zielsystem übereinstimmt.)

Es geht hier eigentlich darum die Updateprozedur des langsamen Intel Celeron 1GHz auf meinem 2-Kern Intel i5 zusätzlich zu beschleunigen. (Er sollte eig. heute wenn möglich fertig werden.)

er bricht bei der Installation der GLibc mit obigem Fehler ab.

Die Build-log gibt dashier aus:

```
i686-pc-linux-gnu-gcc  -nostdlib -nostartfiles -o /var/tmp/portage/cross-i686-pc-linux-gnu/glibc-2.15-r2/work/build-default-i686-pc-linux-gnu-nptl/iconv/iconvconfig  -Wl,-dynamic-linker=/lib/ld-linux.so.2 -Wl,-O1 -Wl,--as-needed  -Wl,-z,combreloc -Wl,-z,relro  /var/tmp/portage/cross-i686-pc-linux-gnu/glibc-2.15-r2/work/build-default-i686-pc-linux-gnu-nptl/csu/crt1.o /var/tmp/portage/cross-i686-pc-linux-gnu/glibc-2.15-r2/work/build-default-i686-pc-linux-gnu-nptl/csu/crti.o `i686-pc-linux-gnu-gcc   --print-file-name=crtbegin.o` /var/tmp/portage/cross-i686-pc-linux-gnu/glibc-2.15-r2/work/build-default-i686-pc-linux-gnu-nptl/iconv/iconvconfig.o /var/tmp/portage/cross-i686-pc-linux-gnu/glibc-2.15-r2/work/build-default-i686-pc-linux-gnu-nptl/iconv/strtab.o /var/tmp/portage/cross-i686-pc-linux-gnu/glibc-2.15-r2/work/build-default-i686-pc-linux-gnu-nptl/iconv/xmalloc.o /var/tmp/portage/cross-i686-pc-linux-gnu/glibc-2.15-r2/work/build-default-i686-pc-linux-gnu-nptl/iconv/hash-string.o  -Wl,-rpath-link=/var/tmp/portage/cross-i686-pc-linux-gnu/glibc-2.15-r2/work/build-default-i686-pc-linux-gnu-nptl:/var/tmp/portage/cross-i686-pc-linux-gnu/glibc-2.15-r2/work/build-default-i686-pc-linux-gnu-nptl/math:/var/tmp/portage/cross-i686-pc-linux-gnu/glibc-2.15-r2/work/build-default-i686-pc-linux-gnu-nptl/elf:/var/tmp/portage/cross-i686-pc-linux-gnu/glibc-2.15-r2/work/build-default-i686-pc-linux-gnu-nptl/dlfcn:/var/tmp/portage/cross-i686-pc-linux-gnu/glibc-2.15-r2/work/build-default-i686-pc-linux-gnu-nptl/nss:/var/tmp/portage/cross-i686-pc-linux-gnu/glibc-2.15-r2/work/build-default-i686-pc-linux-gnu-nptl/nis:/var/tmp/portage/cross-i686-pc-linux-gnu/glibc-2.15-r2/work/build-default-i686-pc-linux-gnu-nptl/rt:/var/tmp/portage/cross-i686-pc-linux-gnu/glibc-2.15-r2/work/build-default-i686-pc-linux-gnu-nptl/resolv:/var/tmp/portage/cross-i686-pc-linux-gnu/glibc-2.15-r2/work/build-default-i686-pc-linux-gnu-nptl/crypt:/var/tmp/portage/cross-i686-pc-linux-gnu/glibc-2.15-r2/work/build-default-i686-pc-linux-gnu-nptl/nptl /var/tmp/portage/cross-i686-pc-linux-gnu/glibc-2.15-r2/work/build-default-i686-pc-linux-gnu-nptl/libc.so.6 /var/tmp/portage/cross-i686-pc-linux-gnu/glibc-2.15-r2/work/build-default-i686-pc-linux-gnu-nptl/libc_nonshared.a  /var/tmp/portage/cross-i686-pc-linux-gnu/glibc-2.15-r2/work/build-default-i686-pc-linux-gnu-nptl/elf/ld.so  -lgcc -lgcc_eh  `i686-pc-linux-gnu-gcc   --print-file-name=crtend.o` /var/tmp/portage/cross-i686-pc-linux-gnu/glibc-2.15-r2/work/build-default-i686-pc-linux-gnu-nptl/csu/crtn.o

/usr/libexec/gcc/i686-pc-linux-gnu/ld: cannot find -lgcc_eh

collect2: ld gab 1 als Ende-Status zurück

make[2]: *** [/var/tmp/portage/cross-i686-pc-linux-gnu/glibc-2.15-r2/work/build-default-i686-pc-linux-gnu-nptl/iconv/iconvconfig] Fehler 1

make[2]: *** Warte auf noch nicht beendete Prozesse...

make[2]: Leaving directory `/var/tmp/portage/cross-i686-pc-linux-gnu/glibc-2.15-r2/work/glibc-2.15/iconv'

make[1]: *** [iconv/others] Fehler 2

make[1]: Leaving directory `/var/tmp/portage/cross-i686-pc-linux-gnu/glibc-2.15-r2/work/glibc-2.15'

make: *** [all] Fehler 2

emake failed

 * ERROR: cross-i686-pc-linux-gnu/glibc-2.15-r2 failed (compile phase):

 *   make for default failed

 * 

 * Call stack:

 *           ebuild.sh, line   85:  Called src_compile

 *         environment, line 3630:  Called eblit-run 'src_compile'

 *         environment, line  980:  Called eblit-glibc-src_compile

 *   src_compile.eblit, line  213:  Called src_compile

 *         environment, line 3630:  Called eblit-run 'src_compile'

 *         environment, line  980:  Called eblit-glibc-src_compile

 *   src_compile.eblit, line  221:  Called toolchain-glibc_src_compile

 *   src_compile.eblit, line  132:  Called die

 * The specific snippet of code:

 *              emake || die "make for ${ABI} failed"

 * 

 * If you need support, post the output of `emerge --info '=cross-i686-pc-linux-gnu/glibc-2.15-r2'`,

 * the complete build log and the output of `emerge -pqv '=cross-i686-pc-linux-gnu/glibc-2.15-r2'`.

 * This ebuild is from an overlay named 'RoneckerN': '/usr/local/portage/eigen/'

 * The complete build log is located at '/var/tmp/portage/cross-i686-pc-linux-gnu/glibc-2.15-r2/temp/build.log'.

 * The ebuild environment file is located at '/var/tmp/portage/cross-i686-pc-linux-gnu/glibc-2.15-r2/temp/environment'.

 * Working directory: '/var/tmp/portage/cross-i686-pc-linux-gnu/glibc-2.15-r2/work/build-default-i686-pc-linux-gnu-nptl'

 * S: '/var/tmp/portage/cross-i686-pc-linux-gnu/glibc-2.15-r2/work/glibc-2.15'

>>> Failed to emerge cross-i686-pc-linux-gnu/glibc-2.15-r2, Log file:

>>>  '/var/tmp/portage/cross-i686-pc-linux-gnu/glibc-2.15-r2/temp/build.log'

 * glibc failed :(

 * If you file a bug, please attach the following logfiles:

 * /var/log/portage/cross-i686-pc-linux-gnu-info.log

 * /var/log/portage/cross-i686-pc-linux-gnu-glibc.log.xz

 * /var/tmp/portage/cross-i686-pc-linux-gnu/glibc*/temp/glibc-config.logs.tar.xz
```

Hier noch die cross-i686-pc-linux-gnu-info.log: http://bpaste.net/show/40241/

glibc-config.logs.tar.xz: http://bpaste.net/show/40243/

----------

## puchuu

I have the same problem building arm-armv7a_hardfp-linux-gnueabi with:

```

binutils:     binutils-2.22.90

gcc:          gcc-4.7.1

headers:      linux-headers-3.4-r2

libc:         glibc-2.15-r2

```

----------

## puchuu

I've found such solutions:

 go to /usr/lib64/gcc/arm-armv7a_hardfp-linux-gnueabi/4.7.1/ and create symlink "libgcc_eh.a" to "libgcc.a"

 create local patch /usr/arm-armv7a_hardfp-linux-gnueabi/etc/portage/patches/sys-libs/glibc which will delete all "-lgcc_eh" from Menuconfig

 create global patch mentioned in this thread

works fine for me

----------

