Mercurial > hg > aboriginal
changeset 1677:c11a357ea92d
Second attempt: make dynamic linker match libc in ccwrap.
Building uClibc requires the wrapper, so we can't have the wrapper look for
and _existing_ dynamic linker, so the wrapper script has to check the config.
author | Rob Landley <rob@landley.net> |
---|---|
date | Sun, 24 Aug 2014 22:23:05 -0500 |
parents | 0f4499211cfa |
children | e495d01ad5b3 |
files | sources/sections/ccwrap.sh |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/sources/sections/ccwrap.sh Sun Aug 17 18:12:50 2014 -0500 +++ b/sources/sections/ccwrap.sh Sun Aug 24 22:23:05 2014 -0500 @@ -4,12 +4,15 @@ [ "$BUILD_STATIC" == none ] && STATIC_FLAGS= || STATIC_FLAGS=--static [ -z "$HOST_ARCH" ] && TEMP="$CC" || TEMP="${HOST_ARCH}-cc" +LIBC_TYPE=musl +[ ! -z "$UCLIBC_CONFIG" ] && [ -z "$MUSL" ] && LIBC_TYPE=uClibc # Build wrapper binary mkdir -p "$STAGE_DIR/bin" && "$TEMP" "$SOURCES/toys/ccwrap.c" -Os $CFLAGS \ - -o "$STAGE_DIR/bin/${TOOLCHAIN_PREFIX}cc" $STATIC_FLAGS -DDYNAMIC_LINKER=\"/lib/$(cd $STAGE_DIR/lib; ls ld-*.so.0)\" && + -o "$STAGE_DIR/bin/${TOOLCHAIN_PREFIX}cc" $STATIC_FLAGS \ + -DDYNAMIC_LINKER=\"/lib/ld-${LIBC_TYPE}.so.0\" && echo -e "#!/bin/bash\n\n${TOOLCHAIN_PREFIX}cc -E "'"$@"' \ > "$STAGE_DIR/bin/${TOOLCHAIN_PREFIX}cpp" && chmod +x "$STAGE_DIR/bin/${TOOLCHAIN_PREFIX}cpp" || dienow