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(-)
This commit is contained in:
Yann E. MORIN" 2008-09-14 16:21:07 +00:00
parent 21418e80d0
commit 799672a641
25 changed files with 640 additions and 77 deletions

View File

@ -6,10 +6,9 @@ CT_DoArchValues() {
# The system part of the tuple:
case "${CT_LIBC},${CT_ARCH_ARM_EABI}" in
*glibc,) CT_TARGET_SYS=gnu;;
*glibc,y) CT_TARGET_SYS=gnueabi;;
uClibc,) CT_TARGET_SYS=uclibc;;
uClibc,y) CT_TARGET_SYS=uclibcgnueabi;;
none,y) CT_TARGET_SYS=eabi;;
esac
# In case we're EABI, do *not* specify any ABI!

View File

@ -79,6 +79,7 @@ config BINUTILS_EXTRA_CONFIG
config BINUTILS_FOR_TARGET
bool
prompt "binutils libraries for the target"
depends on ! BARE_METAL
default n
help
Some utilities may need binutils libraries to be available on

View File

@ -53,6 +53,8 @@ config CC_SUPPORT_OBJC
config CC_SUPPORT_OBJCXX
bool
if ! BARE_METAL
comment "Additional supported languages:"
config CC_LANG_CXX
@ -136,4 +138,10 @@ config CC_LANG_OTHERS
Eg. gcc-4.1+ has a toy programming language, treelang. As it is not usefull
in real life, it is not available in the selection above.
endif # ! BARE_METAL
if BARE_METAL
comment "Only C language supported on bare metal"
endif # BARE_METAL
endmenu

View File

@ -130,6 +130,7 @@ config CC_CXA_ATEXIT
bool
prompt "Use __cxa_atexit"
default y
depends on ! BARE_METAL
help
If you get the missing symbol "__cxa_atexit" when building C++ programs,
you might want to try disabling this option.
@ -138,6 +139,7 @@ choice
bool
prompt "Use sjlj for exceptions"
default CC_SJLJ_EXCEPTIONS_CONFIGURE
depends on ! BARE_METAL
# This config option is used nowhere in the code on purpose.
# It only serves as a choice entry to force neither using nor not using sjlj
@ -185,6 +187,7 @@ config CC_EXTRA_CONFIG
string
prompt "gcc extra config"
default ""
depends on ! BARE_METAL
help
Extra flags to pass onto ./configure when configuring gcc.

View File

@ -4,6 +4,7 @@ menuconfig DMALLOC
bool
prompt "dmalloc"
default n
depends on ! BARE_METAL
if DMALLOC

View File

@ -4,6 +4,7 @@ menuconfig DUMA
bool
prompt "D.U.M.A."
default n
depends on ! BARE_METAL
help
D.U.M.A. - Detect Unintended Memory Access
A memory bound checker, with additional features.

View File

@ -13,7 +13,7 @@ config GDB_CROSS
bool
prompt "Cross-gdb"
default y
select GDB_GDBSERVER
select GDB_GDBSERVER if ! BARE_METAL
help
Build and install a cross-gdb for the target, to run on host.
@ -45,6 +45,7 @@ config GDB_NATIVE
bool
prompt "Native gdb"
default n
depends on ! BARE_METAL
help
Build and install a native gdb for the target, to run on the target.
@ -78,6 +79,7 @@ config GDB_GDBSERVER
bool
prompt "gdbserver"
default n
depends on ! BARE_METAL
help
Build and install a gdbserver for the target, to run on the target.

View File

@ -4,6 +4,7 @@ menuconfig STRACE
bool
prompt "strace"
default n
depends on ! BARE_METAL
if STRACE

View File

@ -20,6 +20,7 @@ config GMP_MPFR_TARGET
bool
prompt "Build libraries for the target"
depends on GMP_MPFR
depends on ! BARE_METAL
default n
help
Also build libraries for the target. This can be usefull if you want

View File

@ -1,11 +1,16 @@
# Kernel options
menu "Kernel"
config KERNEL
string
default "none" if BARE_METAL
default "linux" if KERNEL_LINUX
if ! BARE_METAL
menu "Kernel"
choice
bool
prompt "Target OS"
@ -27,3 +32,5 @@ source config/kernel/linux.in
endif
endmenu
endif # ! BARE_METAL

View File

