[parisc-linux] ELF tool chain builds hello world!!!

Paul Bame bame@endor.fc.hp.com
Fri, 12 May 2000 15:29:27 -0600


This recipe is a little better.  Remember it assumes /opt/puffin
contains the current cross compiler and /opt/puffin/include contains
the include.tar.gz tarball.


#!/bin/sh

set -e
set -x

# Where to put the built results
PREFIX=$HOME/xc

# Where your checked-out CVS sources live
SRC=$HOME/palinux

# Where your build sub-dirs go
BUILD=$HOME/xc-build

# Clean out and/or create some things
rm -fr $PREFIX/* $BUILD/build-gcc $BUILD/build-glibc
mkdir -p $PREFIX $BUILD/build-gcc -p $BUILD/build-glibc

PATH=$PREFIX/bin:/opt/puffin/bin:$PATH

# Allow the GCC configure step to auto-configure binutils
cd $SRC && rm -f gcc/binutils &&
    ln -s ../binutils gcc/binutils

# This'll mainly build binutils for now
cd $BUILD/build-gcc
$SRC/gcc/configure \
	--disable-nls \
	--disable-shared \
	--target=hppa1.1-linux \
	--host=i586-pc-linux-gnu \
	--prefix=$PREFIX \
	--with-headers=/opt/puffin/include \
	--with-libs=$PREFIX/lib \
	--with-libc

make || true

# build will fail inside gcc somewhere, don't stop the script for this

# Install binutils anyway
cd binutils; make install

# no need to re-make this again
rm $SRC/gcc/binutils

# Get ready to re-config gcc -- should build this time
cd $BUILD/build-gcc && rm -r *
$SRC/gcc/configure \
	--disable-nls \
	--disable-shared \
	--target=hppa1.1-linux \
	--host=i586-pc-linux-gnu \
	--prefix=$PREFIX \
	--with-headers=/opt/puffin/include \
	--with-libs=$PREFIX/lib \
	--with-libc
make
make install

cd $BUILD/build-glibc

$SRC/glibc/configure \
	--disable-nls \
	--without-nls \
	--disable-shared \
	--disable-profile \
	--enable-static-nss \
	--build=i586-linux \
	--host=hppa1.1-linux \
	--disable-sanity-checks \
	--with-headers=/opt/puffin/include \
	--prefix=$PREFIX

cd $BUILD/build-glibc
make || true # fails pretty soon

cp $SRC/glibc/csu/crt?.S csu/ || true

cd $(dirname $(find $PREFIX -name crtbegin.o))
ln -s $PREFIX/lib/* .

# Now you should be able to compile hello world

# The problem is that not all the headers seem to be available, in
# two categories: 1) some headers for example glibc/string/memory.h
# which ought to be installed as ...../include/string/memory.h, aren't
# and 2) things in <sys> like <sys/mount.h>