diff options
author | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2008-09-14 16:21:07 (GMT) |
---|---|---|
committer | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2008-09-14 16:21:07 (GMT) |
commit | 799672a6414c7056d24213041bb3f0a12e9a9a66 (patch) | |
tree | cc77f2de5f5eff2d68c091b929145d5d07b0b9f9 /scripts/build | |
parent | 21418e80d0c225705aace24992845ff20276e14e (diff) |
Introduce a new EXPERIMENTAL feature: BARE_METAL.
This should ultimately llow to build bare-metal compilers, for targets that have no kernel and no C library.
Move the C library build script to their own sub-directory; introduce an empty build script for bare-metal.
Move the compiler build script to its own sub-directory.
Move the kernel build script to its own sub-directory; introduce an empty build script for bare-metal.
Update the ARM target tuples to enable bare-metal targets.
Add two ARM bare-metal samples.
Add latest Linux kernel versions.
/trunk/scripts/build/kernel/none.sh | 77 6 71 0 +----
/trunk/scripts/build/cc/gcc.sh | 58 41 17 0 ++-
/trunk/scripts/build/libc/none.sh | 513 9 504 0 +-----------------------------
/trunk/scripts/crosstool.sh | 17 9 8 0 +
/trunk/scripts/functions | 6 4 2 0 +
/trunk/scripts/showSamples.sh | 6 3 3 0
/trunk/samples/arm-unknown-elf/crosstool.config | 225 225 0 0 +++++++++++++
/trunk/samples/arm-unknown-eabi/crosstool.config | 223 223 0 0 +++++++++++++
/trunk/config/kernel/linux_headers_install.in | 64 27 37 0 ++--
/trunk/config/kernel.in | 9 8 1 0 +
/trunk/config/toolchain.in | 1 1 0 0 +
/trunk/config/cc/gcc.in | 3 3 0 0 +
/trunk/config/debug/dmalloc.in | 1 1 0 0 +
/trunk/config/debug/gdb.in | 4 3 1 0 +
/trunk/config/debug/strace.in | 1 1 0 0 +
/trunk/config/debug/duma.in | 1 1 0 0 +
/trunk/config/cc.in | 8 8 0 0 +
/trunk/config/target.in | 13 13 0 0 +
/trunk/config/binutils.in | 1 1 0 0 +
/trunk/config/gmp_mpfr.in | 1 1 0 0 +
/trunk/config/libc.in | 17 11 6 0 +
/trunk/arch/arm/functions | 3 1 2 0 -
22 files changed, 600 insertions(+), 652 deletions(-)
Diffstat (limited to 'scripts/build')
-rw-r--r-- | scripts/build/cc/gcc.sh (renamed from scripts/build/cc_gcc.sh) | 58 | ||||
-rw-r--r-- | scripts/build/kernel/none.sh | 19 | ||||
-rw-r--r-- | scripts/build/libc/eglibc.sh (renamed from scripts/build/libc_eglibc.sh) | 0 | ||||
-rw-r--r-- | scripts/build/libc/glibc.sh (renamed from scripts/build/libc_glibc.sh) | 0 | ||||
-rw-r--r-- | scripts/build/libc/none.sh | 36 | ||||
-rw-r--r-- | scripts/build/libc/uClibc.sh (renamed from scripts/build/libc_uClibc.sh) | 0 |
6 files changed, 96 insertions, 17 deletions
diff --git a/scripts/build/cc_gcc.sh b/scripts/build/cc/gcc.sh index f1f42fc..24ee3c3 100644 --- a/scripts/build/cc_gcc.sh +++ b/scripts/build/cc/gcc.sh @@ -1,4 +1,5 @@ # This file adds the function to build the gcc C compiler + ${extra_config} \ # Copyright 2007 Yann E. MORIN # Licensed under the GPL v2. See COPYING in the root of this package @@ -27,20 +28,26 @@ do_cc_extract() { #------------------------------------------------------------------------------ # Core gcc pass 1 do_cc_core_pass_1() { - # In case we're NPTL, build the static core gcc; - # in any other case, do nothing. - case "${CT_THREADS}" in - nptl) do_cc_core mode=static build_libgcc=no;; + # If we're building for bare metal, build the static core gcc, + # with libgcc. + # In case we're not bare metal, and we're NPTL, build the static core gcc. + # In any other case, do nothing. + case "${CT_BARE_METAL},${CT_THREADS}" in + y,*) do_cc_core mode=baremetal build_libgcc=yes;; + ,nptl) do_cc_core mode=static build_libgcc=no;; *) ;; esac } # Core gcc pass 2 do_cc_core_pass_2() { - # In case we're NPTL, build the shared core gcc, - # in any other case, build the static core gcc and the target libgcc. - case "${CT_THREADS}" in - nptl) do_cc_core mode=shared build_libgcc=yes;; + # In case we're building for bare metal, do nothing, we already have + # our compiler. + # In case we're NPTL, build the shared core gcc. + # In any other case, build the static core gcc and the target libgcc. + case "${CT_BARE_METAL},${CT_THREADS}" in + y,*) ;; + ,nptl) do_cc_core mode=shared build_libgcc=yes;; *) do_cc_core mode=static build_libgcc=yes;; esac } @@ -49,9 +56,9 @@ do_cc_core_pass_2() { # Build core gcc # This function is used to build both the static and the shared core C conpiler, # with or without the target libgcc. We need to know wether: -# - we're building static or shared: mode=[static|shared] -# - we need to build libgcc or not: build_libgcc=[yes|no] -# Usage: do_cc_core_static mode=[static|shared] build_libgcc=[yes|no] +# - we're building static, shared or bare metal: mode=[static|shared|baremetal] +# - we need to build libgcc or not : build_libgcc=[yes|no] +# Usage: do_cc_core_static mode=[static|shared|baremetal] build_libgcc=[yes|no] do_cc_core() { local mode local build_libgcc @@ -60,7 +67,7 @@ do_cc_core() { eval $1 eval $2 - CT_TestOrAbort "Internal Error: 'mode' must either 'static' or 'shared', not '${mode:-(empty)}'" "${mode}" = "static" -o "${mode}" = "shared" + CT_TestOrAbort "Internal Error: 'mode' must either 'static', 'shared' or 'baremetal', not '${mode:-(empty)}'" "${mode}" = "static" -o "${mode}" = "shared" -o "${mode}" = "baremetal" CT_TestOrAbort "Internal Error: 'build_libgcc' must be either 'yes' or 'no', not '${build_libgcc:-(empty)}'" "${build_libgcc}" = "yes" -o "${build_libgcc}" = "no" # In normal conditions, ( "${mode}" = "shared" ) implies # ( "${build_libgcc}" = "yes" ), but I won't check for that @@ -73,16 +80,25 @@ do_cc_core() { static) core_prefix_dir="${CT_CC_CORE_STATIC_PREFIX_DIR}" extra_config="${extra_config} --with-newlib --enable-threads=no --disable-shared" + copy_headers=y ;; shared) core_prefix_dir="${CT_CC_CORE_SHARED_PREFIX_DIR}" extra_config="${extra_config} --enable-shared" + copy_headers=y + ;; + baremetal) + core_prefix_dir="${CT_PREFIX_DIR}" + extra_config="${extra_config} --with-newlib --enable-threads=no --disable-shared" + copy_headers=n ;; esac - CT_DoLog DEBUG "Copying headers to install area of bootstrap gcc, so it can build libgcc2" - CT_DoExecLog ALL mkdir -p "${core_prefix_dir}/${CT_TARGET}/include" - CT_DoExecLog ALL cp -r "${CT_HEADERS_DIR}"/* "${core_prefix_dir}/${CT_TARGET}/include" + if [ "${copy_headers}" = "y" ]; then + CT_DoLog DEBUG "Copying headers to install area of bootstrap gcc, so it can build libgcc2" + CT_DoExecLog ALL mkdir -p "${core_prefix_dir}/${CT_TARGET}/include" + CT_DoExecLog ALL cp -r "${CT_HEADERS_DIR}"/* "${core_prefix_dir}/${CT_TARGET}/include" + fi CT_DoLog EXTRA "Configuring ${mode} core C compiler" @@ -193,6 +209,9 @@ do_cc_core() { #------------------------------------------------------------------------------ # Build final gcc do_cc() { + # If building for bare metal, nothing to be done here, the static core conpiler is enough! + [ "${CT_BARE_METAL}" = "y" ] && return 0 + CT_DoStep INFO "Installing final compiler" mkdir -p "${CT_BUILD_DIR}/build-cc" @@ -216,8 +235,13 @@ do_cc() { extra_config="--enable-languages=${lang_opt}" extra_config="${extra_config} --disable-multilib" - extra_config="${extra_config} ${CT_ARCH_WITH_ARCH} ${CT_ARCH_WITH_ABI} ${CT_ARCH_WITH_CPU} ${CT_ARCH_WITH_TUNE} ${CT_ARCH_WITH_FPU} ${CT_ARCH_WITH_FLOAT}" - [ "${CT_SHARED_LIBS}" = "y" ] || extra_config="${extra_config} --disable-shared" + extra_config="${extra_config} ${CT_ARCH_WITH_ARCH}" + extra_config="${extra_config} ${CT_ARCH_WITH_ABI}" + extra_config="${extra_config} ${CT_ARCH_WITH_CPU}" + extra_config="${extra_config} ${CT_ARCH_WITH_TUNE}" + extra_config="${extra_config} ${CT_ARCH_WITH_FPU}" + extra_config="${extra_config} ${CT_ARCH_WITH_FLOAT}" + [ "${CT_SHARED_LIBS}" = "y" ] || extra_config="${extra_config} --disable-shared" [ "${CT_GMP_MPFR}" = "y" ] && extra_config="${extra_config} --with-gmp=${CT_PREFIX_DIR} --with-mpfr=${CT_PREFIX_DIR}" [ -n "${CT_CC_PKGVERSION}" ] && extra_config="${extra_config} --with-pkgversion=${CT_CC_PKGVERSION}" [ -n "${CT_CC_BUGURL}" ] && extra_config="${extra_config} --with-bugurl=${CT_CC_BUGURL}" diff --git a/scripts/build/kernel/none.sh b/scripts/build/kernel/none.sh new file mode 100644 index 0000000..2dfda41 --- /dev/null +++ b/scripts/build/kernel/none.sh @@ -0,0 +1,19 @@ +# This file declares functions for bare metal kernel (IE. none) +# Copyright 2008 Yann E. MORIN +# Licensed under the GPL v2. See COPYING in the root of this package + +do_print_filename() { + : +} + +do_kernel_get() { + : +} + +do_kernel_extract() { + : +} + +do_kernel_headers() { + : +} diff --git a/scripts/build/libc_eglibc.sh b/scripts/build/libc/eglibc.sh index 6b6e718..6b6e718 100644 --- a/scripts/build/libc_eglibc.sh +++ b/scripts/build/libc/eglibc.sh diff --git a/scripts/build/libc_glibc.sh b/scripts/build/libc/glibc.sh index b864a5b..b864a5b 100644 --- a/scripts/build/libc_glibc.sh +++ b/scripts/build/libc/glibc.sh diff --git a/scripts/build/libc/none.sh b/scripts/build/libc/none.sh new file mode 100644 index 0000000..4053459 --- /dev/null +++ b/scripts/build/libc/none.sh @@ -0,0 +1,36 @@ +# This file adds functions to build the C library for bare metal (IE. none) +# Copyright 2008 Yann E. MORIN +# Licensed under the GPL v2. See COPYING in the root of this package + +do_print_filename() { + : +} + +do_libc_get() { + : +} + +do_libc_extract() { + : +} + +do_libc_check_config() { + : +} + +do_libc_headers() { + : +} + +# Build and install start files +do_libc_start_files() { + : +} + +do_libc() { + : +} + +do_libc_finish() { + : +} diff --git a/scripts/build/libc_uClibc.sh b/scripts/build/libc/uClibc.sh index 85f5997..85f5997 100644 --- a/scripts/build/libc_uClibc.sh +++ b/scripts/build/libc/uClibc.sh |