@ -32,44 +32,10 @@ config KERNEL_INSTALL_V_2_6_23_17
prompt "2.6.23.17 (OBSOLETE)"
depends on KERNEL_VERSION_SEE_EXTRAVERSION && OBSOLETE
config KERNEL_INSTALL_V_2_6_24
bool
prompt "2.6.24"
config KERNEL_INSTALL_V_2_6_24_1
bool
prompt "2.6.24.1"
depends on KERNEL_VERSION_SEE_EXTRAVERSION
config KERNEL_INSTALL_V_2_6_24_2
bool
prompt "2.6.24.2"
depends on KERNEL_VERSION_SEE_EXTRAVERSION
config KERNEL_INSTALL_V_2_6_24_3
bool
prompt "2.6.24.3"
depends on KERNEL_VERSION_SEE_EXTRAVERSION
config KERNEL_INSTALL_V_2_6_24_4
bool
prompt "2.6.24.4"
depends on KERNEL_VERSION_SEE_EXTRAVERSION
config KERNEL_INSTALL_V_2_6_24_5
bool
prompt "2.6.24.5"
depends on KERNEL_VERSION_SEE_EXTRAVERSION
config KERNEL_INSTALL_V_2_6_24_6
bool
prompt "2.6.24.6"
depends on KERNEL_VERSION_SEE_EXTRAVERSION
config KERNEL_INSTALL_V_2_6_24_7
bool
prompt "2.6.24.7"
depends on KERNEL_VERSION_SEE_EXTRAVERSION
prompt "2.6.24.7 (OBSOLETE)"
depends on KERNEL_VERSION_SEE_EXTRAVERSION && OBSOLETE
config KERNEL_INSTALL_V_2_6_25
bool
@ -150,6 +116,16 @@ config KERNEL_INSTALL_V_2_6_25_15
prompt "2.6.25.15"
depends on KERNEL_VERSION_SEE_EXTRAVERSION
config KERNEL_INSTALL_V_2_6_25_16
bool
prompt "2.6.25.16"
depends on KERNEL_VERSION_SEE_EXTRAVERSION
config KERNEL_INSTALL_V_2_6_25_17
bool
prompt "2.6.25.17"
depends on KERNEL_VERSION_SEE_EXTRAVERSION
config KERNEL_INSTALL_V_2_6_26
bool
prompt "2.6.26"
@ -169,6 +145,16 @@ config KERNEL_INSTALL_V_2_6_26_3
prompt "2.6.26.3"
depends on KERNEL_VERSION_SEE_EXTRAVERSION
config KERNEL_INSTALL_V_2_6_26_4
bool
prompt "2.6.26.4"
depends on KERNEL_VERSION_SEE_EXTRAVERSION
config KERNEL_INSTALL_V_2_6_26_5
bool
prompt "2.6.26.5"
depends on KERNEL_VERSION_SEE_EXTRAVERSION
# CT_INSERT_VERSION_ABOVE
# Don't remove above line!
endchoice
@ -204,11 +190,15 @@ config KERNEL_VERSION
default "2.6.25.12" if KERNEL_INSTALL_V_2_6_25_12
default "2.6.25.13" if KERNEL_INSTALL_V_2_6_25_13
default "2.6.25.14" if KERNEL_INSTALL_V_2_6_25_14
default "2.6.25.15" if KERNEL_INSTALL_V_2_6_25_15
default "2.6.25.14" if KERNEL_INSTALL_V_2_6_25_15
default "2.6.25.15" if KERNEL_INSTALL_V_2_6_25_16
default "2.6.25.15" if KERNEL_INSTALL_V_2_6_25_17
default "2.6.26" if KERNEL_INSTALL_V_2_6_26
default "2.6.26.1" if KERNEL_INSTALL_V_2_6_26_1
default "2.6.26.2" if KERNEL_INSTALL_V_2_6_26_2
default "2.6.26.3" if KERNEL_INSTALL_V_2_6_26_3
default "2.6.26.4" if KERNEL_INSTALL_V_2_6_26_4
default "2.6.26.5" if KERNEL_INSTALL_V_2_6_26_5
# CT_INSERT_VERSION_STRING_ABOVE
# Don't remove above line!

View File

