[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: sysroot not supported in gcc-sh4-cross package

Dear sir,

I collect the web information and write down the memo to cross compile the
SH4 toolchain. But still I can not build for the gcc compiler. Below is my
memo. Could anybody help me to check what's wrong for gcc build portion.
#Build a cross-compilation toolchain
#Create a working directory
mkdir -p ~/src/cross-toolchain
cd ~/src/cross-toolchain

#Some useful variables
#These will be used in the commands in this document. Replace "arm" with the
architecture for which you are building a cross-compiler.
export -n ARCH=sh4  # set and do not export to invoked commands

#Get the source for binutils and GCC
apt-get source binutils gcc-4.4

#Install Build-Depends
sudo apt-get build-dep binutils gcc

#Install fakeroot
#fakeroot allows you to build packages without being root.
sudo apt-get install fakeroot

#Install dpkg-cross
#dpkg-cross adds cross-compilation support to some of the basic Debian
package tools. dpkg-cross can also convert packages designed for the target
architecture into packages usable for cross-compilation to that
sudo apt-get install dpkg-cross

#Build and install binutils
cd binutils-VERSION
gzip -cd binutils-XXX-diff.gz | patch -p0
TARGET=sh4-linux-gnu BUILD_SYSROOT=/usr fakeroot debian/rules binary-cross
cd ..
sudo dpkg -i binutils-sh4-linux-gnu_VERSION_HOSTARCH.deb

#Convert library packages
#You will need cross-compilation packages for various libraries; dpkg-cross
can convert native packages for the target architecture into packages usable
for cross-compilation. Note that the mirror ftp.us.debian.org only has amd64
and i386 packages, so to build a cross-compilation toolchain for another
architecture (e.g. arm), you will have to use a mirror other than

dpkg-cross -a sh4 -b l*.deb
sudo dpkg -i l*sh4-cross*.deb

#Build and install GCC
#Now that you have all the necessary prerequisites, you can build a
cross-compiling GCC.
cd gcc-VERSION
gzip -cd gcc-XXX-diff.gz | patch -p0
GCC_TARGET=sh4-linux-gnu BUILD_SYSROOT=/usr fakeroot debian/rules binary 
cd ..
sudo dpkg -i *-VERSION-sh4-linux-gnu*.deb *-sh4-cross_VERSION*.deb

ERROR logs
$ GCC_TARGET=sh4-linux-gnu BUILD_SYSROOT=/usr fakeroot debian/rules binary
mkdir -p stamps
/usr/bin/make -f debian/rules.conf control
make[1]: Entering directory `/home/jordan
http://old.nabble.com/file/p28287684/crosstool.txt crosstool.txt
debian/rules.conf:160: *** Recursive variable `LIBC_DEP' references itself
(eventually).  Stop.

Please help.

Jordan Pan wrote:
> Dear sir,
>    I am trying to build the rootfs by the gcc-sh4-cross
> (http://debian-sh4.nigauri.org/cross-compiler/) package. But
> unfortunately, the cross compiler doesn't support the --sysroot option.
> Does anybody know how to work around this issue? Or if I should do the
> cross compiler by myself, please share the build procedure for reference
> (I have try to use reference guidance from
> http://www.emdebian.org/tools/crossdev.html and
> http://wiki.debian.org/SH4/CrossToolchain, but it doesn't work for me) .
> -----------------
> Checking external toolchain settings
> External toolchain doesn't support --sysroot. Cannot use.
> -----------------
> Regards
> Jordan

View this message in context: http://old.nabble.com/sysroot-not-supported-in-gcc-sh4-cross-package-tp28280677p28287684.html
Sent from the debian-superh mailing list archive at Nabble.com.

Reply to: