This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

i386, sparc, and sparc64 failures


I am trying to build cross compilers using my own build scripts (wanting to learn how to do it) after I have gotten crosstool-0.28-rc26 to build everything correctly.

I am on Slackware 10 for ix86, and trying to generate cross targets for i386-unknown-linux-gnu, powerpc-unknown-linux-gnu, sparc-unknown-linux-gnu, and sparc64-unknown-linux-gnu.

Toolchain software I am using is the following :

binutils 2.15.91.0.1
gcc 3.4.1
glibc 2.3.3 (CVS tag glibc-2_3_3)
linux-libc-headers 2.6.7.0

I have applied the following patches from crosstool-0.28-r28 :

   glibc fixup
   glibc no-unit-at-a-time

Error messages that I see are :

i386-unknown-linux-gnu target : i_am_not_a_leaf in crti.S and crtn.S
sparc-unknown-linux-gnu target : i_am_not_a_leaf in crti.S and crtn.S
sparc64-unknown-linux-gnu target : only 32 single precision f registers in soft-fp/qp_qtoi.c


Attached is the build script I am currently using.

I have tried the various fixes that I could find on google, none of them appear to work, or the change set referenced appears to already be in the versions of the tools I am using.
#!/bin/bash

if [ "${1}" == "" ]
then
  echo "Syntax: "
  echo
  echo "	${0} <architecture>"
  echo
  exit
fi

TARGET_CFLAGS_I386="-O2 -pipe -m32 -march=i386 -mtune=i686"
TARGET_CFLAGS_X86_64="-O2 -pipe -m64 -march=x86_64 -mtune=x86_64"
TARGET_CFLAGS_PPC="-O2 -pipe -m32 -mcpu=G3 -mtune=G3"
TARGET_CFLAGS_PPC64="-O2 -pipe -m64 -mcpu=G5 -mtune=G5"
TARGET_CFLAGS_SPARC="-O2 -pipe -m32 -mcpu=v7 -mtune=ultrasparc"
TARGET_CFLAGS_SPARC64="-O2 -pipe -m64 -mcpu=ultrasparc -mtune=ultrasparc"
GCC_CONFIGURE_I386="--with-cpu=i386 --with-tune=pentium3"
GCC_CONFIGURE_X86_64="--with-cpu=x86_64 --with-tune=x86_64"
GCC_CONFIGURE_PPC="--with-cpu=G3 --with-tune=G3"
GCC_CONFIGURE_PPC64="--with-cpu=G5 --with-tune=G5"
GCC_CONFIGURE_SPARC="--with-cpu=v7 --with-tune=ultrasparc"
GCC_CONFIGURE_SPARC64="--with-cpu=ultrasparc --with-tune=ultrasparc"

case ${1} in
	i386)
		TARGET_CFLAGS="${TARGET_CFLAGS_I386}"
		GCC_CONFIGURE="${GCC_CONFIGURE_I386}"
		;;
	x86_64)
		TARGET_CFLAGS="${TARGET_CFLAGS_X86_64}"
		GCC_CONFIGURE="${GCC_CONFIGURE_X86_64}"
		;;
	ppc)
		TARGET_CFLAGS="${TARGET_CFLAGS_PPC}"
		GCC_CONFIGURE="${GCC_CONFIGURE_PPC}"
		;;
	ppc64)
		TARGET_CFLAGS="${TARGET_CFLAGS_PPC64}"
		GCC_CONFIGURE="${GCC_CONFIGURE_PPC64}"
		;;
	sparc)
		TARGET_CFLAGS="${TARGET_CFLAGS_SPARC}"
		GCC_CONFIGURE="${GCC_CONFIGURE_SPARC}"
		;;
	sparc64)
		TARGET_CFLAGS="${TARGET_CFLAGS_SPARC64}"
		GCC_CONFIGURE="${GCC_CONFIGURE_SPARC64}"
		;;
	*)
		echo "Unsupported architecture ${1}"
		echo
		echo "Currently we support :"
		echo
		echo "	i386"
		echo "	ppc"
		echo "	sparc"
		echo "	sparc64"
		echo
		exit
		;;
esac

ARCH_HOST=`/usr/share/automake-1.8/config.sub ${MACHTYPE} | sed -e "s/-/-host_/"`
ARCH_DEST=`/usr/share/automake-1.8/config.sub ${1}-unknown-linux-gnu`
INSTALL_ROOT=${HOME}/cross/${1}
SYS_ROOT=${INSTALL_ROOT}/${ARCH_DEST}/sys-root

PATH=${HOME}/cross/${1}/bin:$PATH
export PATH

set +h

function install_directories () {

mkdir -p ${INSTALL_ROOT}/bin
mkdir -p ${INSTALL_ROOT}/lib
mkdir -p ${SYS_ROOT}/usr/include
mkdir -p ${SYS_ROOT}/lib
mkdir -p ${SYS_ROOT}/usr/lib

}

function install_kernel_headers () {

pushd linux-libc-headers

  if [ ! -d ${SYS_ROOT}/usr/include/linux ]
  then
    (
	cd include
	tar cf - asm-${1} linux scsi sound
    ) | (
	cd ${SYS_ROOT}/usr/include
	tar xf -
	ln -fs asm-${1} asm
    )
  fi

popd

}

