crossplatform.ru

Здравствуйте, гость ( Вход | Регистрация )

 
Ответить в данную темуНачать новую тему
> проблемы сборки glibc
igor_bogomolov
  опции профиля:
сообщение 2.9.2011, 15:04
Сообщение #1


Профессионал
*****

Группа: Сомодератор
Сообщений: 1215
Регистрация: 22.3.2009
Из: Саратов
Пользователь №: 630

Спасибо сказали: 235 раз(а)




Репутация:   29  


Никак не получается собрать glibc для своего toolchain.
Собираю так

Общие переменные
TARGET=arm-qivb-linux-gnueabi
PREFIX=$PWD/$TARGET
SYSROOT=$PREFIX/sys-root

TARGET_SPECS="libc_cv_forced_unwind=yes libc_cv_c_cleanup=yes"

export PATH=$PREFIX/bin:$PATH

LINUX_VERSION=2.6-imx-rel_imx_2.6.35_10.12.01_RC4
BINUTILS_VERSION=2.21.53.0.1
GCC_VERSION=linaro-4.5-2011.08
GLIBC_VERSION=2.13

CUR_DIR=$PWD
SRC_DIR=$PWD/src
BUILD_DIR=$PWD/build

mkdir -p $SRC_DIR
mkdir -p $BUILD_DIR

Install kernel headers
#Linux Kernel Header

echo -n "Extract linux kernel... "
tar -xzf linux-$LINUX_VERSION.tar.gz -C $SRC_DIR

echo -n "Install kernel headers..."
mkdir -p $BUILD_DIR/linux-$LINUX_VERSION
cd $SRC_DIR/linux-$LINUX_VERSION
make -j4 O=$BUILD_DIR/linux-$LINUX_VERSION ARCH=arm INSTALL_HDR_PATH=$SYSROOT/usr headers_install
make -j4 O=$BUILD_DIR/linux-$LINUX_VERSION ARCH=arm INSTALL_HDR_PATH=$SYSROOT/usr headers_check

cd $CUR_DIR
GNU binutils
#GNU binutils

echo "Extract binutils... "
tar -xjf binutils-$BINUTILS_VERSION.tar.bz2 -C $SRC_DIR

echo "Configure binutils... "
mkdir -p $BUILD_DIR/binutils-$BINUTILS_VERSION
cd $BUILD_DIR/binutils-$BINUTILS_VERSION
$SRC_DIR/binutils-$BINUTILS_VERSION/configure --prefix=$PREFIX \
                                              --target=$TARGET \
                                              --with-sysroot=$SYSROOT \
                                              --disable-multilib \
                                              --disable-werror \
                                              --disable-nls

echo "Build binutils... "
make -j4
make install

cd $CUR_DIR
GCC для сборки glibc
# Stage 1 GCC

echo -n "Extract gcc... "
tar -xjf gcc-$GCC_VERSION.tar.bz2 -C $SRC_DIR

echo -n "Configure static gcc..."
mkdir -p $BUILD_DIR/gcc-$GCC_VERSION
cd $BUILD_DIR/gcc-$GCC_VERSION
$SRC_DIR/gcc-$GCC_VERSION/configure --target=$TARGET \
                                    --prefix=$PREFIX \
                                    --with-local-prefix=$SYSROOT \
                                    --with-sysroot=$SYSROOT \
                                    --with-newlib \
                                    --disable-multilib \
                                    --disable-libmudflap \
                                    --disable-shared \
                                    --enable-threads=no \
                                    --enable-__cxa_atexit \
                                    --enable-target-optspace \
                                    --disable-nls \
                                    --enable-languages=c

echo -n "Build static gcc... "
make -j4 all-gcc
make install-gcc

cd $CUR_DIR
Build glibc basic files
#GNU C Library

echo "Install glibs start files:"
mkdir -p $BUILD_DIR/glibc-$GLIBC_VERSION_1
cd $BUILD_DIR/glibc-$GLIBC_VERSION_1

echo -n "        configure... "

BUILD_CC=gcc CC=${TARGET}-gcc AR=${TARGET}-ar RANLIB=${TARGET}-ranlib LDFLAGS="" \
$SRC_DIR/glibc-$GLIBC_VERSION/configure --prefix=/$PREFIX \
                                        --build=i686-pc-linux-gnu \
                                        --host=${TARGET} \
                                        --without-cvs \
                                        --disable-profile \
                                        --disable-debug \
                                        --without-gd \
                                        --with-headers=$SYSROOT/usr/include \
                                        --cache-file=config.cache \
                                        --with-__thread \
                                        --with-tls \
                                        --enable-shared \
                                        $TARGET_SPECS \
                                        --enable-add-ons=nptl,ports \
                                        --enable-kernel=2.6.35 \
                                        --with-fp \
                                        --with-binutils=$PREFIX/bin


