scripts/wrapper.in
author Zoltan Devai <zdevai@gmail.com>
Wed Oct 28 12:03:38 2009 +0100 (2009-10-28)
branch1.5
changeset 1645 01d01185eb18
parent 1402 146c62142e1b
child 1960 8307ceabe5c0
permissions -rw-r--r--
libc/uClibc: fix building on system with recent glibc

While trying to build a toolchain with ct-ng 1.5.0,
arm-unknown-linux-uclibcgnueabi target,
I get the following error:

[INFO ] Installing C library headers
[EXTRA] Copying sources to build dir
[EXTRA] Applying configuration
[EXTRA] Building headers
[EXTRA] Installing headers
[ERROR] extra/scripts/unifdef.c:209: error: conflicting types for 'getline'
[ERROR] make[2]: *** [extra/scripts/unifdef] Error 1
[ERROR] Build failed in step 'Installing C library headers'

The following patch solves the problem.
(It's a backport of this uClibc commit:
http://git.uclibc.org/uClibc/commit/?id=49e81cada73616864b9b31df0aeb6961c30f5a6e
)

[--SNIP from another mail--]
AFAIK this is a problem since glibc 2.10.
(transplanted from 1ba79f2126df8bd89120899a58f2d0bcc2e9c771)
yann@1402
     1
#!/bin/sh
yann@1401
     2
bartvdrmeulen@1434
     3
canonicalizedname=$(readlink -nm "${0}")
bartvdrmeulen@1434
     4
dirname="$(dirname "${canonicalizedname}")"
bartvdrmeulen@1434
     5
basename="$(basename "${canonicalizedname}")"
yann@1401
     6
yann@1401
     7
ld_lib_path="$(dirname "${dirname}")/lib"
yann@1401
     8
yann@1401
     9
case ":${LD_LIBRARY_PATH}:" in
yann@1401
    10
    *":${ld_lib_path}:"*)   ;;
yann@1401
    11
    *)  LD_LIBRARY_PATH="${ld_lib_path}${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}";;
yann@1401
    12
esac
yann@1401
    13
yann@1401
    14
export LD_LIBRARY_PATH
yann@1402
    15
exec "${dirname}/.${basename}" "$@"