@ -1,5 +1,14 @@
# C library options
config LIBC
string
default "none" if BARE_METAL
default "glibc" if LIBC_GLIBC
default "eglibc" if LIBC_EGLIBC
default "uClibc" if LIBC_UCLIBC
if ! BARE_METAL
menu "C-library"
choice
@ -49,12 +58,6 @@ endchoice
config LIBC_VERSION
string
config LIBC
string
default "glibc" if LIBC_GLIBC
default "eglibc" if LIBC_EGLIBC
default "uClibc" if LIBC_UCLIBC
config LIBC_SUPPORT_NPTL
bool
default n
@ -106,3 +109,5 @@ config LIBC_VERSION
have to save your C library tarball by yourself.
endmenu
endif # ! BARE_METAL

View File

@ -28,6 +28,19 @@ config TARGET_LDFLAGS
comment "General target options"
config BARE_METAL
bool
prompt "Bare metal (EXPERIMENTAL)"
default n
depends on EXPERIMENTAL
help
Say 'y' here if you want a simple C compiler with no C library.
You probably want to say 'y' here if you plan to use your compiler
to build only kernels or bootloaders
'Bare metal' also refer to those programs that run without any kernel.
choice
bool
prompt "Target architecture:"

View File

@ -15,6 +15,7 @@ config USE_SYSROOT
config SHARED_LIBS
bool
prompt "Build shared libraries"
depends on ! BARE_METAL
default y
help
Say 'y' here, unless you don't want shared libraries.

View File