Последний шаг заканчивается ошибкой
Раскрывающийся текст
Цитата
checking for ld --version-script... no
*** WARNING: You should not compile GNU libc without versioning. Not using
*** versioning will introduce incompatibilities so that old binaries
*** will not run anymore.
*** For versioning you need recent binutils (binutils-2.8.1.0.23 or newer).
checking for .previous assembler directive... yes
checking for .protected and .hidden assembler directive... yes
checking whether __attribute__((visibility())) is supported... yes
checking for broken __attribute__((visibility()))... no
checking for broken __attribute__((alias()))... no
checking whether to put _rtld_local into .sdata section... no
checking for .preinit_array/.init_array/.fini_array support... no
configure: error: Need linker with .init_array/.fini_array support.

У кого есть опыт в этом деле, как собрать glibc своими руками?
Перейти в начало страницы
 
Быстрая цитата+Цитировать сообщение
Iron Bug
  опции профиля:
сообщение 2.9.2011, 17:07
Сообщение #2


Профессионал
*****

Группа: Модератор
Сообщений: 1611
Регистрация: 6.2.2009
Из: Yekaterinburg
Пользователь №: 533

Спасибо сказали: 219 раз(а)




Репутация:   12  


хэдеры ядра установлены? (ну или сорцы, если самосборное ядро)
и вообще, этот linaro в принципе может скомпилировать glibc? это же урезанный компилер для ARM, если я правильно понимаю. не факт, что он может сожрать последний glibc. запросто может оказться, что там надо в опциях что-нибудь отключать в конфиге.
Перейти в начало страницы
 
Быстрая цитата+Цитировать сообщение
igor_bogomolov
  опции профиля:
сообщение 2.9.2011, 23:19
Сообщение #3


Профессионал
*****

Группа: Сомодератор
Сообщений: 1215
Регистрация: 22.3.2009
Из: Саратов
Пользователь №: 630

Спасибо сказали: 235 раз(а)




Репутация:   29  


Все что нужно для сборки конечно же установлено.

