#!/bin/sh # # Usage: build ... # # Base of architecture-dependent directory ARCHDIR=$1 # Prefix of architecture-dependent tools ARCHPREFIX=$2 # Pathname of library file to generate DEST=$3 # "strip" or "nostrip" STRIP=$4 shift 4 if [ -r ${ARCHDIR}/target/lib/ld.so.1 ] ; then DYNLINKER="ld.so.1" elif [ -r ${ARCHDIR}/target/lib/ld-linux.so.2 ] ; then DYNLINKER="ld-linux.so.2" else echo "Dynamic linker not found; cannot build glibc" >&2 exit 1 fi TOOLPREFIX=${ARCHDIR}/bin/${ARCHPREFIX} ${TOOLPREFIX}gcc ${STRIP} -shared -Wl,-O1 -o ${DEST} \ -Wl,-dynamic-linker=/lib/${DYNLINKER} \ -Wl,--version-script=libc.map -Wl,-soname=libc.so.6 \ -nostdlib -nostartfiles \ -e __libc_main -u __register_frame \ -T libc.so.lds \ abi-note.o soinit.o $* sofini.o interp.o \ ${ARCHDIR}/target/lib/${DYNLINKER} -lgcc if [ "$STRIP" = "strip" ] ; then ${TOOLPREFIX}strip -R .note -R .comment ${DEST} fi