name: gcc-runtime kind: chunk build-system: autotools configure-commands: - mkdir o - | case "$MORPH_ARCH" in armv7lhf) ARCH_FLAGS="--with-arch=armv7-a \ --with-cpu=cortex-a9 \ --with-tune=cortex-a9 \ --with-fpu=vfpv3-d16 \ --with-float=hard" ;; armv7*) ARCH_FLAGS="--with-arch=armv7-a" ;; esac # Do some really ugly setup stuff here, writing outside of our build area # ln -s . /usr/${TARGET} ln -s /tools/usr/cc /usr/cc ln -s /tools/usr/c++ /usr/c++ cd o # Finally we're ready to run configure # RANLIB=`which ranlib` AR=`which ar` RANLIB_FOR_TARGET=`which ranlib` \ AR_FOR_TARGET=`which ar` NM_FOR_TARGET=`which nm` AS_FOR_TARGET=`which as` \ ac_cv_path_AR_FOR_TARGET=`which ar` \ ac_cv_path_RANLIB_FOR_TARGET=`which ranlib` \ ac_cv_path_NM_FOR_TARGET=`which nm` \ ac_cv_path_AS_FOR_TARGET=`which as` \ ac_cv_path_LD_FOR_TARGET=`which ld` \ ../configure $ARCH_FLAGS --prefix="$PREFIX" \ --build=${TARGET_MUSL} \ --host=${TARGET_MUSL} \ --target=${TARGET} \ --disable-multilib --disable-libmudflap \ --disable-libsanitizer --enable-tls --disable-lto \ --disable-nls --enable-c99 --enable-__cxa_atexit \ --enable-long-long --enable-shared \ --enable-threads=posix --enable-languages=c,c++ build-commands: - | # Here we specify LD_LIBRARY_PATH so that the built host tools which # run during the gcc build find the musl based libstdc++ export LD_LIBRARY_PATH=/tools/usr/lib cd o make install-commands: - | # Thats right, still need to run C++ programs we built # at install time, so still need to set LD_LIBRARY_PATH export LD_LIBRARY_PATH=/tools/usr/lib cd o make DESTDIR=`pwd`/temp install # Create compiler specific directories that ccwrap searches in mkdir -p ${DESTDIR}/usr/cc/lib mkdir -p ${DESTDIR}/usr/c++ # Get rid of a pesky directory first rm -rf temp/usr/lib/gcc/*/*/install-tools # Move the C headers in place mv temp/usr/lib/gcc/*/*/include ${DESTDIR}/usr/cc/include # Move gcc start/end stubs and static libraries in place, # this also includes the 'fixed-headers' directory # mv temp/usr/lib/gcc/*/*/* ${DESTDIR}/usr/cc/lib # Move C++ headers in place mv temp/usr/${TARGET}/include/c++/* ${DESTDIR}/usr/c++/include # Link the extra include path, the ccwrap program expects it in extra-includes ln -s ${TARGET} ${DESTDIR}/usr/c++/include/extra-includes # Finally move the target libstdc++ and other target libraries into the regular libdir mv temp/usr/${TARGET}/lib ${DESTDIR}/usr/lib