Если я для сборки тулчейна использую сторонние системы сборки, конкретно ptxdist, подсунув ему все те же исходники - все собирается.
Но я хочу самостоятельно собрать тулчейн из исходников, написав свой скрипт сборки.
Пока не получается. :(
Перейти в начало страницы
 
Быстрая цитата+Цитировать сообщение
Iron Bug
  опции профиля:
сообщение 2.9.2011, 23:35
Сообщение #4


Профессионал
*****

Группа: Модератор
Сообщений: 1611
Регистрация: 6.2.2009
Из: Yekaterinburg
Пользователь №: 533

Спасибо сказали: 219 раз(а)




Репутация:   12  


я его собирала, но он был более древний. там для его сборки нужно дофига всякой мелкой фигни. у них на сайте есть список необходимых пакетов и вроде даже порядок сборки. а там уже смотри конкретно где в скрипте конфига он запарывается и выясняй, чего ему не хватает. и так по каждому затыку.

Сообщение отредактировал Iron Bug - 2.9.2011, 23:36
Перейти в начало страницы
 
Быстрая цитата+Цитировать сообщение
igor_bogomolov
  опции профиля:
сообщение 15.9.2011, 13:31
Сообщение #5


Профессионал
*****

Группа: Сомодератор
Сообщений: 1215
Регистрация: 22.3.2009
Из: Саратов
Пользователь №: 630

Спасибо сказали: 235 раз(а)




Репутация:   29  


Что бы как то закрыть тему, прилагаю пример скриптов для сборки тулчейна для armv5te

config.sh
TARGET=arm-v5te_vfp-linux-gnueabi
HOST=i686-pc-linux-gnu

PREFIX=$PWD/$TARGET
SYSROOT=$PREFIX/sys-root

LINUX_VERSION=2.6-imx-rel_imx_2.6.35_10.12.01_RC4
BINUTILS_VERSION=2.21.53.0.1
GCC_VERSION=linaro-4.5-2011.08
GLIBC_VERSION=2.13
GDB_VERSION=linaro-7.3-2011.08

CUR_DIR=$PWD
BUILD_DIR=$PWD/build
SRC_DIR=$BUILD_DIR/src
TARBALLS_DIR=$PWD/tarballs

PARALLELMFLAGS=-j4

if [ ! -d "$SRC_DIR" ]; then
    mkdir -p $SRC_DIR
fi

if [ ! -d "$BUILD_DIR" ]; then
    mkdir -p $BUILD_DIR
fi

export PATH=$PREFIX/bin:$PREFIX/gcc-first/bin:$PATH

set -o pipefail
check_success() {
   if [ $? -ne 0 ]
   then
      exit 1
   fi
}

BUILD_LOG=$BUILD_DIR/build.log
build-binutils.sh
source config.sh

echo "+---------------------------------+" | tee    $BUILD_LOG
echo "| Extract binutils...             |" | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG

tar -xjf $TARBALLS_DIR/binutils-$BINUTILS_VERSION.tar.bz2 -C $SRC_DIR 2>&1 | tee -a $BUILD_LOG
check_success

echo | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG
echo "| Configure binutils...           |" | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG

mkdir -pv $BUILD_DIR/binutils-$BINUTILS_VERSION-build 2>&1 | tee -a $BUILD_LOG && \
cd $BUILD_DIR/binutils-$BINUTILS_VERSION-build
check_success

$SRC_DIR/binutils-$BINUTILS_VERSION/configure \
    --target=$TARGET \
    --prefix=$PREFIX \
    --with-sysroot=$SYSROOT \
    --disable-werror \
    --disable-nls \
    --disable-multilib \
    2>&1 | tee -a $BUILD_LOG
check_success

echo | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG
echo "| Build binutils...               |" | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG

make $PARALLELMFLAGS 2>&1 | tee -a $BUILD_LOG
check_success

echo | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG
echo "| Install binutils...             |" | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG

make install 2>&1 | tee -a $BUILD_LOG
check_success

mkdir -pv "$PREFIX/gcc-first/$TARGET/bin" 2>&1 | tee -a $BUILD_LOG && \
cd $PREFIX/gcc-first/$TARGET/bin/
check_success

for file in ar as ld nm objcopy objdump ranlib strip; do
    ln -sfv "../../../$TARGET/bin/$file" "$PREFIX/gcc-first/$TARGET/bin/$file" 2>&1 | tee -a $BUILD_LOG
    check_success
done

cd $CUR_DIR
build-linux_headers.sh
source config.sh

echo | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG
echo "| Extract linux kernel...         |" | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG
tar -xzf $TARBALLS_DIR/linux-$LINUX_VERSION.tar.gz -C $SRC_DIR 2>&1 | tee -a $BUILD_LOG
check_success

echo | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG
echo "| Prepare kernel headers...       |" | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG

mkdir -p $BUILD_DIR/linux-$LINUX_VERSION-headers-build 2>&1 | tee -a $BUILD_LOG && \
cd $SRC_DIR/linux-$LINUX_VERSION
check_success

KERNEL_HEADERS_MAKEVARS="\
    O=$BUILD_DIR/linux-$LINUX_VERSION-headers-build \
    ARCH=arm \
    $PARALLELMFLAGS"

make -C $SRC_DIR/linux-$LINUX_VERSION $KERNEL_HEADERS_MAKEVARS defconfig 2>&1 | tee -a $BUILD_LOG && \
make $KERNEL_HEADERS_MAKEVARS oldconfig >> /dev/null 2>&1
check_success

echo | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG
echo "| Install kernel headers...       |" | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG

make -C $SRC_DIR/linux-$LINUX_VERSION $KERNEL_HEADERS_MAKEVARS headers_install INSTALL_HDR_PATH=$SYSROOT/usr  2>&1 | tee -a $BUILD_LOG && \
make $KERNEL_HEADERS_MAKEVARS INSTALL_HDR_PATH=$SYSROOT/usr headers_check 2>&1 | tee -a $BUILD_LOG
check_success

cd $CUR_DIR
build-glibc_headers.sh
source config.sh

echo | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG
echo "| Extract glibc...                |" | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG

tar -xjf $TARBALLS_DIR/glibc-$GLIBC_VERSION.tar.bz2 -C $SRC_DIR 2>&1 | tee -a $BUILD_LOG
check_success

echo | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG
echo "| Patch glibc...                  |" | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG

patch -d $SRC_DIR/glibc-$GLIBC_VERSION/ -p1 < $TARBALLS_DIR/patches/glibc-$GLIBC_VERSION/0001-install-lib-all.patch 2>&1 | tee -a $BUILD_LOG && \
patch -d $SRC_DIR/glibc-$GLIBC_VERSION/ -p1 < $TARBALLS_DIR/patches/glibc-$GLIBC_VERSION/0002-fix-build-with-static-nss.patch 2>&1 | tee -a $BUILD_LOG && \
patch -d $SRC_DIR/glibc-$GLIBC_VERSION/ -p1 < $TARBALLS_DIR/patches/glibc-$GLIBC_VERSION/0003-glibc-configure-old-gcc.patch 2>&1 | tee -a $BUILD_LOG && \
patch -d $SRC_DIR/glibc-$GLIBC_VERSION/ -p1 < $TARBALLS_DIR/patches/glibc-$GLIBC_VERSION/0004-configure-in-sane-readelf.patch 2>&1 | tee -a $BUILD_LOG && \
patch -d $SRC_DIR/glibc-$GLIBC_VERSION/ -p1 < $TARBALLS_DIR/patches/glibc-$GLIBC_VERSION/0005-stdlib-longlong.patch 2>&1 | tee -a $BUILD_LOG && \
patch -d $SRC_DIR/glibc-$GLIBC_VERSION/ -p1 < $TARBALLS_DIR/patches/glibc-$GLIBC_VERSION/0006-respect-env-CPPFLAGS.patch 2>&1 | tee -a $BUILD_LOG && \
patch -d $SRC_DIR/glibc-$GLIBC_VERSION/ -p1 < $TARBALLS_DIR/patches/glibc-$GLIBC_VERSION/0007-i586-chk.patch 2>&1 | tee -a $BUILD_LOG && \
patch -d $SRC_DIR/glibc-$GLIBC_VERSION/ -p1 < $TARBALLS_DIR/patches/glibc-$GLIBC_VERSION/0008-i386-x86_64-revert-clone-cfi.patch 2>&1 | tee -a $BUILD_LOG && \
patch -d $SRC_DIR/glibc-$GLIBC_VERSION/ -p1 < $TARBALLS_DIR/patches/glibc-$GLIBC_VERSION/0009-queue-header-updates.patch 2>&1 | tee -a $BUILD_LOG && \
patch -d $SRC_DIR/glibc-$GLIBC_VERSION/ -p1 < $TARBALLS_DIR/patches/glibc-$GLIBC_VERSION/0010-manual-no-perl.patch 2>&1 | tee -a $BUILD_LOG && \
patch -d $SRC_DIR/glibc-$GLIBC_VERSION/ -p1 < $TARBALLS_DIR/patches/glibc-$GLIBC_VERSION/0011-localedef-fix-trampoline.patch 2>&1 | tee -a $BUILD_LOG && \
patch -d $SRC_DIR/glibc-$GLIBC_VERSION/ -p1 < $TARBALLS_DIR/patches/glibc-$GLIBC_VERSION/0012-posix-awk.patch 2>&1 | tee -a $BUILD_LOG && \
patch -d $SRC_DIR/glibc-$GLIBC_VERSION/ -p1 < $TARBALLS_DIR/patches/glibc-$GLIBC_VERSION/0013-resolv-dynamic.patch 2>&1 | tee -a $BUILD_LOG && \
patch -d $SRC_DIR/glibc-$GLIBC_VERSION/ -p1 < $TARBALLS_DIR/patches/glibc-$GLIBC_VERSION/0014-section-comments.patch 2>&1 | tee -a $BUILD_LOG && \
patch -d $SRC_DIR/glibc-$GLIBC_VERSION/ -p1 < $TARBALLS_DIR/patches/glibc-$GLIBC_VERSION/0015-no-inline-gmon.patch 2>&1 | tee -a $BUILD_LOG && \
patch -d $SRC_DIR/glibc-$GLIBC_VERSION/ -p1 < $TARBALLS_DIR/patches/glibc-$GLIBC_VERSION/0016-china.patch 2>&1 | tee -a $BUILD_LOG && \
patch -d $SRC_DIR/glibc-$GLIBC_VERSION/ -p1 < $TARBALLS_DIR/patches/glibc-$GLIBC_VERSION/0017-new-valencian-locale.patch 2>&1 | tee -a $BUILD_LOG && \
patch -d $SRC_DIR/glibc-$GLIBC_VERSION/ -p1 < $TARBALLS_DIR/patches/glibc-$GLIBC_VERSION/0018-strict-aliasing.patch 2>&1 | tee -a $BUILD_LOG && \
patch -d $SRC_DIR/glibc-$GLIBC_VERSION/ -p1 < $TARBALLS_DIR/patches/glibc-$GLIBC_VERSION/0019-undefine-__i686.patch 2>&1 | tee -a $BUILD_LOG && \
patch -d $SRC_DIR/glibc-$GLIBC_VERSION/ -p1 < $TARBALLS_DIR/patches/glibc-$GLIBC_VERSION/0020-dl_execstack-PaX-support.patch 2>&1 | tee -a $BUILD_LOG && \
patch -d $SRC_DIR/glibc-$GLIBC_VERSION/ -p1 < $TARBALLS_DIR/patches/glibc-$GLIBC_VERSION/0021-pre20040117-pt_pax.patch 2>&1 | tee -a $BUILD_LOG && \
patch -d $SRC_DIR/glibc-$GLIBC_VERSION/ -p1 < $TARBALLS_DIR/patches/glibc-$GLIBC_VERSION/0022-fpscr_values.patch 2>&1 | tee -a $BUILD_LOG && \
patch -d $SRC_DIR/glibc-$GLIBC_VERSION/ -p1 < $TARBALLS_DIR/patches/glibc-$GLIBC_VERSION/0023-Fix-prelinking.patch 2>&1 | tee -a $BUILD_LOG
check_success

echo | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG
echo "| Extract glibc ports...          |" | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG

tar -xjf $TARBALLS_DIR/glibc-ports-$GLIBC_VERSION.tar.bz2 -C $SRC_DIR 2>&1 | tee -a $BUILD_LOG
check_success

echo | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG
echo "| Patch glibc ports...            |" | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG

patch -d $SRC_DIR/glibc-ports-$GLIBC_VERSION/ -p1 < $TARBALLS_DIR/patches/glibc-ports-$GLIBC_VERSION/0001-Revert-fix-unwinding-through-Thumb-2-system-calls.patch 2>&1 | tee -a $BUILD_LOG
check_success

echo | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG
echo "| Move glibc-ports into glibc...  |" | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG
mv -v $SRC_DIR/glibc-ports-$GLIBC_VERSION $SRC_DIR/glibc-$GLIBC_VERSION/ports 2>&1 | tee -a $BUILD_LOG
check_success

echo | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG
echo "| Configure  glibc...             |" | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG

mkdir -pv $BUILD_DIR/glibc-$GLIBC_VERSION-headers-build 2>&1 | tee -a $BUILD_LOG && \
cd $BUILD_DIR/glibc-$GLIBC_VERSION-headers-build
check_success

GLIBC_HEADERS_ENV="\
    libc_cv_forced_unwind=yes \
    libc_cv_c_cleanup=yes \
    libc_cv_ppc_machine=yes \
    libc_cv_asm_cfi_directive_sections=yes \
    libc_cv_asm_cfi_directives=yes \
    libc_cv_asm_protected_directive=yes \
    libc_cv_asm_symver_directive=yes \
    libc_cv_broken_alias_attribute=no \
    libc_cv_broken_visibility_attribute=no \
    libc_cv_gcc___thread=yes \
    libc_cv_initfini_array=yes \
    libc_cv_visibility_attribute=yes \
    libc_cv_z_initfirst=yes \
    libc_cv_z_nodelete=yes \
    libc_cv_z_nodlopen=yes \
    libc_cv_z_relro=yes \
    libc_cv_386_tls=yes \
    libc_cv_arm_tls=yes \
    libc_cv_mips_tls=yes \
    libc_cv_have_sdata_section=yes \
    libc_cv_powerpc32_tls=yes \
    libc_cv_powerpc64_tls=yes \
    libc_cv_mlong_double_128ibm=set \
    libc_cv_mlong_double_128=set \
    libc_cv_ppc_rel16=yes \
    ac_cv_header_cpuid_h=yes \
    ac_cv_path_GREP=grep"

CC="gcc -D__ARM_EABI__" \
CXX="g++" \
$SRC_DIR/glibc-$GLIBC_VERSION/configure \
    --prefix=/usr \
    --host=$TARGET \
    --target=$TARGET \
    --with-headers=$SYSROOR/usr/include \
    --without-cvs \
    --without-gd \
    --without-selinux \
    --disable-sanity-checks \
    --enable-hacker-mode \
    --with-tls \
    --with-__thread \
    --enable-add-ons=ports,nptl \
    $GLIBC_HEADERS_ENV \
    2>&1 | tee -a $BUILD_LOG
check_success

echo | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG
echo "| Prepare glibc...                |" | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG

CC="gcc -D__ARM_EABI__" \
CXX="g++" \
make $GLIBC_HEADERS_ENV sysdeps/gnu/errlist.c 2>&1 | tee -a $BUILD_LOG
check_success

mkdir -pv $BUILD_DIR/glibc-$GLIBC_VERSION-headers-build/stdio-common 2>&1 | tee -a $BUILD_LOG && \
touch $BUILD_DIR/glibc-$GLIBC_VERSION-headers-build/stdio-common/errlist-compat.c 2>&1 | tee -a $BUILD_LOG
check_success

echo | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG
echo "| Install glibc headers...        |" | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG

CC="gcc -D__ARM_EABI__" \
CXX="g++" \
make cross-compiling=yes $GLIBC_HEADERS_ENV install_root=$SYSROOT install-headers 2>&1 | tee -a $BUILD_LOG
check_success

mkdir -pv $SYSROOT/usr/include/gnu 2>&1 | tee -a $BUILD_LOG && \
touch $SYSROOT/usr/include/gnu/stubs.h 2>&1 | tee -a $BUILD_LOG
check_success

cp -v $SRC_DIR/glibc-$GLIBC_VERSION/include/features.h $SYSROOT/usr/include/features.h 2>&1 | tee -a $BUILD_LOG && \
cp -v bits/stdio_lim.h $SYSROOT/usr/include/bits/stdio_lim.h 2>&1 | tee -a $BUILD_LOG
check_success

cd $CUR_DIR
.build-gcc_firstsh
source config.sh

echo | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG
echo "| Extract gcc...                  |" | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG

tar -xjf $TARBALLS_DIR/gcc-$GCC_VERSION.tar.bz2 -C $SRC_DIR 2>&1 | tee -a $BUILD_LOG
check_success

echo | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG
echo "| Patch gcc...                    |" | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG

patch -d $SRC_DIR/gcc-$GCC_VERSION/ -p1 < $TARBALLS_DIR/patches/gcc-linaro-4.5-2011/0001-no-host-includes.diff 2>&1 | tee -a $BUILD_LOG && \
patch -d $SRC_DIR/gcc-$GCC_VERSION/ -p1 < $TARBALLS_DIR/patches/gcc-linaro-4.5-2011/0002-arm-softfloat.diff 2>&1 | tee -a $BUILD_LOG && \
patch -d $SRC_DIR/gcc-$GCC_VERSION/ -p1 < $TARBALLS_DIR/patches/gcc-linaro-4.5-2011/0003-pr39429.diff 2>&1 | tee -a $BUILD_LOG && \
patch -d $SRC_DIR/gcc-$GCC_VERSION/ -p1 < $TARBALLS_DIR/patches/gcc-linaro-4.5-2011/0004-uclibc-conf.patch 2>&1 | tee -a $BUILD_LOG && \
patch -d $SRC_DIR/gcc-$GCC_VERSION/ -p1 < $TARBALLS_DIR/patches/gcc-linaro-4.5-2011/0005-missing-execinfo_h.patch 2>&1 | tee -a $BUILD_LOG && \
patch -d $SRC_DIR/gcc-$GCC_VERSION/ -p1 < $TARBALLS_DIR/patches/gcc-linaro-4.5-2011/0006-c99-snprintf.patch 2>&1 | tee -a $BUILD_LOG && \
patch -d $SRC_DIR/gcc-$GCC_VERSION/ -p1 < $TARBALLS_DIR/patches/gcc-linaro-4.5-2011/0007-libmudflap-susv3-legacy.patch 2>&1 | tee -a $BUILD_LOG && \
patch -d $SRC_DIR/gcc-$GCC_VERSION/ -p1 < $TARBALLS_DIR/patches/gcc-linaro-4.5-2011/0008-arm_insn-opinit-RTX_CODE-fixup.patch 2>&1 | tee -a $BUILD_LOG && \
patch -d $SRC_DIR/gcc-$GCC_VERSION/ -p1 < $TARBALLS_DIR/patches/gcc-linaro-4.5-2011/0009-short-enums.diff 2>&1 | tee -a $BUILD_LOG && \
patch -d $SRC_DIR/gcc-$GCC_VERSION/ -p1 < $TARBALLS_DIR/patches/gcc-linaro-4.5-2011/0010-all_gcc-trampolinewarn.patch 2>&1 | tee -a $BUILD_LOG && \
patch -d $SRC_DIR/gcc-$GCC_VERSION/ -p1 < $TARBALLS_DIR/patches/gcc-linaro-4.5-2011/0011-flatten-switch-stmt-00.patch 2>&1 | tee -a $BUILD_LOG && \
patch -d $SRC_DIR/gcc-$GCC_VERSION/ -p1 < $TARBALLS_DIR/patches/gcc-linaro-4.5-2011/0012-libiberty-pic.patch 2>&1 | tee -a $BUILD_LOG && \
patch -d $SRC_DIR/gcc-$GCC_VERSION/ -p1 < $TARBALLS_DIR/patches/gcc-linaro-4.5-2011/0013-libstdc++-pic.patch 2>&1 | tee -a $BUILD_LOG && \
patch -d $SRC_DIR/gcc-$GCC_VERSION/ -p1 < $TARBALLS_DIR/patches/gcc-linaro-4.5-2011/0015-Fix-libjava-cross-build-issue.patch 2>&1 | tee -a $BUILD_LOG && \
patch -d $SRC_DIR/gcc-$GCC_VERSION/ -p1 < $TARBALLS_DIR/patches/gcc-linaro-4.5-2011/0016-debian-patch-revert-issue1259.patch 2>&1 | tee -a $BUILD_LOG
check_success

echo | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG
echo "| Configure gcc first...          |" | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG

mkdir -pv $BUILD_DIR/gcc-$GCC_VERSION-first-build 2>&1 | tee -a $BUILD_LOG && \
cd $BUILD_DIR/gcc-$GCC_VERSION-first-build
check_success

$SRC_DIR/gcc-$GCC_VERSION/configure \
    --target=$TARGET \
    --with-sysroot=$SYSROOT \
    --disable-multilib \
    --with-float=softfp \
    --with-fpu=vfp \
    --with-cpu=arm926ej-s \
    --enable-__cxa_atexit \
    --disable-sjlj-exceptions \
    --disable-nls \
    --disable-decimal-float \
    --disable-fixed-point \
    --disable-win32-registry \
    --enable-symvers=gnu \
    --with-pkgversion="skitlab" \
    --prefix=$PREFIX/gcc-first \
    --disable-shared \
    --enable-languages=c \
    --with-ld=$PREFIX/bin/$TARGET-ld \
    --with-as=$PREFIX/bin/$TARGET-as \
    --disable-checking \
    --disable-libmudflap \
    --disable-libssp \
    --disable-libgomp \
    --with-system-zlib \
    2>&1 | tee -a $BUILD_LOG
check_success


echo | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG
echo "| Build gcc first...              |" | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG

make $PARALLELMFLAGS 2>&1 | tee -a $BUILD_LOG
check_success

echo | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG
echo "| Install gcc first...            |" | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG

make install 2>&1 | tee -a $BUILD_LOG && \
ln -sfv libgcc.a `$PREFIX/gcc-first/bin/$TARGET-gcc -print-libgcc-file-name | sed 's/libgcc/&_eh/'` 2>&1 | tee -a $BUILD_LOG && \
ln -sfv libgcc.a `$PREFIX/gcc-first/bin/$TARGET-gcc -print-libgcc-file-name | sed 's/libgcc/&_s/'` 2>&1 | tee -a $BUILD_LOG
check_success

cd $CUR_DIR
build-glibc_start_files.sh
source config.sh

echo | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG
echo "| Configure glibc start files...  |" | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG

mkdir -pv $BUILD_DIR/glibc-$GLIBC_VERSION-start_files-build 2>&1 | tee -a $BUILD_LOG && \
cd $BUILD_DIR/glibc-$GLIBC_VERSION-start_files-build
check_success

BUILD_CC=gcc \
ac_cv_path_GREP=grep \
ac_cv_sizeof_long_double="8" \
libc_cv_c_cleanup=yes \
libc_cv_forced_unwind=yes \
$SRC_DIR/glibc-$GLIBC_VERSION/configure \
    --prefix=/usr \
    --host=$TARGET \
    --target=$TARGET \
    --with-headers=$SYSROOT/usr/include \
    --enable-add-ons=ports,nptl \
    --without-cvs \
    --without-gd \
    --without-selinux \
    --disable-sanity-checks \
    --with-tls \
    --with-__thread \
    --enable-kernel="2.6.35" \
    --enable-debug \
    --enable-profile \
    --enable-shared \
    --enable-static-nss \
    2>&1 | tee -a $BUILD_LOG
check_success

echo | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG
echo "| Build glibc start files...      |" | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG

make $PARALLELMFLAGS csu/subdir_lib 2>&1 | tee -a $BUILD_LOG
check_success

echo | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG
echo "| Install glibc start files...    |" | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG

mkdir -pv $SYSROOT/usr/lib/ 2>&1 | tee -a $BUILD_LOG && \
cp -fpv csu/crt1.o csu/crti.o csu/crtn.o $SYSROOT/usr/lib/ 2>&1 | tee -a $BUILD_LOG
check_success

cd $CUR_DIR
build-glibc_first.sh
source config.sh

echo | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG
echo "| Configure glibc first...        |" | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG

mkdir -pv $BUILD_DIR/glibc-$GLIBC_VERSION-first-build 2>&1 | tee -a $BUILD_LOG && \
cd $BUILD_DIR/glibc-$GLIBC_VERSION-first-build
check_success

CC=$TARGET-gcc \
CXX=false \
BUILD_CC=gcc \
libc_cv_c_cleanup=yes \
libc_cv_forced_unwind=yes \
libc_cv_fpie=yes \
libc_cv_ssp=yes \
libc_cv_visibility_attribute=yes \
libc_cv_broken_visibility_attribute=no \
libc_cv_z_relro=yes \
ac_cv_sizeof_long_double="8" \
$SRC_DIR/glibc-$GLIBC_VERSION/configure \
    --prefix=/usr \
    --host=$TARGET \
    --target=$TARGET \
    --with-headers=$SYSROOT/usr/include \
    --without-cvs \
    --without-gd \
    --without-selinux \
    --disable-sanity-checks \
    --with-tls \
    --with-__thread \
    --disable-debug \
    --disable-profile \
    --enable-add-ons=nptl,ports \
     2>&1 | tee -a $BUILD_LOG
check_success

echo | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG
echo "| Build glibc first...            |" | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG

make $PARALLELMFLAGS lib 2>&1 | tee -a $BUILD_LOG
check_success

echo | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG
echo "| Install glibc first...          |" | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG

make AUTOCONF=no install_root=$SYSROOT install-lib-all install-headers 2>&1 | tee -a $BUILD_LOG
check_success

cd $CUR_DIR
build-gcc.sh
source config.sh

echo | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG
echo "| Configure cross gcc...          |" | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG

mkdir -p $BUILD_DIR/gcc-$GCC_VERSION-build 2>&1 | tee -a $BUILD_LOG && \
cd $BUILD_DIR/gcc-$GCC_VERSION-build
check_success

$SRC_DIR/gcc-$GCC_VERSION/configure \
    --target=$TARGET \
    --with-sysroot=$SYSROOT \
    --disable-multilib  \
    --with-float=softfp \
    --with-fpu=vfp \
    --with-cpu=arm926ej-s \
    --enable-__cxa_atexit \
    --disable-sjlj-exceptions \
    --disable-nls \
    --disable-decimal-float \
    --disable-fixed-point \
    --disable-win32-registry \
    --enable-symvers=gnu \
    --with-pkgversion="skitlab" \
    --with-system-zlib \
    --prefix=$PREFIX \
    --enable-languages=c,c++ \
    --enable-threads="posix" \
    --enable-c99 \
    --enable-long-long \
    --enable-libstdcxx-debug \
    --enable-profile \
    --enable-shared \
    --disable-libssp \
    --enable-checking=release \
    2>&1 | tee -a $BUILD_LOG
check_success

echo | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG
echo "| Build cross gcc...              |" | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG

make $PARALLELMFLAGS 2>&1 | tee -a $BUILD_LOG
check_success

echo | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG
echo "| Install cross gcc...            |" | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG

make install 2>&1 | tee -a $BUILD_LOG
check_success

find $PREFIX/$TARGET/lib -name "*.la" | while read la_file; do
    rm -v $la_file 2>&1 | tee -a $BUILD_LOG;
done

cd $CUR_DIR
build-glibc.sh
source config.sh

echo | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG
echo "| Configure glibc...              |" | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG

mkdir -p $BUILD_DIR/glibc-$GLIBC_VERSION-build 2>&1 | tee -a $BUILD_LOG && \
cd $BUILD_DIR/glibc-$GLIBC_VERSION-build
check_success

echo "        configure... "
CC=$TARGET-gcc \
BUILD_CC=gcc \
ac_cv_sizeof_long_double="8" \
$SRC_DIR/glibc-$GLIBC_VERSION/configure \
    --prefix=/usr \
    --host=$TARGET \
    --target=$TARGET \
    --with-headers=$SYSROOT/usr/include \
    --enable-add-ons=ports,nptl \
    --without-cvs \
    --without-gd \
    --without-selinux \
    --disable-sanity-checks  \
    --with-tls \
    --with-__thread \
    --enable-kernel="2.6.35" \
    --enable-debug \
    --enable-profile \
    --enable-shared \
    --enable-static-nss
    2>&1 | tee -a $BUILD_LOG
check_success

echo | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG
echo "| Build glibc ...                 |" | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG

make $PARALLELMFLAGS 2>&1 | tee -a $BUILD_LOG
check_success

echo | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG
echo "| Install glibc ...               |" | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG

make AUTOCONF=no install_root=$SYSROOT install 2>&1 | tee -a $BUILD_LOG
check_success

cd $CUR_DIR
build-gdb.sh
source config.sh

echo | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG
echo "| Extract gdb...                  |" | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG

tar -xjf $TARBALLS_DIR/gdb-$GDB_VERSION.tar.bz2 -C $SRC_DIR 2>&1 | tee -a $BUILD_LOG
check_success

echo | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG
echo "| Configure cross gdb...          |" | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG

mkdir -p $BUILD_DIR/gdb-$GDB_VERSION-build 2>&1 | tee -a $BUILD_LOG && \
cd $BUILD_DIR/gdb-$GDB_VERSION-build
check_success

$SRC_DIR/gdb-$GDB_VERSION/configure \
    --target=$TARGET \
    --prefix=$PREFIX \
    --with-sysroot=$SYSROOT \
    --disable-werror \
    --enable-tui \
    2>&1 | tee -a $BUILD_LOG
check_success

echo | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG
echo "| Build cross gdb...              |" | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG

make $PARALLELMFLAGS 2>&1 | tee -a $BUILD_LOG
check_success

echo | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG
echo "| Install cross gdb...            |" | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG

make install 2>&1 | tee -a $BUILD_LOG
check_success

cd $CUR_DIR
build-toolchain.sh
#!/bin/sh

sh build-binutils.sh
sh build-linux_headers.sh
sh build-glibc_headers.sh
sh build-gcc_first.sh
sh build-glibc_start_files.sh
sh build-glibc_first.sh
sh build-gcc.sh
sh build-glibc.sh
sh build-gdb.sh

echo | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG
echo "| ALL DONE !!!                    |" | tee -a $BUILD_LOG
echo "+---------------------------------+" | tee -a $BUILD_LOG
Перейти в начало страницы
 
Быстрая цитата+Цитировать сообщение

Быстрый ответОтветить в данную темуНачать новую тему
Теги
Нет тегов для показа


2 чел. читают эту тему (гостей: 2, скрытых пользователей: 0)
Пользователей: 0




RSS Текстовая версия Сейчас: 2.12.2024, 2:03