@ -0,0 +1,223 @@
#
# Automatically generated make config: don't edit
# crosstool-NG version: 1.2.0+svn_trunk@1001M
# Thu Sep 11 00:53:13 2008
#
#
# Paths and misc options
#
#
# crosstool-NG behavior
#
# CT_OBSOLETE is not set
CT_EXPERIMENTAL=y
# CT_BROKEN is not set
# CT_DEBUG_CT is not set
#
# Paths
#
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_WORK_DIR="${CT_TOP_DIR}/targets"
CT_PREFIX_DIR="${HOME}/x-tools/${CT_TARGET}"
CT_INSTALL_DIR="${CT_PREFIX_DIR}"
# CT_CUSTOM_PATCH is not set
CT_REMOVE_DOCS=y
CT_INSTALL_DIR_RO=y
#
# Downloading
#
# CT_FORCE_DOWNLOAD is not set
# CT_USE_PROXY is not set
CT_PROXY_TYPE="none"
# CT_USE_LAN_MIRROR is not set
CT_CONNECT_TIMEOUT=10
# CT_ONLY_DOWNLOAD is not set
#
# Extracting
#
# CT_FORCE_EXTRACT is not set
CT_OVERIDE_CONFIG_GUESS_SUB=y
# CT_ONLY_EXTRACT is not set
#
# Build behavior
#
CT_PARALLEL_JOBS=1
CT_LOAD=0
CT_NICE=0
CT_USE_PIPES=y
CT_CONFIG_SHELL_ASH=y
#
# Logging
#
# CT_LOG_ERROR is not set
# CT_LOG_WARN is not set
# CT_LOG_INFO is not set
CT_LOG_EXTRA=y
# CT_LOG_DEBUG is not set
# CT_LOG_ALL is not set
CT_LOG_LEVEL_MAX="EXTRA"
# CT_LOG_SEE_TOOLS_WARN is not set
CT_LOG_PROGRESS_BAR=y
CT_LOG_TO_FILE=y
CT_LOG_FILE_COMPRESS=y
#
# Target options
#
CT_ARCH="arm"
CT_ARCH_SUPPORT_ARCH=y
# CT_ARCH_SUPPORT_ABI is not set
CT_ARCH_SUPPORT_CPU=y
CT_ARCH_SUPPORT_TUNE=y
CT_ARCH_SUPPORT_FPU=y
CT_ARCH_SUPPORTS_BOTH_ENDIAN=y
# CT_ARCH_DEFAULT_BE is not set
CT_ARCH_DEFAULT_LE=y
CT_ARCH_ARCH=""
CT_ARCH_CPU=""
CT_ARCH_TUNE=""
CT_ARCH_FPU=""
# CT_ARCH_BE is not set
CT_ARCH_LE=y
CT_ARCH_FLOAT_HW=y
# CT_ARCH_FLOAT_SW is not set
CT_TARGET_CFLAGS=""
CT_TARGET_LDFLAGS=""
#
# General target options
#
CT_BARE_METAL=y
# CT_ARCH_alpha is not set
CT_ARCH_arm=y
CT_ARCH_ARM_EABI=y
# CT_ARCH_ia64 is not set
# CT_ARCH_mips is not set
# CT_ARCH_powerpc is not set
# CT_ARCH_sh is not set
# CT_ARCH_x86 is not set
# CT_ARCH_x86_64 is not set
#
# Target optimisations
#
#
# Toolchain options
#
#
# General toolchain options
#
CT_USE_SYSROOT=y
CT_TARGET_VENDOR="unknown"
CT_TARGET_ALIAS_SED_EXPR=""
CT_TARGET_ALIAS=""
#
# Toolchain type
#
# CT_NATIVE is not set
CT_CROSS=y
# CT_CROSS_NATIVE is not set
# CT_CANADIAN is not set
CT_TOOLCHAIN_TYPE="cross"
CT_BUILD=""
CT_CC_NATIVE="gcc"
CT_KERNEL="none"
#
# GMP and MPFR
#
CT_GMP_MPFR=y
CT_GMP_V_4_2_2=y
CT_GMP_VERSION="4.2.2"
CT_GMP_CHECK=y
CT_MPFR_V_2_3_1=y
CT_MPFR_VERSION="2.3.1"
CT_MPFR_CHECK=y
#
# binutils
#
CT_BINUTILS_VERSION="2.18"
# CT_BINUTILS_V_2_14 is not set
# CT_BINUTILS_V_2_15 is not set
# CT_BINUTILS_V_2_16_1 is not set
# CT_BINUTILS_V_2_17 is not set
CT_BINUTILS_V_2_18=y
# CT_BINUTILS_V_2_18_50_0_4 is not set
# CT_BINUTILS_V_2_18_50_0_6 is not set
# CT_BINUTILS_V_2_18_50_0_7 is not set
# CT_BINUTILS_V_2_18_50_0_8 is not set
CT_BINUTILS_EXTRA_CONFIG=""
#
# C compiler
#
CT_CC_GCC=y
CT_CC_VERSION="4.3.1"
CT_CC="gcc"
# CT_CC_V_2_95_3 is not set
# CT_CC_V_3_2_3 is not set
# CT_CC_V_3_3_6 is not set
# CT_CC_V_3_4_6 is not set
# CT_CC_V_4_0_0 is not set
# CT_CC_V_4_0_1 is not set
# CT_CC_V_4_0_2 is not set
# CT_CC_V_4_0_3 is not set
# CT_CC_V_4_0_4 is not set
# CT_CC_V_4_1_0 is not set
# CT_CC_V_4_1_1 is not set
# CT_CC_V_4_1_2 is not set
# CT_CC_V_4_2_0 is not set
# CT_CC_V_4_2_1 is not set
# CT_CC_V_4_2_2 is not set
# CT_CC_V_4_2_3 is not set
# CT_CC_V_4_2_4 is not set
# CT_CC_V_4_3_0 is not set
CT_CC_V_4_3_1=y
CT_CC_GCC_4_3_or_later=y
CT_CC_CORE_EXTRA_CONFIG=""
CT_CC_PKGVERSION="crosstool-NG-${CT_VERSION}"
CT_CC_BUGURL=""
CT_CC_SUPPORT_CXX=y
CT_CC_SUPPORT_FORTRAN=y
CT_CC_SUPPORT_JAVA=y
CT_CC_SUPPORT_ADA=y
CT_CC_SUPPORT_OBJC=y
CT_CC_SUPPORT_OBJCXX=y
#
# Only C language supported on bare metal
#
CT_LIBC="none"
#
# Tools facilities
#
# CT_SSTRIP is not set
#
# Debug facilities
#
CT_GDB=y
CT_GDB_CROSS=y
# CT_GDB_CROSS_STATIC is not set
# CT_GDB_CROSS_INSIGHT is not set
# CT_GDB_V_snapshot is not set
# CT_GDB_V_6_4 is not set
# CT_GDB_V_6_5 is not set
# CT_GDB_V_6_6 is not set
# CT_GDB_V_6_7 is not set
# CT_GDB_V_6_7_1 is not set
CT_GDB_V_6_8=y
CT_GDB_VERSION="6.8"

View File

