From: Jan-Benedict G. <jb...@us...> - 2004-05-19 09:15:18
|
Update of /cvsroot/linux-vax/toolchain In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21462 Added Files: experimental_toolchain.README experimental_toolchain.sh Log Message: - Script and README to build a vax-linux toolchain from all HEAD sources. - Currently capable of creating a Kernel-only cross-compiler, but glibc is not yet built fully (due to glibc/gcc bugs). - I suppose that this GCC isn't all _that_ useful, but the generated .o files at least contain VAX assembly:) Maybe some parts are even really useable. I'll try to verify that by linking 2.95.2 code with 3.5.0 code (just by adding more and more gcc-HEAD compiled .o files into kernel link run) to see if it instantly breaks... --- NEW FILE: experimental_toolchain.sh --- #!/bin/sh # # This script will attempt to # # - Download a lot of things # - Create releases of gcc + binutils # - Unpack gcc / binutils # - Patch everything # - Build most of a toolchain from it # # Bugs: # # - This script is highly sub-optimal wrt. download size. # - It doesn't finish completely because vax-linux isn't yet # fully supported :-( # - To checkout binutils, you (once) have to run # cvs -d :pserver:an...@so...:/cvs/src login # Password is "anoncvs". # - Checkouts of GCC are only available via ssh transport. So # ssh may ask you (once) to confirm FSF's host key with "yes". # - To checkout binutils, you (once) have to run # cvs -d :pserver:an...@so...:/cvs/glibc login # Password is "anoncvs". # - To checkout the Linux kernel, you (once) have to run # cvs -d:pserver:ano...@cv...:/cvsroot/linux-vax login # Password is empty, "", nada, ... # - You need to have /usr/share/misc/config.guess . Get that from # GNU's config package... # - You may want to set MAKE_FLAGS to "-j2" if you're the happy # owner of a dual CPU machine... # # # # $Id: experimental_toolchain.sh,v 1.1 2004/05/19 09:15:02 jbglaw Exp $ # # $Log: experimental_toolchain.sh,v $ # Revision 1.1 2004/05/19 09:15:02 jbglaw # - Script and README to build a vax-linux toolchain from all HEAD sources. # - Currently capable of creating a Kernel-only cross-compiler, but glibc # is not yet built fully (due to glibc/gcc bugs). # - I suppose that this GCC isn't all _that_ useful, but the generated .o # files at least contain VAX assembly:) Maybe some parts are even really # useable. I'll try to verify that by linking 2.95.2 code with 3.5.0 # code (just by adding more and more gcc-HEAD compiled .o files into # kernel link run) to see if it instantly breaks... # # # MAKE_FLAGS="-j2" MAKE_FLAGS="" GLOBAL_BASE_DIR= INSTALL_DIR= DO_PREPARE=0 DO_BUILD=0 set -e set -x while [ $# -ne 0 ]; do case "${1}" in -d|--download|-p|--prepare) DO_PREPARE=1;; -b|--build|-i|--install) DO_BUILD=1;; *) if [ -z "${GLOBAL_BASE_DIR}" ]; then GLOBAL_BASE_DIR="${1}" else INSTALL_DIR="${1}" fi;; esac shift done [ "${DO_PREPARE}" -eq 1 ] && echo "$0: Will download and prepare sources" [ "${DO_BUILD}" -eq 1 ] && echo "$0: Will create a cross-compiler and install it" [ -n "${GLOBAL_BASE_DIR}" ] && echo "$0: Will use ${GLOBAL_BASE_DIR} for temporary storage" [ -n "${INSTALL_DIR}" ] && echo "$0: Will install to ${INSTALL_DIR}" if [ -z "${GLOBAL_BASE_DIR}" -o -z "${INSTALL_DIR}" ]; then echo "$0 [--prepare] [--install] <tempdir> <installdir>" >&2 exit 1 fi GLOBAL_BASE_DIR="`cd "${GLOBAL_BASE_DIR}"; pwd`" INSTALL_DIR="`cd "${INSTALL_DIR}"; pwd`" # # Where do we find things? # PREP_DIR="${GLOBAL_BASE_DIR}/prepare" LOCAL_SRC_DIR="${GLOBAL_BASE_DIR}/source" BLD_DIR="${GLOBAL_BASE_DIR}/build" if [ "${DO_PREPARE}" -eq 1 ]; then # # Prepare directories # mkdir -p "${PREP_DIR}" mkdir -p "${LOCAL_SRC_DIR}" mkdir -p "${BLD_DIR}" # # Prepare binutils. # # I had a hard time trying to directly build a binutils CVS co. I failed. # My current approach is to do a checkout, then build a release tar-bz2 from # it and unpack this. *That* actually will work. # cd "${PREP_DIR}" cvs -z 9 -d :pserver:an...@so...:/cvs/src co binutils cd src make -f src-release binutils.tar.bz2 cd "${LOCAL_SRC_DIR}" tar xjf ${PREP_DIR}/src/binutils-*.tar.bz2 mv binutils-* binutils-HEAD # # Prepare GCC. # # GCC is quite like binutils. I haven't figured out how to build it off a # checked-out CVS tree. So I first build a release from it. # # The release script does have another problem: it doesn't use the local # CVS sandbox, but calls cvs on it's own to create a fresh sandbox. To save # some bandwidth, I first download the release script, then call it. # # Additionally, the release script uses wrong CVS server name and repository # path... # cd "${PREP_DIR}" wget -O gcc_release.0 'http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/gcc/gcc/maintainer-scripts/gcc_release?rev=HEAD&content-type=text/plain' cat gcc_release.0 | sed -e 's#^CVS_SERVER.*#CVS_SERVER="savannah.gnu.org"#' > gcc_release.1 cat gcc_release.1 | sed -e 's#^CVS_REPOSITORY.*#CVS_REPOSITORY="/cvsroot/gcc"#' > gcc_release chmod +x gcc_release mkdir -p "${PREP_DIR}/gcc" ./gcc_release -s HEAD:HEAD -d "${PREP_DIR}/gcc" -u anoncvs sources tarfiles cd "${LOCAL_SRC_DIR}" tar xjf ${PREP_DIR}/gcc/*/gcc-HEAD-*.tar.bz2 mv gcc-* gcc-HEAD # # Prepare glibc. # # Preparing glibc sources is actually an easy task. Just check it out, # then remove the nptl* directories (these won't probably work yet for # vax-linux, but I may need to verify that again. It's from ages where # we had no current GCC at hand...). # cd "${PREP_DIR}" cvs -z 9 -d :pserver:an...@so...:/cvs/glibc co libc mkdir -p "${LOCAL_SRC_DIR}/glibc-HEAD" (cd libc && tar cf - . ;) | (cd "${LOCAL_SRC_DIR}/glibc-HEAD" && tar xf -;) cd "${LOCAL_SRC_DIR}/glibc-HEAD" rm -rf nptl* # # Download current crosstool scripts. We only need crosstool.sh, though... # cd "${PREP_DIR}" wget -O crosstool_website.html http://www.kegel.com/crosstool/ CT_URL="`cat crosstool_website.html | grep crosstool- | tail -n 1 | sed -e 's#.*\(http://[a-z0-9./-]*\).*#\1#'`" wget -O crosstool_current.tar.gz "${CT_URL}" tar xzf crosstool_current.tar.gz cp crosstool-*/crosstool.sh "${GLOBAL_BASE_DIR}" chmod +x "${GLOBAL_BASE_DIR}/crosstool.sh" # # Get current VAX Linux Kernel v2.6.x from CVS # cd "${PREP_DIR}" cvs -z9 -d:pserver:ano...@cv...:/cvsroot/linux-vax co kernel-2.5 mkdir -p "${LOCAL_SRC_DIR}/linux-HEAD" (cd kernel-2.5 && tar cf - . ;) | (cd "${LOCAL_SRC_DIR}/linux-HEAD" && tar xf -;) cd "${LOCAL_SRC_DIR}/linux-HEAD" make ARCH=vax defconfig # # Now patch gcc and libc with current patches. binutils already work # out of the box:) # cd "${PREP_DIR}" wget http://lug-owl.de/~jbglaw/vax-linux-gcc.patch wget http://lug-owl.de/~jbglaw/vax-linux-libc.patch cd "${LOCAL_SRC_DIR}/gcc-HEAD" patch -p1 < "${PREP_DIR}/vax-linux-gcc.patch" cd "${LOCAL_SRC_DIR}/glibc-HEAD" patch -p1 < "${PREP_DIR}/vax-linux-libc.patch" fi # if [ "${DO_PREPARE}" -eq 1 ]; then # # This was the fun part. Now everything should (at least partially) # build:) Yeppee!!! # # This last step takes about 11min on my Athlon (2x 1.4GHz, 1.5GB RAM) # until building of GLIBC breaks due to compiler errors. # if [ "${DO_BUILD}" -eq 1 ]; then cd "${GLOBAL_BASE_DIR}" PREFIX="${INSTALL_DIR}" \ BUILD_DIR="${BLD_DIR}" \ SRC_DIR="${LOCAL_SRC_DIR}" \ BINUTILS_DIR=binutils-HEAD \ GCC_DIR=gcc-HEAD \ GLIBC_DIR=glibc-HEAD \ LINUX_DIR=linux-HEAD \ TARGET=vax-linux \ TARGET_CFLAGS="-O -g" \ BUILD=`/usr/share/misc/config.guess` \ USE_SYSROOT=yes \ PARALLELMFLAGS="${MAKE_FLAGS}" ./crosstool.sh fi # if [ "${DO_BUILD}" -eq 1 ]; then --- NEW FILE: experimental_toolchain.README --- Quick-Start ~~~~~~~~~~~ ~$ mkdir opt ~$ mkdir /tmp/to_be_removed ~$ ./experimental_toolchain.sh -d -i /tmp/to_be_removed opt Space Requirements ~~~~~~~~~~~~~~~~~~ As far as the build process proceeds right now, you have to have about 60MB free space in the install directory (~/opt in the example above) and about 1.6GB for the temporary directory. Needed space will raise somewhat while glibc (or GCC) gets fixed, of course... Theory fo Operation ~~~~~~~~~~~~~~~~~~~ If you call it with -d/--download/-p/--prepare, the script will try to download all current HEAD versions of binutils, gcc, glibc and the vax-linux kernel, as well as patches to gcc and glibc and the crosstool scripts (by Dan Kegel). If called with -i/--install/-b/--build, it'll take the prepared sources and try to build a vax-linux toolchain. Currently, it breaks while compiling parts of glibc, but you'll see that it build a vax-linux-gcc up to that point, that can be used (somewhat) to compile the Linux kernel. Please note that this GCC is of quite limited use right now. It omits some (serious?) warnings during kernel compile, can't actually compile glibc and I suppose that it contains quite a lot of bugs. However, it's a *start* (albeit hackish), but I hope that others help to finish this task:) May 19, 2004, Jan-Benedict Glaw <jb...@lu...> |