[Clfs-support] CLFS for Tilera TileGX Multilib - successful attempt + steps taken

David Jenkins daviejenkings at gmail.com
Thu Oct 30 03:02:40 PDT 2014


Hi,

Following my previous post yesterday - I think I've found the issue.
I now managed to complete section 5 (building the cross-compilation
toolchain) by following CLFS-3.0.0-SYSVINIT for PowerPC64-Multilib
with the deviations listed below.
Using this I compiled a "hello world" program with the 4 combinations
(static/dynamic X 32/64) and tested it on an actual TileGX platform
and it works fine.

I am posting as it may be useful for someone who is trying to do the
same. In addition someone with more knowledge may be able to clean up
the steps a bit so TileGX can be added to the (excellent!) CLFS book.

David

-----
HOST DETAILS
===========
Steps tested on this host:
- Architecture: Intel x64

root at vm-ubuntu64:~# uname -a
Linux vm-ubuntu64 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08
UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

- Distribution: Ubuntu 14.04.1LTS
root at vm-ubuntu64:~# cat /etc/issue
Ubuntu 14.04.1 LTS \n \l

- Packages installed after a clean Ubuntu installation:
sudo apt-get install build-essential texinfo gawk bison gettext
autoconf zlib1g-dev

DEVIATIONS FROM CLFS-3.0.0-SYSVINIT PowerPC64-Multilib
==============================================
Section 4.6
CLFS_TARGET=tilegx-unknown-linux-gnu
CLFS_TARGET32=tilegx-unknown-linux-gnu

Section 5.3
Change ARCH=powerpc to ARCH=tilegx

Section 5.13
After unpacking the sources and before issuing the "configure"
command, do these steps:

- Create feedback.h file:

cat > /tools/include/feedback.h << EOF
#ifndef _FEEDBACK_H
#define _FEEDBACK_H 1

#ifdef __ASSEMBLER__

/* Stub defines for feedback instrumentation.  */
#define FEEDBACK_ENTER_EXPLICIT(FUNCNAME, SECNAME, SIZE)
#define FEEDBACK_ENTER(FUNCNAME)
#define FEEDBACK_REENTER(FUNCNAME)
#define FEEDBACK_ENTRY(FUNCNAME, SECNAME, SIZE)

#endif /* __ASSEMBLER__ */

#endif /* _FEEDBACK_H */
EOF

- Create dummy stubs.h file (will be overwritten in section 5.14+5.15
when glibc installs):

touch /tools/include/gnu/stubs.h

- Make gmp.h available in the /tools/include directory:

ln -s /cross-tools/include/gmp.h /tools/include/gmp.h

- Install glibc headers (just the headers - don't compile) - run this
from somewhere you unpacked the glibc sources:

mkdir -v ../glibchdr
cd ../glibchdr

cat > config.cache << EOF
libc_cv_autoconf_works=yes
libc_cv_ssp=no
libc_cv_predef_stack_protector=no
libc_cv_z_relro=yes
EOF

../glibc-2.19/configure \
    --prefix=/tools \
    --host=${CLFS_TARGET} \
    --build=${CLFS_HOST} \
    --disable-profile \
    --enable-kernel=2.6.32 \
    --with-binutils=/cross-tools/bin \
    --with-headers=/tools/include \
    --enable-obsolete-rpc \
    --cache-file=config.cache

make install-headers

(NOTE - some errors will be shown but the headers will be installed in
/tools/include)

- Fix the target makefile for tilegx; Tilera assumed 32bit libraries
will go in /lib32 and 64-bit libraries in /lib; CLFS assumes 32-bit in
/lib and 64-bit in /lib64. This causes linking errors during build. In
the GCC source directory:

vi gcc/config/tilegx/t-tilegx

Then, change the line:
MULTILIB_OSDIRNAMES = ../lib ../lib32

to these two lines (taken from the powerpc target makefile):
MULTILIB_OSDIRNAMES := m64=../lib64
MULTILIB_OSDIRNAMES += m32=$(if $(wildcard $(shell echo
$(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)

- You can now proceed with configure and make for the bootstrap GCC

Section 5.16
If using a separate source directory from section 5.13, before the
"configure" command repeat the steps above to fix the t-tilegx file



More information about the Clfs-support mailing list