scripts/build/binutils.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue May 08 17:48:32 2007 +0000 (2007-05-08)
changeset 78 c3868084d81a
parent 63 89b41dbffe8d
child 116 c0846c936c07
permissions -rw-r--r--
Huge fixes to glibc build, so that we can build at least (and at last):
- use ports addon even when installing headers,
- use optimisation (-O) when installing headers, to avoid unnecessary warnings (thanks Robert P. J. DAY for pointing this out!),
- lowest kernel version to use is only X.Y.Z, not X.Y.Z.T,
- a bit of preparations for NPTL (RSN I hope),
- fix fixing the linker scripts (changing the backup file is kind of useless and stupid);

Shut uClibc finish step: there really is nothing to do;

Add a patch for glibc-2.3.6 weak aliases handling on some archs (ARM and ALPHA at least);

Did not catch the make errors: fixed the pattern matching in scripts/functions;

Introduce a new log level, ALL:
- send components' build messages there,
- DEBUG log level is destined only for crosstool-NG debug messages,
- migrate sub-actions to use appropriate log levels;

Update the armeb-unknown-linux-gnu sample:
- it builds!
- uses gcc-4.0.4 and glibc-2.3.6,
- updated to latest config options set.
yann@1
     1
# This file adds functions to build binutils
yann@1
     2
# Copyright 2007 Yann E. MORIN
yann@1
     3
# Licensed under the GPL v2. See COPYING in the root of this package
yann@1
     4
yann@63
     5
# Download binutils
yann@63
     6
do_binutils_get() {
yann@63
     7
    CT_GetFile "${CT_BINUTILS_FILE}"                            \
yann@63
     8
               ftp://ftp.gnu.org/gnu/binutils                   \
yann@63
     9
               ftp://ftp.kernel.org/pub/linux/devel/binutils
yann@63
    10
}
yann@63
    11
yann@63
    12
# Extract binutils
yann@63
    13
do_binutils_extract() {
yann@63
    14
    CT_ExtractAndPatch "${CT_BINUTILS_FILE}"
yann@63
    15
}
yann@63
    16
yann@63
    17
# Build binutils
yann@1
    18
do_binutils() {
yann@1
    19
    mkdir -p "${CT_BUILD_DIR}/build-binutils"
yann@1
    20
    cd "${CT_BUILD_DIR}/build-binutils"
yann@1
    21
yann@1
    22
    CT_DoStep INFO "Installing binutils"
yann@1
    23
yann@1
    24
    CT_DoLog EXTRA "Configuring binutils"
yann@1
    25
    CFLAGS="${CT_CFLAGS_FOR_HOST}"                  \
yann@1
    26
    "${CT_SRC_DIR}/${CT_BINUTILS_FILE}/configure"   \
yann@1
    27
        ${CT_CANADIAN_OPT}                          \
yann@1
    28
        --target=${CT_TARGET}                       \
yann@1
    29
        --host=${CT_HOST}                           \
yann@1
    30
        --prefix=${CT_PREFIX_DIR}                   \
yann@1
    31
        --disable-nls                               \
yann@1
    32
        ${CT_BINUTILS_EXTRA_CONFIG}                 \
yann@78
    33
        ${BINUTILS_SYSROOT_ARG}                     2>&1 |CT_DoLog ALL
yann@1
    34
yann@1
    35
    CT_DoLog EXTRA "Building binutils"
yann@78
    36
    make ${PARALLELMFLAGS}  2>&1 |CT_DoLog ALL
yann@1
    37
yann@1
    38
    CT_DoLog EXTRA "Installing binutils"
yann@78
    39
    make install            2>&1 |CT_DoLog ALL
yann@1
    40
yann@1
    41
    # Make those new tools available to the core C compiler to come:
yann@1
    42
    # Note: some components want the ${TARGET}-{ar,as,ld,strip} commands as
yann@1
    43
    # well. Create that (libfloat is one such sucker).
yann@1
    44
    mkdir -p "${CT_CC_CORE_PREFIX_DIR}/${CT_TARGET}/bin"
yann@1
    45
    mkdir -p "${CT_CC_CORE_PREFIX_DIR}/bin"
yann@1
    46
    for t in ar as ld strip; do
yann@1
    47
        ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_PREFIX_DIR}/${CT_TARGET}/bin/${t}"
yann@1
    48
        ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_PREFIX_DIR}/bin/${CT_TARGET}-${t}"
yann@78
    49
    done |CT_DoLog ALL
yann@1
    50
yann@1
    51
    CT_EndStep
yann@1
    52
}