libc/newlib: build in the 'start files' pass
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jun 13 23:45:29 2010 +0200 (2010-06-13)
changeset 198263cee3d5ab85
parent 1981 7130357d712b
child 1983 198a5a6e5239
libc/newlib: build in the 'start files' pass

A few facts:
- building the C library requires a proper core compiler
- core compiler is issued from one of the core passes
- the C library is required to build libstdc++
- newlib is only built for baremetal
- in bare metal, the final compiler is issued from one of the core passes

So we need to build the C library between core pass 1 and core pass 2.
The only place is eithe libc_headers() or libc_start_files(). The most
pertinent seems to be libc_start_files().

So we build newlib from libc_start_files(), and leave libc() empty.
scripts/build/libc/newlib.sh
     1.1 --- a/scripts/build/libc/newlib.sh	Sun Jun 13 20:43:02 2010 +0200
     1.2 +++ b/scripts/build/libc/newlib.sh	Sun Jun 13 23:45:29 2010 +0200
     1.3 @@ -59,10 +59,6 @@
     1.4  }
     1.5  
     1.6  do_libc_start_files() {
     1.7 -    :
     1.8 -}
     1.9 -
    1.10 -do_libc() {
    1.11      CT_DoStep INFO "Installing C library"
    1.12  
    1.13      mkdir -p "${CT_BUILD_DIR}/build-libc"
    1.14 @@ -84,18 +80,20 @@
    1.15          --host=${CT_BUILD}                              \
    1.16          --target=${CT_TARGET}                           \
    1.17          --prefix=${CT_PREFIX_DIR}
    1.18 -    
    1.19 +
    1.20      CT_DoLog EXTRA "Building C library"
    1.21 +    CT_DoExecLog ALL make ${PARALLELMFLAGS}
    1.22  
    1.23 -    CT_DoExecLog ALL make ${PARALLELMFLAGS}
    1.24 -    
    1.25      CT_DoLog EXTRA "Installing C library"
    1.26 -
    1.27      CT_DoExecLog ALL make install install_root="${CT_SYSROOT_DIR}"
    1.28  
    1.29      CT_EndStep
    1.30  }
    1.31  
    1.32 +do_libc() {
    1.33 +    :
    1.34 +}
    1.35 +
    1.36  do_libc_finish() {
    1.37      CT_DoStep INFO "Finishing C library"
    1.38