@ -0,0 +1,225 @@
#
# Automatically generated make config: don't edit
# crosstool-NG version: 1.2.0+svn_trunk@1001M
# Thu Sep 11 00:48:33 2008
#
#
# Paths and misc options
#
#
# crosstool-NG behavior
#
# CT_OBSOLETE is not set
CT_EXPERIMENTAL=y
# CT_BROKEN is not set
# CT_DEBUG_CT is not set
#
# Paths
#
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_WORK_DIR="${CT_TOP_DIR}/targets"
CT_PREFIX_DIR="${HOME}/x-tools/${CT_TARGET}"
CT_INSTALL_DIR="${CT_PREFIX_DIR}"
# CT_CUSTOM_PATCH is not set
CT_REMOVE_DOCS=y
CT_INSTALL_DIR_RO=y
#
# Downloading
#
# CT_FORCE_DOWNLOAD is not set
# CT_USE_PROXY is not set
CT_PROXY_TYPE="none"
# CT_USE_LAN_MIRROR is not set
CT_CONNECT_TIMEOUT=10
# CT_ONLY_DOWNLOAD is not set
#
# Extracting
#
# CT_FORCE_EXTRACT is not set
CT_OVERIDE_CONFIG_GUESS_SUB=y
# CT_ONLY_EXTRACT is not set
#
# Build behavior
#
CT_PARALLEL_JOBS=1
CT_LOAD=0
CT_NICE=0
CT_USE_PIPES=y
CT_CONFIG_SHELL_ASH=y
#
# Logging
#
# CT_LOG_ERROR is not set
# CT_LOG_WARN is not set
# CT_LOG_INFO is not set
CT_LOG_EXTRA=y
# CT_LOG_DEBUG is not set
# CT_LOG_ALL is not set
CT_LOG_LEVEL_MAX="EXTRA"
# CT_LOG_SEE_TOOLS_WARN is not set
CT_LOG_PROGRESS_BAR=y
CT_LOG_TO_FILE=y
CT_LOG_FILE_COMPRESS=y
#
# Target options
#
CT_ARCH="arm"
CT_ARCH_SUPPORT_ARCH=y
CT_ARCH_SUPPORT_ABI=y
CT_ARCH_SUPPORT_CPU=y
CT_ARCH_SUPPORT_TUNE=y
CT_ARCH_SUPPORT_FPU=y
CT_ARCH_SUPPORTS_BOTH_ENDIAN=y
# CT_ARCH_DEFAULT_BE is not set
CT_ARCH_DEFAULT_LE=y
CT_ARCH_ARCH=""
CT_ARCH_ABI=""
CT_ARCH_CPU=""
CT_ARCH_TUNE=""
CT_ARCH_FPU=""
# CT_ARCH_BE is not set
CT_ARCH_LE=y
CT_ARCH_FLOAT_HW=y
# CT_ARCH_FLOAT_SW is not set
CT_TARGET_CFLAGS=""
CT_TARGET_LDFLAGS=""
#
# General target options
#
CT_BARE_METAL=y
# CT_ARCH_alpha is not set
CT_ARCH_arm=y
# CT_ARCH_ARM_EABI is not set
CT_ARCH_ARM_ABI_OK=y
# CT_ARCH_ia64 is not set
# CT_ARCH_mips is not set
# CT_ARCH_powerpc is not set
# CT_ARCH_sh is not set
# CT_ARCH_x86 is not set
# CT_ARCH_x86_64 is not set
#
# Target optimisations
#
#
# Toolchain options
#
#
# General toolchain options
#
CT_USE_SYSROOT=y
CT_TARGET_VENDOR="unknown"
CT_TARGET_ALIAS_SED_EXPR=""
CT_TARGET_ALIAS=""
#
# Toolchain type
#
# CT_NATIVE is not set
CT_CROSS=y
# CT_CROSS_NATIVE is not set
# CT_CANADIAN is not set
CT_TOOLCHAIN_TYPE="cross"
CT_BUILD=""
CT_CC_NATIVE="gcc"
CT_KERNEL="none"
#
# GMP and MPFR
#
CT_GMP_MPFR=y
CT_GMP_V_4_2_2=y
CT_GMP_VERSION="4.2.2"
CT_GMP_CHECK=y
CT_MPFR_V_2_3_1=y
CT_MPFR_VERSION="2.3.1"
CT_MPFR_CHECK=y
#
# binutils
#
CT_BINUTILS_VERSION="2.18"
# CT_BINUTILS_V_2_14 is not set
# CT_BINUTILS_V_2_15 is not set
# CT_BINUTILS_V_2_16_1 is not set
# CT_BINUTILS_V_2_17 is not set
CT_BINUTILS_V_2_18=y
# CT_BINUTILS_V_2_18_50_0_4 is not set
# CT_BINUTILS_V_2_18_50_0_6 is not set
# CT_BINUTILS_V_2_18_50_0_7 is not set
# CT_BINUTILS_V_2_18_50_0_8 is not set
CT_BINUTILS_EXTRA_CONFIG=""
#
# C compiler
#
CT_CC_GCC=y
CT_CC_VERSION="4.3.1"
CT_CC="gcc"
# CT_CC_V_2_95_3 is not set
# CT_CC_V_3_2_3 is not set
# CT_CC_V_3_3_6 is not set
# CT_CC_V_3_4_6 is not set
# CT_CC_V_4_0_0 is not set
# CT_CC_V_4_0_1 is not set
# CT_CC_V_4_0_2 is not set
# CT_CC_V_4_0_3 is not set
# CT_CC_V_4_0_4 is not set
# CT_CC_V_4_1_0 is not set
# CT_CC_V_4_1_1 is not set
# CT_CC_V_4_1_2 is not set
# CT_CC_V_4_2_0 is not set
# CT_CC_V_4_2_1 is not set
# CT_CC_V_4_2_2 is not set
# CT_CC_V_4_2_3 is not set
# CT_CC_V_4_2_4 is not set
# CT_CC_V_4_3_0 is not set
CT_CC_V_4_3_1=y
CT_CC_GCC_4_3_or_later=y
CT_CC_CORE_EXTRA_CONFIG=""
CT_CC_PKGVERSION="crosstool-NG-${CT_VERSION}"
CT_CC_BUGURL=""
CT_CC_SUPPORT_CXX=y
CT_CC_SUPPORT_FORTRAN=y
CT_CC_SUPPORT_JAVA=y
CT_CC_SUPPORT_ADA=y
CT_CC_SUPPORT_OBJC=y
CT_CC_SUPPORT_OBJCXX=y
#
# Only C language supported on bare metal
#
CT_LIBC="none"
#
# Tools facilities
#
# CT_SSTRIP is not set
#
# Debug facilities
#
CT_GDB=y
CT_GDB_CROSS=y
# CT_GDB_CROSS_STATIC is not set
# CT_GDB_CROSS_INSIGHT is not set
# CT_GDB_V_snapshot is not set
# CT_GDB_V_6_4 is not set
# CT_GDB_V_6_5 is not set
# CT_GDB_V_6_6 is not set
# CT_GDB_V_6_7 is not set
# CT_GDB_V_6_7_1 is not set
CT_GDB_V_6_8=y
CT_GDB_VERSION="6.8"

