patches/gcc/4.2.3/320-libgcc_eh.a.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Mon Dec 12 21:41:16 2011 +0200 (2011-12-12)
branch1.13
changeset 2845 0dc9d4931246
permissions -rw-r--r--
scripts: unset CONFIG_SITE

Some distributions (eg. openSUSE 12.1) systematically export
the CONFIG_SITE environment variable to point to a custom
script setting misc paths for ./configure.

This can, and does, break when cross-compiling for architectures
that are not supported by this script.

The simple workaround is to unset this variable.
NB: buildroot has a similar fix:
http://git.buildroot.org/buildroot/commit/?id=12c9f7dd6dee9c6029b4f9a12d6aac1516911ab4

Reported-by: Trevor Woerner <twoerner@gmail.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
(transplanted from 21f4f28e60ec0342133086c9a51e7f0e5b181fb8)
     1 Vampirised from:
     2   http://landley.net/hg/aboriginal/file/7e0747a665ab/sources/patches/gcc-core-libgcceh.patch
     3 
     4 diff -durN gcc-4.2.2.orig/gcc/mklibgcc.in gcc-4.2.2/gcc/mklibgcc.in
     5 --- gcc-4.2.2.orig/gcc/mklibgcc.in	2006-07-04 22:20:01.000000000 +0200
     6 +++ gcc-4.2.2/gcc/mklibgcc.in	2011-08-31 16:24:03.674690016 +0200
     7 @@ -223,8 +223,8 @@
     8    if [ "$LIBUNWIND" ]; then
     9      libunwind_a=$dir/libunwind.a
    10    fi
    11 +  libgcc_eh_a=$dir/libgcc_eh.a
    12    if [ "$SHLIB_LINK" ]; then
    13 -    libgcc_eh_a=$dir/libgcc_eh.a
    14      libgcc_s_so=$dir/libgcc_s${SHLIB_EXT}
    15      if [ "$LIBUNWIND" ]; then
    16        libunwind_so=$dir/libunwind${SHLIB_EXT}
    17 @@ -889,11 +889,11 @@
    18    echo '	chmod 644'  ${ldir}/libgcov.a
    19    echo '	$(RANLIB_FOR_TARGET)' ${ldir}/libgcov.a
    20  
    21 -  if [ "$SHLIB_LINK" ]; then
    22 -    echo '	$(INSTALL_DATA)' ${dir}/libgcc_eh.a ${ldir}/
    23 -    echo '	chmod 644'  ${ldir}/libgcc_eh.a
    24 -    echo '	$(RANLIB_FOR_TARGET)' ${ldir}/libgcc_eh.a
    25 +  echo '	$(INSTALL_DATA)' ${dir}/libgcc_eh.a ${ldir}/
    26 +  echo '	chmod 644'  ${ldir}/libgcc_eh.a
    27 +  echo '	$(RANLIB_FOR_TARGET)' ${ldir}/libgcc_eh.a
    28  
    29 +  if [ "$SHLIB_LINK" ]; then
    30      shlib_slibdir_qual=
    31      os_multilib_dir=`$GCC_FOR_TARGET $flags --print-multi-os-directory`
    32      if [ "$os_multilib_dir" != . ]; then