function install_binutils () {

mkdir -p binutils-${1}
pushd binutils-${1}

  if [ ! -f config.status ]
  then
    ../binutils/configure \
	--prefix=${INSTALL_ROOT} \
	--host=${ARCH_HOST} \
	--build=${ARCH_HOST} \
	--target=${ARCH_DEST} \
	--with-sysroot=${SYS_ROOT} \
	--disable-nls
  fi

  if [ ! -f ld/ld-new ]
  then
    make -s
  fi

  if [ ! -f ${INSTALL_ROOT}/bin/${ARCH_DEST}-ld ]
  then
    make -s install
  fi

popd

}

function install_glibc_headers () {

mkdir -p glibc_headers-${1}
pushd glibc_headers-${1}

  if [ ! -f config.status ]
  then
    # Assuming GCC 3.x
    CC=gcc \
	../glibc/configure \
	--host=${ARCH_HOST} \
	--build=${ARCH_DEST} \
	--prefix=/usr \
	--without-cvs \
	--disable-sanity-checks \
	--with-headers=${SYS_ROOT}/usr/include \
	--enable-hacker-mode
  fi

  if [ ! -f ${SYS_ROOT}/usr/include/signal.h ]
  then
    make -s sysdeps/gnu/errlist.c
    mkdir -p stdio-common
    touch stdio-common/errlist-compat.c
    make -s cross-compiling=yes \
	install_root=${SYS_ROOT} \
	install-headers
  fi

  if [ ! -f ${SYS_ROOT}/usr/include/gnu/stubs.h ]
  then
    mkdir -p ${SYS_ROOT}/usr/include/gnu
    touch ${SYS_ROOT}/usr/include/gnu/stubs.h
  fi

  if [ ! -f ${SYS_ROOT}/usr/include/features.h ]
  then
    cp ../../glibc/include/features.h ${SYS_ROOT}/usr/include/features.h
  fi

  if [ ! -f ${SYS_ROOT}/usr/include/bits/stdio_lim.h ]
  then
    cp bits/stdio_lim.h ${SYS_ROOT}/usr/include/bits/stdio_lim.h
  fi

popd

}

function install_gcc_core () {

mkdir -p gcc-core-${1}
pushd gcc-core-${1}

  if [ ! -f config.status ]
  then
    ../gcc-core/configure \
	--prefix=${INSTALL_ROOT} \
	--host=${ARCH_HOST} \
	--build=${ARCH_HOST} \
	--target=${ARCH_DEST} \
	${GCC_CONFIGURE} \
	--without-newlib \
	--disable-nls \
	--disable-threads \
	--enable-symvers=gnu \
	--enable-__cxa_atexit \
	--enable-languages=c \
	--disable-shared \
	--with-sysroot=${SYS_ROOT}
  fi

  if [ ! -f gcc/xgcc ]
  then
    make -s 
  fi

  if [ ! -f ${INSTALL_ROOT}/bin/${ARCH_DEST}-gcc ]
  then
    make -s install
  fi

  if [ -d ${INSTALL_ROOT}/lib/gcc-lib/${ARCH_DEST} ]
  then
    GCC_LIB=${INSTALL_ROOT}/lib/gcc-lib
  fi
  if [ -d ${INSTALL_ROOT}/lib/gcc/${ARCH_DEST} ]
  then
    GCC_LIB=${INSTALL_ROOT}/lib/gcc
  fi

  if [ ! -f ${GCC_LIB}/${ARCH_DEST}/*/libgcc_eh.a ]
  then
    pushd ${GCC_LIB}/${ARCH_DEST}/*/
    ln -fs libgcc.a libgcc_eh.a
    popd
  fi

popd

}

function install_glibc () {

mkdir -p glibc-${1}
pushd glibc-${1}

  if [ ! -f config.status ]
  then
    BUILD_CC=gcc \
    CFLAGS="${TARGET_CFLAGS}" \
    CC="${ARCH_DEST}-gcc" \
    AS="${ARCH_DEST}-as" \
    AR="${ARCH_DEST}-ar" \
    LD="${ARCH_DEST}-ld" \
    NM="${ARCH_DEST}-nm" \
    RANLIB="${ARCH_DEST}-ranlib" \
    ../glibc/configure \
	--host=${ARCH_DEST} \
	--build=${ARCH_HOST} \
	--prefix=/usr \
	--without-tls \
	--without-__thread \
	--enable-kernel=2.6.7 \
	--without-cvs \
	--disable-profile \
	--disable-debug \
	--without-gd \
	--enable-add-ons=linuxthreads \
	--with-headers=${SYS_ROOT}/usr/include
  fi

  if [ ! -f ${SYS_ROOT}/etc/rpc ]
  then
    make -s
    make -s install \
	install_root=${SYS_ROOT}
  fi

popd

}

function install_gcc () {

mkdir -p gcc-${1}
pushd gcc-${1}

  if [ ! -f config.status ]
  then
    ../gcc/configure \
	--prefix=${INSTALL_ROOT} \
        --host=${ARCH_HOST} \
        --build=${ARCH_HOST} \
        --target=${ARCH_DEST} \
	${GCC_CONFIGURE} \
        --without-newlib \
        --disable-nls \
        --enable-symvers=gnu \
        --enable-__cxa_atexit \
	--enable-threads=posix \
	--enable-shared \
	--enable-c99 \
	--enable-long-long \
        --with-sysroot=${SYS_ROOT}
  fi

  if [ ! -f ${INSTALL_ROOT}/bin/${ARCH_DEST}-g++ ]
  then
    make -s
    make -s install
  fi

popd

}

install_directories ${1}
install_kernel_headers ${1}
install_binutils ${1}
install_glibc_headers ${1}
install_gcc_core ${1}
install_glibc ${1}
# install_gcc ${1}


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]