View File

@ -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}"

View File

@ -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() {
:
}

View File

@ -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() {
:
}

View File

@ -356,8 +356,8 @@ fi
. "${CT_LIB_DIR}/scripts/build/gmp.sh"
. "${CT_LIB_DIR}/scripts/build/mpfr.sh"
. "${CT_LIB_DIR}/scripts/build/binutils.sh"
. "${CT_LIB_DIR}/scripts/build/libc_${CT_LIBC}.sh"
. "${CT_LIB_DIR}/scripts/build/cc_${CT_CC}.sh"
. "${CT_LIB_DIR}/scripts/build/libc/${CT_LIBC}.sh"
. "${CT_LIB_DIR}/scripts/build/cc/${CT_CC}.sh"
. "${CT_LIB_DIR}/scripts/build/debug.sh"
. "${CT_LIB_DIR}/scripts/build/tools.sh"
@ -433,12 +433,13 @@ if [ "${CT_ONLY_DOWNLOAD}" != "y" -a "${CT_ONLY_EXTRACT}" != "y" ]; then
find "${CT_PREFIX_DIR}/bin" -name "${CT_HOST}-"'*' -exec rm -fv {} \; |CT_DoLog DEBUG
rm -fv "${CT_PREFIX_DIR}/bin/makeinfo" |CT_DoLog DEBUG
# Install the /populator/
CT_DoLog EXTRA "Installing the populate helper"
sed -r -e 's|@@CT_TARGET@@|'"${CT_TARGET}"'|g;' \
"${CT_LIB_DIR}/tools/populate.in" \
>"${CT_PREFIX_DIR}/bin/${CT_TARGET}-populate"
chmod 755 "${CT_PREFIX_DIR}/bin/${CT_TARGET}-populate"
if [ "${CT_BARE_METAL}" != "y" ]; then
CT_DoLog EXTRA "Installing the populate helper"
sed -r -e 's|@@CT_TARGET@@|'"${CT_TARGET}"'|g;' \
"${CT_LIB_DIR}/tools/populate.in" \
>"${CT_PREFIX_DIR}/bin/${CT_TARGET}-populate"
chmod 755 "${CT_PREFIX_DIR}/bin/${CT_TARGET}-populate"
fi
# Create the aliases to the target tools
CT_DoLog EXTRA "Creating toolchain aliases"

