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