View File

@ -673,6 +673,7 @@ CT_DoBuildTargetTuple() {
# Set defaults for the system part of the tuple. Can be overriden
# by architecture-specific values.
case "${CT_LIBC}" in
none) CT_TARGET_SYS=elf;;
*glibc) CT_TARGET_SYS=gnu;;
uClibc) CT_TARGET_SYS=uclibc;;
esac
@ -695,9 +696,10 @@ CT_DoBuildTargetTuple() {
# Finish the target tuple construction
case "${CT_KERNEL}" in
linux*) CT_TARGET_KERNEL=linux;;
none) CT_TARGET_KERNEL=;;
linux) CT_TARGET_KERNEL=linux-;;
esac
CT_TARGET=$(CT_DoConfigSub "${CT_TARGET_ARCH}-${CT_TARGET_VENDOR:-unknown}-${CT_TARGET_KERNEL}-${CT_TARGET_SYS}")
CT_TARGET=$(CT_DoConfigSub "${CT_TARGET_ARCH}-${CT_TARGET_VENDOR:-unknown}-${CT_TARGET_KERNEL}${CT_TARGET_SYS}")
# Prepare the target CFLAGS
CT_ARCH_TARGET_CFLAGS="${CT_ARCH_TARGET_CFLAGS} ${CT_ARCH_ENDIAN_CFLAG}"

View File

@ -30,7 +30,7 @@ dump_single_sample() {
[ "${CT_EXPERIMENTAL}" = "y" ] && printf "X" || printf " "
echo "]"
if [ ${verbose} -ne 0 ]; then
echo " OS : ${CT_KERNEL}-${CT_KERNEL_VERSION}"
echo " OS : ${CT_KERNEL}${CT_KERNEL_VERSION:+-}${CT_KERNEL_VERSION}"
if [ "${CT_GMP_MPFR}" = "y" ]; then
echo " GMP/MPFR : gmp-${CT_GMP_VERSION} / mpfr-${CT_MPFR_VERSION}"
fi
@ -44,7 +44,7 @@ dump_single_sample() {
[ "${CT_CC_LANG_OBJCXX}" = "y" ] && printf ",Objective-C++"
[ -n "${CT_CC_LANG_OTHERS}" ] && printf ",${CT_CC_LANG_OTHERS}"
echo ")"
echo " C library : ${CT_LIBC}-${CT_LIBC_VERSION}"
echo " C library : ${CT_LIBC}${CT_LIBC_VERSION:+-}${CT_LIBC_VERSION}"
printf " Tools :"
[ "${CT_LIBELF}" ] && printf " libelf-${CT_LIBELF_VERSION}"
[ "${CT_SSTRIP}" ] && printf " sstrip"
@ -133,7 +133,7 @@ for sample in "${@}"; do
done
if [ "${opt}" = -w ]; then
printf "^ Total: ${#@} samples | ''X'': sample uses features marked as being EXPERIMENTAL.\\\\\\\\ ''B'': Samples is curently BROKEN. |||||||||||||"
printf "^ Total: ${#@} samples | ''X'': sample uses features marked as being EXPERIMENTAL.\\\\\\\\ ''B'': sample is curently BROKEN. |||||||||||||"
echo ""
elif [ -z "${opt}" ]; then
echo ' l (local) : sample was found in current directory'