Merge the NPTL stuff.
That still leaves the linuxthreads stuff broken, but it was just before. I don't care anyway. Time to fix that later...
1.1 --- a/Makefile Fri May 25 19:30:42 2007 +0000
1.2 +++ b/Makefile Sun May 27 20:22:06 2007 +0000
1.3 @@ -31,10 +31,15 @@
1.4 @echo ' distclean - Remove generated files, configuration and build directories'
1.5
1.6 include $(CT_TOP_DIR)/tools/Makefile
1.7 +include $(CT_TOP_DIR)/Makefile.steps
1.8
1.9 help::
1.10 @echo 'Distribution targets:'
1.11 @echo ' tarball - Build a tarball of the configured toolchain'
1.12 + @echo ''
1.13 + @echo 'Environement variables:'
1.14 + @echo ' STOP - Stop the build just after this step'
1.15 + @echo ' RESTART - Restart the build just before this step'
1.16 @echo
1.17 @echo 'Environement variables:'
1.18 @echo ' STOP - Stop the build just after this step'
1.19 @@ -56,4 +61,5 @@
1.20 .PHONY: distclean
1.21 distclean:: clean
1.22 @rm -f .config* ..config.tmp
1.23 + @rm -f log.*
1.24 @rm -rf "$(CT_TOP_DIR)/targets"
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2 +++ b/Makefile.steps Sun May 27 20:22:06 2007 +0000
2.3 @@ -0,0 +1,50 @@
2.4 +# Makefile for each steps
2.5 +# Copyright 2006 Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
2.6 +
2.7 +libc_check_config \
2.8 +kernel_check_config \
2.9 +kernel_headers \
2.10 +binutils \
2.11 +cc_core_pass_1 \
2.12 +libc_headers \
2.13 +libc_start_files \
2.14 +cc_core_pass_2 \
2.15 +libfloat \
2.16 +libc \
2.17 +cc \
2.18 +libc_finish \
2.19 +debug \
2.20 +:
2.21 + @make -C "$(CT_TOP_DIR)" RESTART=$@ STOP=$@
2.22 +
2.23 +-libc_check_config \
2.24 +-kernel_check_config \
2.25 +-kernel_headers \
2.26 +-binutils \
2.27 +-cc_core_pass_1 \
2.28 +-libc_headers \
2.29 +-libc_start_files \
2.30 +-cc_core_pass_2 \
2.31 +-libfloat \
2.32 +-libc \
2.33 +-cc \
2.34 +-libc_finish \
2.35 +-debug \
2.36 +:
2.37 + @make -C "$(CT_TOP_DIR)" STOP=$(patsubst -%,%,$@)
2.38 +
2.39 +libc_check_config- \
2.40 +kernel_check_config- \
2.41 +kernel_headers- \
2.42 +binutils- \
2.43 +cc_core_pass_1- \
2.44 +libc_headers- \
2.45 +libc_start_files- \
2.46 +cc_core_pass_2- \
2.47 +libfloat- \
2.48 +libc- \
2.49 +cc- \
2.50 +libc_finish- \
2.51 +debug- \
2.52 +:
2.53 + @make -C "$(CT_TOP_DIR)" RESTART=$(patsubst %-,%,$@)
3.1 --- a/config/kernel_linux_headers_install.in Fri May 25 19:30:42 2007 +0000
3.2 +++ b/config/kernel_linux_headers_install.in Sun May 27 20:22:06 2007 +0000
3.3 @@ -98,6 +98,16 @@
3.4 prompt "2.6.21.1"
3.5 depends on KERNEL_VERSION_SEE_EXTRAVERSION
3.6
3.7 +config KERNEL_INSTALL_V_2_6_21_2
3.8 + bool
3.9 + prompt "2.6.21.2"
3.10 + depends on KERNEL_VERSION_SEE_EXTRAVERSION
3.11 +
3.12 +config KERNEL_INSTALL_V_2_6_21_3
3.13 + bool
3.14 + prompt "2.6.21.3"
3.15 + depends on KERNEL_VERSION_SEE_EXTRAVERSION
3.16 +
3.17 # CT_INSERT_VERSION_ABOVE
3.18 # Don't remove above line!
3.19 endchoice
3.20 @@ -124,5 +134,7 @@
3.21 default "2.6.20.7" if KERNEL_INSTALL_V_2_6_20_7
3.22 default "2.6.21" if KERNEL_INSTALL_V_2_6_21
3.23 default "2.6.21.1" if KERNEL_INSTALL_V_2_6_21_1
3.24 + default "2.6.21.2" if KERNEL_INSTALL_V_2_6_21_2
3.25 + default "2.6.21.3" if KERNEL_INSTALL_V_2_6_21_3
3.26 # CT_INSERT_VERSION_STRING_ABOVE
3.27 # Don't remove above line!
4.1 --- a/config/libc.in Fri May 25 19:30:42 2007 +0000
4.2 +++ b/config/libc.in Sun May 27 20:22:06 2007 +0000
4.3 @@ -36,31 +36,6 @@
4.4 bool
4.5 default n
4.6
4.7 -choice
4.8 - bool
4.9 - prompt "Threading implentation to use:"
4.10 - default LIBC_THREADS_NPTL if LIBC_SUPPORT_NPTL
4.11 - default LIBC_THREADS_LINUXTHREADS if LIBC_SUPPORT_LINUXTHREADS && ! LIBC_SUPPORT_NPTL
4.12 - default LIBC_THREADS_NONE if ! LIBC_SUPPORT_LINUXTHREADS && ! LIBC_SUPPORT_NPTL
4.13 - depends on EXPERIMENTAL
4.14 -
4.15 -config LIBC_THREADS_NPTL
4.16 - bool
4.17 - prompt "nptl (EXPERIMENTAL)"
4.18 - depends on LIBC_SUPPORT_NPTL
4.19 - depends on EXPERIMENTAL
4.20 -
4.21 -config LIBC_THREADS_LINUXTHREADS
4.22 - bool
4.23 - prompt "linuxthreads"
4.24 - depends on LIBC_SUPPORT_LINUXTHREADS
4.25 -
4.26 -config LIBC_THREADS_NONE
4.27 - bool
4.28 - prompt "none"
4.29 -
4.30 -endchoice
4.31 -
4.32 if LIBC_GLIBC
4.33 source config/libc_glibc.in
4.34 endif
5.1 --- a/config/libc_glibc.in Fri May 25 19:30:42 2007 +0000
5.2 +++ b/config/libc_glibc.in Sun May 27 20:22:06 2007 +0000
5.3 @@ -181,7 +181,7 @@
5.4 config LIBC_GLIBC_USE_PORTS
5.5 bool
5.6 prompt "Use the ports addon"
5.7 - default y
5.8 + default n
5.9 help
5.10 The ports addon contains some architecture ports that are not available
5.11 in the official glibc distribution.
6.1 --- a/config/target.in Fri May 25 19:30:42 2007 +0000
6.2 +++ b/config/target.in Sun May 27 20:22:06 2007 +0000
6.3 @@ -19,53 +19,74 @@
6.4 config ARCH_ARM
6.5 bool
6.6 prompt "arm"
6.7 - select ARCH_SUPPORTS_BE
6.8 - select ARCH_SUPPORTS_LE
6.9 + select ARCH_SUPPORTS_BOTH_ENDIAN
6.10 select ARCH_SUPPORTS_LIBFLOAT
6.11
6.12 config ARCH_MIPS
6.13 bool
6.14 prompt "mips"
6.15 - select ARCH_SUPPORTS_BE
6.16 - select ARCH_SUPPORTS_LE
6.17 + select ARCH_SUPPORTS_BOTH_ENDIAN
6.18
6.19 config ARCH_x86
6.20 bool
6.21 prompt "x86"
6.22 - select ARCH_SUPPORTS_LE
6.23 select ARCH_SUPPORTS_LIBFLOAT
6.24
6.25 config ARCH_x86_64
6.26 bool
6.27 prompt "x86_64"
6.28 - select ARCH_SUPPORTS_LE
6.29
6.30 endchoice
6.31
6.32 -config ARCH_SUPPORTS_BE
6.33 - bool
6.34 - default n
6.35 -
6.36 -config ARCH_SUPPORTS_LE
6.37 +config ARCH_SUPPORTS_BOTH_ENDIAN
6.38 bool
6.39 default n
6.40
6.41 choice
6.42 bool
6.43 prompt "Endianness:"
6.44 + depends on ARCH_SUPPORTS_BOTH_ENDIAN
6.45
6.46 config ARCH_BE
6.47 bool
6.48 prompt "Big endian"
6.49 - depends on ARCH_SUPPORTS_BE
6.50
6.51 config ARCH_LE
6.52 bool
6.53 prompt "Little endian"
6.54 - depends on ARCH_SUPPORTS_LE
6.55
6.56 endchoice
6.57
6.58 +choice
6.59 + bool
6.60 + prompt "Threading implentation to use:"
6.61 + default THREADS_NPTL if LIBC_SUPPORT_NPTL
6.62 + default THREADS_LINUXTHREADS if LIBC_SUPPORT_LINUXTHREADS && ! LIBC_SUPPORT_NPTL
6.63 + default THREADS_NONE if ! LIBC_SUPPORT_LINUXTHREADS && ! LIBC_SUPPORT_NPTL
6.64 +
6.65 +config THREADS_NPTL
6.66 + bool
6.67 + prompt "nptl (EXPERIMENTAL)"
6.68 + depends on LIBC_SUPPORT_NPTL
6.69 + depends on EXPERIMENTAL
6.70 +
6.71 +config THREADS_LINUXTHREADS
6.72 + bool
6.73 + prompt "linuxthreads"
6.74 + depends on LIBC_SUPPORT_LINUXTHREADS
6.75 +
6.76 +config THREADS_NONE
6.77 + bool
6.78 + prompt "none"
6.79 +
6.80 +endchoice
6.81 +
6.82 +config THREADS
6.83 + string
6.84 + default "nptl" if THREADS_NPTL
6.85 + default "linuxthreads" if THREADS_LINUXTHREADS
6.86 + default "none" if THREADS_NONE
6.87 +
6.88 comment "Target optimisations"
6.89
6.90 config ARCH_ARCH
7.1 --- a/docs/overview.txt Fri May 25 19:30:42 2007 +0000
7.2 +++ b/docs/overview.txt Sun May 27 20:22:06 2007 +0000
7.3 @@ -127,14 +127,27 @@
7.4 - kernel_check_config
7.5 - kernel_headers
7.6 - binutils
7.7 + - cc_core_pass_1
7.8 - libc_headers
7.9 - - cc_core
7.10 + - libc_start_files
7.11 + - cc_core_pass_2
7.12 - libfloat
7.13 - libc
7.14 - cc
7.15 - libc_finish
7.16 - debug
7.17
7.18 +Alternatively, you can call make with the name of a step to just do that step:
7.19 + make libc_headers
7.20 +is equivalent to:
7.21 + make RESTART=libs_headers STOP=libc_headers
7.22 +
7.23 +The shortcuts -step_name and step_name- allow to respectively stop or restart
7.24 +at that step. Thus:
7.25 + make -libc_headers make libc_headers-
7.26 +are equivalent to:
7.27 + make STOP=libc_headers make RESTART=libc_headers
7.28 +
7.29 ____________________________
7.30 /
7.31 Configuring crosstool-NG /
8.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
8.2 +++ b/patches/gcc/4.1.2/801-softfloat-fix.patch Sun May 27 20:22:06 2007 +0000
8.3 @@ -0,0 +1,58 @@
8.4 +This patch (C) 2007 Yann E. MORIN
8.5 +Licensed under GPL v2.
8.6 +
8.7 +First hunk of this patch solves compiling uClibc-0.9.28{,.1} :
8.8 +
8.9 +make[1]: Entering directory `/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc'
8.10 + LD libuClibc-0.9.29.so
8.11 +libc/libc_so.a(difftime.os): In function `difftime':
8.12 +difftime.c:(.text+0x8): undefined reference to `__floatsidf'
8.13 +difftime.c:(.text+0x2c): undefined reference to `__subdf3'
8.14 +libc/libc_so.a(_fpmaxtostr.os): In function `_fpmaxtostr':
8.15 +_fpmaxtostr.c:(.text+0xd4): undefined reference to `__nedf2'
8.16 +_fpmaxtostr.c:(.text+0xf8): undefined reference to `__eqdf2'
8.17 +_fpmaxtostr.c:(.text+0x114): undefined reference to `__divdf3'
8.18 +_fpmaxtostr.c:(.text+0x120): undefined reference to `__ltdf2'
8.19 +_fpmaxtostr.c:(.text+0x1c4): undefined reference to `__muldf3'
8.20 +_fpmaxtostr.c:(.text+0x388): undefined reference to `__gedf2'
8.21 +_fpmaxtostr.c:(.text+0x430): undefined reference to `__adddf3'
8.22 +libc/libc_so.a(__psfs_do_numeric.os): In function `__psfs_do_numeric':
8.23 +__psfs_do_numeric.c:(.text+0x520): undefined reference to `__truncdfsf2'
8.24 +libc/libc_so.a(strtof.os): In function `strtof':
8.25 +strtof.c:(.text+0x1c): undefined reference to `__extendsfdf2'
8.26 +/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/cc_core_prefix/lib/gcc/arm-linux-uclibc/4.1.1/libgcc.a(_fixunsdfsi.o):
8.27 +In function `__fixunsdfsi':
8.28 +libgcc2.c:(.text+0x34): undefined reference to `__fixdfsi'
8.29 +make[2]: *** [lib/libc.so] Error 1
8.30 +make[1]: *** [lib/libc.so.0] Error 2
8.31 +make[1]: Leaving directory `/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc'
8.32 +make: *** [/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc/lib/libc.a]
8.33 +Error 2
8.34 +
8.35 +The second hunk fixes building final gcc because soft-float implies using -lfloat (which we don't have).
8.36 +
8.37 +
8.38 +diff -dur gcc-4.1.1.no-softfloat-fix/gcc/config.gcc gcc-4.1.1/gcc/config.gcc
8.39 +--- gcc-4.1.1.no-softfloat-fix/gcc/config.gcc 2007-02-01 21:57:17.000000000 +0100
8.40 ++++ gcc-4.1.1/gcc/config.gcc 2007-02-01 22:11:06.000000000 +0100
8.41 +@@ -690,7 +690,7 @@
8.42 + default_use_cxa_atexit=yes
8.43 + ;;
8.44 + *)
8.45 +- tmake_file="$tmake_file arm/t-linux"
8.46 ++ tmake_file="$tmake_file arm/t-linux arm/t-arm-elf"
8.47 + ;;
8.48 + esac
8.49 + tm_file="$tm_file arm/aout.h arm/arm.h"
8.50 +diff -dur gcc-4.1.1.-lfloat/gcc/config/arm/linux-elf.h gcc-4.1.1/gcc/config/arm/linux-elf.h
8.51 +--- gcc-4.1.1.-lfloat/gcc/config/arm/linux-elf.h 2007-02-01 21:57:17.000000000 +0100
8.52 ++++ gcc-4.1.1/gcc/config/arm/linux-elf.h 2007-02-01 23:00:42.000000000 +0100
8.53 +@@ -63,7 +63,7 @@
8.54 + %{shared:-lc} \
8.55 + %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
8.56 +
8.57 +-#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
8.58 ++#define LIBGCC_SPEC "-lgcc"
8.59 +
8.60 + #ifdef USE_UCLIBC
8.61 + #define LINUX_TARGET_INTERPRETER "/lib/ld-uClibc.so.0"
9.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
9.2 +++ b/patches/glibc/2.5/glibc-2.4-i686-assembler.patch Sun May 27 20:22:06 2007 +0000
9.3 @@ -0,0 +1,38 @@
9.4 +2007-02-15 Khem Raj <kraj@xxxxxxxxxx>
9.5 +
9.6 + * sysdeps/unix/sysv/linux/i386/sysdep.h: Re-define __i686.
9.7 + * nptl/sysdeps/pthread/pt-initfini.c: Ditto.
9.8 +
9.9 +
9.10 +
9.11 +Index: glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h
9.12 +===================================================================
9.13 +--- glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h (revision 1469)
9.14 ++++ glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h (working copy)
9.15 +@@ -29,6 +29,10 @@
9.16 + #include <dl-sysdep.h>
9.17 + #include <tls.h>
9.18 +
9.19 ++#if defined __i686 && defined __ASSEMBLER__
9.20 ++#undef __i686
9.21 ++#define __i686 __i686
9.22 ++#endif
9.23 +
9.24 + /* For Linux we can use the system call table in the header file
9.25 + /usr/include/asm/unistd.h
9.26 +Index: glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c
9.27 +===================================================================
9.28 +--- glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c (revision 1469)
9.29 ++++ glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c (working copy)
9.30 +@@ -45,6 +45,11 @@
9.31 + /* Embed an #include to pull in the alignment and .end directives. */
9.32 + asm ("\n#include \"defs.h\"");
9.33 +
9.34 ++asm ("\n#if defined __i686 && defined __ASSEMBLER__");
9.35 ++asm ("\n#undef __i686");
9.36 ++asm ("\n#define __i686 __i686");
9.37 ++asm ("\n#endif");
9.38 ++
9.39 + /* The initial common code ends here. */
9.40 + asm ("\n/*@HEADER_ENDS*/");
9.41 +
10.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
10.2 +++ b/patches/glibc/2.5/glibc-i386-preferred-stack-boundary.patch Sun May 27 20:22:06 2007 +0000
10.3 @@ -0,0 +1,18 @@
10.4 +(C) 2007 Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
10.5 +License: LGPL v2.1
10.6 +
10.7 +Shut off a stupid warning: preffered-stack-boundary must be between 4 ad 12,
10.8 +and 2 is not.
10.9 +
10.10 +diff -dur glibc-2.5.orig/sysdeps/i386/Makefile glibc-2.5/sysdeps/i386/Makefile
10.11 +--- glibc-2.5.orig/sysdeps/i386/Makefile 2005-03-06 01:18:16.000000000 +0100
10.12 ++++ glibc-2.5/sysdeps/i386/Makefile 2007-05-27 17:49:37.000000000 +0200
10.13 +@@ -36,7 +36,7 @@
10.14 + ifeq ($(subdir),csu)
10.15 + sysdep-CFLAGS += -mpreferred-stack-boundary=4
10.16 + else
10.17 +-sysdep-CFLAGS += -mpreferred-stack-boundary=2
10.18 ++sysdep-CFLAGS += -mpreferred-stack-boundary=4
10.19 + # Likewise, any function which calls user callbacks
10.20 + uses-callbacks += -mpreferred-stack-boundary=4
10.21 + # Likewise, any stack alignment tests
11.1 --- a/patches/glibc/2.5/make-install-lib-all.patch Fri May 25 19:30:42 2007 +0000
11.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
11.3 @@ -1,26 +0,0 @@
11.4 -From http://svn.exactcode.de/t2/trunk/package/base/glibc32/make-install-lib-all.patch
11.5 -Rule to install all needed libraries, not just the ones installed by install-lib,
11.6 -yet not install programs.
11.7 -Needed because we can't use the main install target, as we can't build programs before
11.8 -we have the final gcc installed; linking fails because libeh.a is not present,
11.9 -and glibc insists on linking programs with that library.
11.10 -
11.11 -diff -Naur glibc-2.3.4.orig/Makerules glibc-2.3.4/Makerules
11.12 ---- glibc-2.3.4.orig/Makerules 2004-12-15 20:52:39.000000000 +0200
11.13 -+++ glibc-2.3.4/Makerules 2005-02-19 15:16:31.415125176 +0200
11.14 -@@ -864,6 +864,13 @@
11.15 - installed-libcs := $(foreach o,$(filter-out .os,$(object-suffixes-for-libc)),\
11.16 - $(inst_libdir)/$(patsubst %,$(libtype$o),\
11.17 - $(libprefix)$(libc-name)))
11.18 -+
11.19 -+install-lib-all: $(inst_slibdir)/libc.so$(libc.so-version) \
11.20 -+ $(inst_slibdir)/libc-$(version).so \
11.21 -+ $(inst_libdir)/libc.so \
11.22 -+ $(inst_libdir)/libc.a \
11.23 -+ install-lib
11.24 -+
11.25 - install: $(installed-libcs)
11.26 - $(installed-libcs): $(inst_libdir)/lib$(libprefix)%: lib $(+force)
11.27 - $(make-target-directory)
11.28 -
11.29 -Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
12.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
12.2 +++ b/patches/glibc/2.5/make-install-lib-all.patch.dont_apply Sun May 27 20:22:06 2007 +0000
12.3 @@ -0,0 +1,26 @@
12.4 +From http://svn.exactcode.de/t2/trunk/package/base/glibc32/make-install-lib-all.patch
12.5 +Rule to install all needed libraries, not just the ones installed by install-lib,
12.6 +yet not install programs.
12.7 +Needed because we can't use the main install target, as we can't build programs before
12.8 +we have the final gcc installed; linking fails because libeh.a is not present,
12.9 +and glibc insists on linking programs with that library.
12.10 +
12.11 +diff -Naur glibc-2.3.4.orig/Makerules glibc-2.3.4/Makerules
12.12 +--- glibc-2.3.4.orig/Makerules 2004-12-15 20:52:39.000000000 +0200
12.13 ++++ glibc-2.3.4/Makerules 2005-02-19 15:16:31.415125176 +0200
12.14 +@@ -864,6 +864,13 @@
12.15 + installed-libcs := $(foreach o,$(filter-out .os,$(object-suffixes-for-libc)),\
12.16 + $(inst_libdir)/$(patsubst %,$(libtype$o),\
12.17 + $(libprefix)$(libc-name)))
12.18 ++
12.19 ++install-lib-all: $(inst_slibdir)/libc.so$(libc.so-version) \
12.20 ++ $(inst_slibdir)/libc-$(version).so \
12.21 ++ $(inst_libdir)/libc.so \
12.22 ++ $(inst_libdir)/libc.a \
12.23 ++ install-lib
12.24 ++
12.25 + install: $(installed-libcs)
12.26 + $(installed-libcs): $(inst_libdir)/lib$(libprefix)%: lib $(+force)
12.27 + $(make-target-directory)
12.28 +
12.29 +Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
13.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
13.2 +++ b/samples/i686-nptl-linux-gnu/crosstool.config Sun May 27 20:22:06 2007 +0000
13.3 @@ -0,0 +1,294 @@
13.4 +#
13.5 +# Automatically generated make config: don't edit
13.6 +# crosstool-NG version: 0.0.4-svn
13.7 +# Sun May 27 20:39:36 2007
13.8 +#
13.9 +# CT_FOOBAR is not set
13.10 +
13.11 +#
13.12 +# Paths and misc options
13.13 +#
13.14 +
13.15 +#
13.16 +# Crosstool behavior
13.17 +#
13.18 +CT_EXPERIMENTAL=y
13.19 +# CT_OBSOLETE is not set
13.20 +CT_DEBUG_CT=y
13.21 +# CT_DEBUG_CT_PAUSE_STEPS is not set
13.22 +CT_DEBUG_CT_SAVE_STEPS=y
13.23 +CT_DEBUG_CT_SAVE_STEPS_GZIP=y
13.24 +
13.25 +#
13.26 +# Build behavior
13.27 +#
13.28 +CT_PARALLEL_JOBS=1
13.29 +CT_LOAD=0
13.30 +CT_NICE=0
13.31 +CT_USE_PIPES=y
13.32 +
13.33 +#
13.34 +# Paths
13.35 +#
13.36 +CT_LOCAL_TARBALLS_DIR="${HOME}/dev/src"
13.37 +CT_PREFIX_DIR="/opt/x-tools/${CT_TARGET}"
13.38 +CT_INSTALL_DIR="${CT_PREFIX_DIR}"
13.39 +# CT_CUSTOM_PATCH is not set
13.40 +CT_REMOVE_DOCS=y
13.41 +
13.42 +#
13.43 +# Downloading
13.44 +#
13.45 +# CT_FORCE_DOWNLOAD is not set
13.46 +# CT_ONLY_DOWNLOAD is not set
13.47 +
13.48 +#
13.49 +# Extracting
13.50 +#
13.51 +# CT_FORCE_EXTRACT is not set
13.52 +# CT_ONLY_EXTRACT is not set
13.53 +
13.54 +#
13.55 +# Logging
13.56 +#
13.57 +# CT_LOG_ERROR is not set
13.58 +# CT_LOG_WARN is not set
13.59 +# CT_LOG_INFO is not set
13.60 +CT_LOG_EXTRA=y
13.61 +# CT_LOG_DEBUG is not set
13.62 +# CT_LOG_ALL is not set
13.63 +CT_LOG_LEVEL_MAX="EXTRA"
13.64 +# CT_LOG_SEE_TOOLS_WARN is not set
13.65 +CT_LOG_PROGRESS_BAR=y
13.66 +CT_LOG_TO_FILE=y
13.67 +CT_LOG_FILE="${CT_PREFIX_DIR}/${CT_TARGET}.log"
13.68 +
13.69 +#
13.70 +# Target options
13.71 +#
13.72 +
13.73 +#
13.74 +# General target options
13.75 +#
13.76 +CT_ARCH="x86"
13.77 +# CT_ARCH_ARM is not set
13.78 +# CT_ARCH_MIPS is not set
13.79 +CT_ARCH_x86=y
13.80 +# CT_ARCH_x86_64 is not set
13.81 +# CT_ARCH_SUPPORTS_BOTH_ENDIAN is not set
13.82 +CT_THREADS_NPTL=y
13.83 +# CT_THREADS_LINUXTHREADS is not set
13.84 +# CT_THREADS_NONE is not set
13.85 +CT_THREADS="nptl"
13.86 +
13.87 +#
13.88 +# Target optimisations
13.89 +#
13.90 +CT_ARCH_ARCH="i686"
13.91 +CT_ARCH_ABI=""
13.92 +CT_ARCH_CPU=""
13.93 +CT_ARCH_TUNE="i686"
13.94 +CT_ARCH_FPU=""
13.95 +CT_ARCH_FLOAT_HW=y
13.96 +# CT_ARCH_FLOAT_SW is not set
13.97 +CT_ARCH_SUPPORTS_LIBFLOAT=y
13.98 +CT_TARGET_CFLAGS=""
13.99 +
13.100 +#
13.101 +# Toolchain options
13.102 +#
13.103 +
13.104 +#
13.105 +# General toolchain options
13.106 +#
13.107 +CT_USE_SYSROOT=y
13.108 +CT_SHARED_LIBS=y
13.109 +# CT_TARGET_MULTILIB is not set
13.110 +CT_TARGET_VENDOR="nptl"
13.111 +CT_TARGET_ALIAS=""
13.112 +
13.113 +#
13.114 +# Toolchain type
13.115 +#
13.116 +# CT_NATIVE is not set
13.117 +CT_CROSS=y
13.118 +# CT_CROSS_NATIVE is not set
13.119 +# CT_CANADIAN is not set
13.120 +CT_TOOLCHAIN_TYPE="cross"
13.121 +CT_BUILD=""
13.122 +CT_CC_NATIVE="gcc"
13.123 +
13.124 +#
13.125 +# Kernel
13.126 +#
13.127 +CT_KERNEL_LINUX=y
13.128 +CT_KERNEL_VERSION="2.6.21.3"
13.129 +CT_KERNEL_LINUX_HEADERS_INSTALL=y
13.130 +# CT_KERNEL_LINUX_HEADERS_SANITISED is not set
13.131 +# CT_KERNEL_LINUX_HEADERS_COPY is not set
13.132 +# CT_KERNEL_LINUX_HEADERS_USE_CUSTOM_DIR is not set
13.133 +CT_KERNEL="linux"
13.134 +CT_KERNEL_VERSION_SEE_EXTRAVERSION=y
13.135 +# CT_KERNEL_INSTALL_V_2_6_18 is not set
13.136 +# CT_KERNEL_INSTALL_V_2_6_18_1 is not set
13.137 +# CT_KERNEL_INSTALL_V_2_6_18_2 is not set
13.138 +# CT_KERNEL_INSTALL_V_2_6_18_3 is not set
13.139 +# CT_KERNEL_INSTALL_V_2_6_18_4 is not set
13.140 +# CT_KERNEL_INSTALL_V_2_6_18_5 is not set
13.141 +# CT_KERNEL_INSTALL_V_2_6_18_6 is not set
13.142 +# CT_KERNEL_INSTALL_V_2_6_19 is not set
13.143 +# CT_KERNEL_INSTALL_V_2_6_19_1 is not set
13.144 +# CT_KERNEL_INSTALL_V_2_6_19_2 is not set
13.145 +# CT_KERNEL_INSTALL_V_2_6_20 is not set
13.146 +# CT_KERNEL_INSTALL_V_2_6_20_1 is not set
13.147 +# CT_KERNEL_INSTALL_V_2_6_20_2 is not set
13.148 +# CT_KERNEL_INSTALL_V_2_6_20_3 is not set
13.149 +# CT_KERNEL_INSTALL_V_2_6_20_4 is not set
13.150 +# CT_KERNEL_INSTALL_V_2_6_20_5 is not set
13.151 +# CT_KERNEL_INSTALL_V_2_6_20_6 is not set
13.152 +# CT_KERNEL_INSTALL_V_2_6_20_7 is not set
13.153 +# CT_KERNEL_INSTALL_V_2_6_21 is not set
13.154 +# CT_KERNEL_INSTALL_V_2_6_21_1 is not set
13.155 +# CT_KERNEL_INSTALL_V_2_6_21_2 is not set
13.156 +CT_KERNEL_INSTALL_V_2_6_21_3=y
13.157 +CT_KERNEL_LINUX_VERBOSITY_0=y
13.158 +# CT_KERNEL_LINUX_VERBOSITY_1 is not set
13.159 +# CT_KERNEL_LINUX_VERBOSITY_2 is not set
13.160 +CT_KERNEL_LINUX_VERBOSE_LEVEL=0
13.161 +# CT_KERNEL_LINUX_NEEDS_CONFIG is not set
13.162 +
13.163 +#
13.164 +# binutils
13.165 +#
13.166 +CT_BINUTILS_VERSION="2.17.50.0.16"
13.167 +# CT_BINUTILS_V_2_11_2 is not set
13.168 +# CT_BINUTILS_V_2_13_90 is not set
13.169 +# CT_BINUTILS_V_2_14 is not set
13.170 +# CT_BINUTILS_V_2_14_90 is not set
13.171 +# CT_BINUTILS_V_2_14_92 is not set
13.172 +# CT_BINUTILS_V_2_15 is not set
13.173 +# CT_BINUTILS_V_2_15_90 is not set
13.174 +# CT_BINUTILS_V_2_15_91 is not set
13.175 +# CT_BINUTILS_V_2_16 is not set
13.176 +# CT_BINUTILS_V_2_16_1 is not set
13.177 +# CT_BINUTILS_V_2_17 is not set
13.178 +# CT_BINUTILS_V_2_17_50_0_1 is not set
13.179 +# CT_BINUTILS_V_2_17_50_0_2 is not set
13.180 +# CT_BINUTILS_V_2_17_50_0_3 is not set
13.181 +# CT_BINUTILS_V_2_17_50_0_4 is not set
13.182 +# CT_BINUTILS_V_2_17_50_0_5 is not set
13.183 +# CT_BINUTILS_V_2_17_50_0_6 is not set
13.184 +# CT_BINUTILS_V_2_17_50_0_7 is not set
13.185 +# CT_BINUTILS_V_2_17_50_0_8 is not set
13.186 +# CT_BINUTILS_V_2_17_50_0_9 is not set
13.187 +# CT_BINUTILS_V_2_17_50_0_10 is not set
13.188 +# CT_BINUTILS_V_2_17_50_0_11 is not set
13.189 +# CT_BINUTILS_V_2_17_50_0_12 is not set
13.190 +# CT_BINUTILS_V_2_17_50_0_13 is not set
13.191 +# CT_BINUTILS_V_2_17_50_0_14 is not set
13.192 +# CT_BINUTILS_V_2_17_50_0_15 is not set
13.193 +CT_BINUTILS_V_2_17_50_0_16=y
13.194 +CT_BINUTILS_EXTRA_CONFIG=""
13.195 +
13.196 +#
13.197 +# C compiler
13.198 +#
13.199 +
13.200 +#
13.201 +# Core C Compiler (used to build the C library)
13.202 +#
13.203 +# CT_CC_USE_CORE is not set
13.204 +
13.205 +#
13.206 +# Final C compiler
13.207 +#
13.208 +CT_CC_GCC=y
13.209 +CT_CC_VERSION="4.1.2"
13.210 +CT_CC="gcc"
13.211 +# CT_CC_V_2_95_3 is not set
13.212 +# CT_CC_V_3_2_3 is not set
13.213 +# CT_CC_V_3_3 is not set
13.214 +# CT_CC_V_3_3_1 is not set
13.215 +# CT_CC_V_3_3_2 is not set
13.216 +# CT_CC_V_3_3_3 is not set
13.217 +# CT_CC_V_3_3_4 is not set
13.218 +# CT_CC_V_3_3_5 is not set
13.219 +# CT_CC_V_3_3_6 is not set
13.220 +# CT_CC_V_3_4_0 is not set
13.221 +# CT_CC_V_3_4_1 is not set
13.222 +# CT_CC_V_3_4_2 is not set
13.223 +# CT_CC_V_3_4_3 is not set
13.224 +# CT_CC_V_3_4_4 is not set
13.225 +# CT_CC_V_3_4_5 is not set
13.226 +# CT_CC_V_3_4_6 is not set
13.227 +# CT_CC_V_4_0_0 is not set
13.228 +# CT_CC_V_4_0_1 is not set
13.229 +# CT_CC_V_4_0_2 is not set
13.230 +# CT_CC_V_4_0_3 is not set
13.231 +# CT_CC_V_4_0_4 is not set
13.232 +# CT_CC_V_4_1_0 is not set
13.233 +# CT_CC_V_4_1_1 is not set
13.234 +CT_CC_V_4_1_2=y
13.235 +# CT_CC_V_4_2_0 is not set
13.236 +CT_CC_CXA_ATEXIT=y
13.237 +CT_CC_EXTRA_CONFIG=""
13.238 +CT_CC_SUPPORT_CXX=y
13.239 +CT_CC_SUPPORT_FORTRAN=y
13.240 +CT_CC_SUPPORT_JAVA=y
13.241 +CT_CC_SUPPORT_ADA=y
13.242 +CT_CC_SUPPORT_OBJC=y
13.243 +CT_CC_SUPPORT_OBJCXX=y
13.244 +
13.245 +#
13.246 +# Additionnal supported languages:
13.247 +#
13.248 +CT_CC_LANG_CXX=y
13.249 +# CT_CC_LANG_FORTRAN is not set
13.250 +# CT_CC_LANG_JAVA is not set
13.251 +# CT_CC_LANG_ADA is not set
13.252 +# CT_CC_LANG_OBJC is not set
13.253 +# CT_CC_LANG_OBJCXX is not set
13.254 +CT_CC_LANG_OTHERS=""
13.255 +
13.256 +#
13.257 +# C-library
13.258 +#
13.259 +CT_LIBC_GLIBC=y
13.260 +# CT_LIBC_UCLIBC is not set
13.261 +CT_LIBC_VERSION="2.5"
13.262 +CT_LIBC="glibc"
13.263 +CT_LIBC_SUPPORT_NPTL=y
13.264 +CT_LIBC_SUPPORT_LINUXTHREADS=y
13.265 +# CT_LIBC_V_1_09_1 is not set
13.266 +# CT_LIBC_V_2_0_1 is not set
13.267 +# CT_LIBC_V_2_0_6 is not set
13.268 +# CT_LIBC_V_2_1_1 is not set
13.269 +# CT_LIBC_V_2_1_2 is not set
13.270 +# CT_LIBC_V_2_1_3 is not set
13.271 +# CT_LIBC_V_2_2 is not set
13.272 +# CT_LIBC_V_2_2_1 is not set
13.273 +# CT_LIBC_V_2_2_2 is not set
13.274 +# CT_LIBC_V_2_2_3 is not set
13.275 +# CT_LIBC_V_2_2_4 is not set
13.276 +# CT_LIBC_V_2_2_5 is not set
13.277 +# CT_LIBC_V_2_3 is not set
13.278 +# CT_LIBC_V_2_3_1 is not set
13.279 +# CT_LIBC_V_2_3_2 is not set
13.280 +# CT_LIBC_V_2_3_3 is not set
13.281 +# CT_LIBC_V_2_3_4 is not set
13.282 +# CT_LIBC_V_2_3_5 is not set
13.283 +# CT_LIBC_V_2_3_6 is not set
13.284 +# CT_LIBC_V_2_4 is not set
13.285 +CT_LIBC_V_2_5=y
13.286 +CT_LIBC_GLIBC_EXTRA_CONFIG=""
13.287 +CT_LIBC_GLIBC_EXTRA_CFLAGS=""
13.288 +CT_LIBC_EXTRA_CC_ARGS=""
13.289 +CT_LIBC_GLIBC_CONFIGPARMS=""
13.290 +# CT_LIBC_GLIBC_USE_PORTS is not set
13.291 +# CT_LIBC_ADDONS is not set
13.292 +
13.293 +#
13.294 +# Debug facilities
13.295 +#
13.296 +# CT_DMALLOC is not set
13.297 +# CT_GDB is not set
14.1 --- a/scripts/build/binutils.sh Fri May 25 19:30:42 2007 +0000
14.2 +++ b/scripts/build/binutils.sh Sun May 27 20:22:06 2007 +0000
14.3 @@ -39,14 +39,18 @@
14.4 CT_DoLog EXTRA "Installing binutils"
14.5 make install 2>&1 |CT_DoLog ALL
14.6
14.7 - # Make those new tools available to the core C compiler to come:
14.8 + # Make those new tools available to the core C compilers to come:
14.9 # Note: some components want the ${TARGET}-{ar,as,ld,strip} commands as
14.10 # well. Create that (libfloat is one such sucker).
14.11 - mkdir -p "${CT_CC_CORE_PREFIX_DIR}/${CT_TARGET}/bin"
14.12 - mkdir -p "${CT_CC_CORE_PREFIX_DIR}/bin"
14.13 + mkdir -p "${CT_CC_CORE_STATIC_PREFIX_DIR}/${CT_TARGET}/bin"
14.14 + mkdir -p "${CT_CC_CORE_STATIC_PREFIX_DIR}/bin"
14.15 + mkdir -p "${CT_CC_CORE_SHARED_PREFIX_DIR}/${CT_TARGET}/bin"
14.16 + mkdir -p "${CT_CC_CORE_SHARED_PREFIX_DIR}/bin"
14.17 for t in ar as ld strip; do
14.18 - ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_PREFIX_DIR}/${CT_TARGET}/bin/${t}"
14.19 - ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_PREFIX_DIR}/bin/${CT_TARGET}-${t}"
14.20 + ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_STATIC_PREFIX_DIR}/${CT_TARGET}/bin/${t}"
14.21 + ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_STATIC_PREFIX_DIR}/bin/${CT_TARGET}-${t}"
14.22 + ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_SHARED_PREFIX_DIR}/${CT_TARGET}/bin/${t}"
14.23 + ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_SHARED_PREFIX_DIR}/bin/${CT_TARGET}-${t}"
14.24 done |CT_DoLog ALL
14.25
14.26 CT_EndStep
15.1 --- a/scripts/build/cc_core_gcc.sh Fri May 25 19:30:42 2007 +0000
15.2 +++ b/scripts/build/cc_core_gcc.sh Sun May 27 20:22:06 2007 +0000
15.3 @@ -21,27 +21,47 @@
15.4 CT_ExtractAndPatch "${CT_CC_CORE_FILE}"
15.5 }
15.6
15.7 -# Build core gcc
15.8 -do_cc_core() {
15.9 - mkdir -p "${CT_BUILD_DIR}/build-cc-core"
15.10 - cd "${CT_BUILD_DIR}/build-cc-core"
15.11 +# Core gcc pass 1
15.12 +do_cc_core_pass_1() {
15.13 + # In case we're NPTL, build the static core gcc;
15.14 + # in any other case, do nothing.
15.15 + case "${CT_THREADS}" in
15.16 + nptl) do_cc_core_static;;
15.17 + *) ;;
15.18 + esac
15.19 +}
15.20
15.21 - CT_DoStep INFO "Installing core C compiler"
15.22 +# Core gcc pass 2
15.23 +do_cc_core_pass_2() {
15.24 + # In case we're NPTL, build the shared core gcc,
15.25 + # in any other case, build the static core gcc.
15.26 + case "${CT_THREADS}" in
15.27 + nptl) do_cc_core_shared;;
15.28 + *) do_cc_core_static;;
15.29 + esac
15.30 +}
15.31 +
15.32 +# Build static core gcc
15.33 +do_cc_core_static() {
15.34 + mkdir -p "${CT_BUILD_DIR}/build-cc-core-static"
15.35 + cd "${CT_BUILD_DIR}/build-cc-core-static"
15.36 +
15.37 + CT_DoStep INFO "Installing static core C compiler"
15.38
15.39 CT_DoLog EXTRA "Copying headers to install area of bootstrap gcc, so it can build libgcc2"
15.40 - mkdir -p "${CT_CC_CORE_PREFIX_DIR}/${CT_TARGET}/include"
15.41 - cp -r "${CT_HEADERS_DIR}"/* "${CT_CC_CORE_PREFIX_DIR}/${CT_TARGET}/include" 2>&1 |CT_DoLog DEBUG
15.42 + mkdir -p "${CT_CC_CORE_STATIC_PREFIX_DIR}/${CT_TARGET}/include"
15.43 + cp -r "${CT_HEADERS_DIR}"/* "${CT_CC_CORE_STATIC_PREFIX_DIR}/${CT_TARGET}/include" 2>&1 |CT_DoLog DEBUG
15.44
15.45 - CT_DoLog EXTRA "Configuring core C compiler"
15.46 + CT_DoLog EXTRA "Configuring static core C compiler"
15.47
15.48 extra_config=""
15.49 [ "${CT_ARCH_FLOAT_SW}" = "y" ] && extra_config="${extra_config} --with-float=soft"
15.50 [ -n "${CT_ARCH_ABI}" ] && extra_config="${extra_config} --with-abi=${CT_ARCH_ABI}"
15.51 + [ -n "${CT_ARCH_ARCH}" ] && extra_config="${extra_config} --with-arch=${CT_ARCH_ARCH}"
15.52 [ -n "${CT_ARCH_CPU}" ] && extra_config="${extra_config} --with-cpu=${CT_ARCH_CPU}"
15.53 [ -n "${CT_ARCH_TUNE}" ] && extra_config="${extra_config} --with-tune=${CT_ARCH_TUNE}"
15.54 - [ -n "${CT_ARCH_ARCH}" ] && extra_config="${extra_config} --with-arch=${CT_ARCH_ARCH}"
15.55 [ -n "${CT_ARCH_FPU}" ] && extra_config="${extra_config} --with-fpu=${CT_ARCH_FPU}"
15.56 - [ "${CT_CC_CXA_ATEXIT}" == "y" ] && extra_config="${extra_config} --enable-__cxa_atexit"
15.57 + [ "${CT_CC_CXA_ATEXIT}" = "y" ] && extra_config="${extra_config} --enable-__cxa_atexit"
15.58
15.59 CT_DoLog DEBUG "Extra config passed: \"${extra_config}\""
15.60
15.61 @@ -49,9 +69,9 @@
15.62 CFLAGS="${CT_CFLAGS_FOR_HOST}" \
15.63 "${CT_SRC_DIR}/${CT_CC_CORE_FILE}/configure" \
15.64 ${CT_CANADIAN_OPT} \
15.65 + --host=${CT_HOST} \
15.66 --target=${CT_TARGET} \
15.67 - --host=${CT_HOST} \
15.68 - --prefix="${CT_CC_CORE_PREFIX_DIR}" \
15.69 + --prefix="${CT_CC_CORE_STATIC_PREFIX_DIR}" \
15.70 --with-local-prefix="${CT_SYSROOT_DIR}" \
15.71 --disable-multilib \
15.72 --with-newlib \
15.73 @@ -69,12 +89,102 @@
15.74 make ${PARALLELMFLAGS} all-build-libiberty 2>&1 |CT_DoLog ALL
15.75 fi
15.76
15.77 - CT_DoLog EXTRA "Building core C compiler"
15.78 + CT_DoLog EXTRA "Building static core C compiler"
15.79 make ${PARALLELMFLAGS} all-gcc 2>&1 |CT_DoLog ALL
15.80
15.81 - CT_DoLog EXTRA "Installing core C compiler"
15.82 + CT_DoLog EXTRA "Installing static core C compiler"
15.83 make install-gcc 2>&1 |CT_DoLog ALL
15.84
15.85 CT_EndStep
15.86 }
15.87
15.88 +# Build shared core gcc
15.89 +do_cc_core_shared() {
15.90 + mkdir -p "${CT_BUILD_DIR}/build-cc-core-shared"
15.91 + cd "${CT_BUILD_DIR}/build-cc-core-shared"
15.92 +
15.93 + CT_DoStep INFO "Installing shared core C compiler"
15.94 +
15.95 + CT_DoLog EXTRA "Copying headers to install area of bootstrap gcc, so it can build libgcc2"
15.96 + mkdir -p "${CT_CC_CORE_SHARED_PREFIX_DIR}/${CT_TARGET}/include"
15.97 + cp -r "${CT_HEADERS_DIR}"/* "${CT_CC_CORE_SHARED_PREFIX_DIR}/${CT_TARGET}/include" 2>&1 |CT_DoLog DEBUG
15.98 +
15.99 + CT_DoLog EXTRA "Configuring shared core C compiler"
15.100 +
15.101 + extra_config=""
15.102 + [ "${CT_ARCH_FLOAT_SW}" = "y" ] && extra_config="${extra_config} --with-float=soft"
15.103 + [ -n "${CT_ARCH_ABI}" ] && extra_config="${extra_config} --with-abi=${CT_ARCH_ABI}"
15.104 + [ -n "${CT_ARCH_ARCH}" ] && extra_config="${extra_config} --with-arch=${CT_ARCH_ARCH}"
15.105 + [ -n "${CT_ARCH_CPU}" ] && extra_config="${extra_config} --with-cpu=${CT_ARCH_CPU}"
15.106 + [ -n "${CT_ARCH_TUNE}" ] && extra_config="${extra_config} --with-tune=${CT_ARCH_TUNE}"
15.107 + [ -n "${CT_ARCH_FPU}" ] && extra_config="${extra_config} --with-fpu=${CT_ARCH_FPU}"
15.108 + [ "${CT_CC_CXA_ATEXIT}" = "y" ] && extra_config="${extra_config} --enable-__cxa_atexit"
15.109 +
15.110 + CT_DoLog DEBUG "Extra config passed: \"${extra_config}\""
15.111 +
15.112 + CFLAGS="${CT_CFLAGS_FOR_HOST}" \
15.113 + "${CT_SRC_DIR}/${CT_CC_CORE_FILE}/configure" \
15.114 + ${CT_CANADIAN_OPT} \
15.115 + --target=${CT_TARGET} \
15.116 + --host=${CT_HOST} \
15.117 + --prefix="${CT_CC_CORE_SHARED_PREFIX_DIR}" \
15.118 + --with-local-prefix="${CT_SYSROOT_DIR}" \
15.119 + --disable-multilib \
15.120 + ${CC_CORE_SYSROOT_ARG} \
15.121 + ${extra_config} \
15.122 + --disable-nls \
15.123 + --enable-symvers=gnu \
15.124 + --enable-languages=c \
15.125 + --enable-shared \
15.126 + ${CT_CC_CORE_EXTRA_CONFIG} 2>&1 |CT_DoLog ALL
15.127 +
15.128 + # HACK: we need to override SHLIB_LC from gcc/config/t-slibgcc-elf-ver or
15.129 + # gcc/config/t-libunwind so -lc is removed from the link for
15.130 + # libgcc_s.so, as we do not have a target -lc yet.
15.131 + # This is not as ugly as it appears to be ;-) All symbols get resolved
15.132 + # during the glibc build, and we provide a proper libgcc_s.so for the
15.133 + # cross toolchain during the final gcc build.
15.134 + #
15.135 + # As we cannot modify the source tree, nor override SHLIB_LC itself
15.136 + # during configure or make, we have to edit the resultant
15.137 + # gcc/libgcc.mk itself to remove -lc from the link.
15.138 + # This causes us to have to jump through some hoops...
15.139 + #
15.140 + # To produce libgcc.mk to edit we firstly require libiberty.a,
15.141 + # so we configure then build it.
15.142 + # Next we have to configure gcc, create libgcc.mk then edit it...
15.143 + # So much easier if we just edit the source tree, but hey...
15.144 + if [ ! -f "${CT_SRC_DIR}/${CT_CC_CORE_FILE}/gcc/BASE-VER" ]; then
15.145 + make configure-libiberty
15.146 + make -C libiberty libiberty.a
15.147 + make configure-gcc
15.148 + make configure-libcpp
15.149 + make all-libcpp
15.150 + else
15.151 + make configure-gcc
15.152 + make configure-libcpp
15.153 + make configure-build-libiberty
15.154 + make all-libcpp
15.155 + make all-build-libiberty
15.156 + fi 2>&1 |CT_DoLog ALL
15.157 + # HACK: gcc-4.2 uses libdecnumber to build libgcc.mk, so build it here.
15.158 + if [ -d "${CT_SRC_DIR}/${CT_CC_CORE_FILE}/libdecnumber" ]; then
15.159 + make configure-libdecnumber
15.160 + make -C libdecnumber libdecnumber.a
15.161 + fi 2>&1 |CT_DoLog ALL
15.162 + make -C gcc libgcc.mk 2>&1 |CT_DoLog ALL
15.163 + sed -r -i -e 's@-lc@@g' gcc/libgcc.mk
15.164 +
15.165 + if [ "${CT_CANADIAN}" = "y" ]; then
15.166 + CT_DoLog EXTRA "Building libiberty"
15.167 + make ${PARALLELMFLAGS} all-build-libiberty 2>&1 |CT_DoLog ALL
15.168 + fi
15.169 +
15.170 + CT_DoLog EXTRA "Building shared core C compiler"
15.171 + make ${PARALLELMFLAGS} all-gcc 2>&1 |CT_DoLog ALL
15.172 +
15.173 + CT_DoLog EXTRA "Installing shared core C compiler"
15.174 + make install-gcc 2>&1 |CT_DoLog ALL
15.175 +
15.176 + CT_EndStep
15.177 +}
16.1 --- a/scripts/build/debug/dmalloc.sh Fri May 25 19:30:42 2007 +0000
16.2 +++ b/scripts/build/debug/dmalloc.sh Sun May 27 20:22:06 2007 +0000
16.3 @@ -22,7 +22,7 @@
16.4 y) extra_config="${extra_config} --enable-cxx";;
16.5 *) extra_config="${extra_config} --disable-cxx";;
16.6 esac
16.7 - case "${CT_LIBC_THREADS_NONE}" in
16.8 + case "${CT_THREADS_NONE}" in
16.9 y) extra_config="${extra_config} --disable-threads";;
16.10 *) extra_config="${extra_config} --enable-threads";;
16.11 esac
17.1 --- a/scripts/build/libc_glibc.sh Fri May 25 19:30:42 2007 +0000
17.2 +++ b/scripts/build/libc_glibc.sh Sun May 27 20:22:06 2007 +0000
17.3 @@ -11,10 +11,13 @@
17.4
17.5 # C library addons
17.6 addons_list=`echo "${CT_LIBC_ADDONS_LIST}" |sed -r -e 's/,/ /g; s/ $//g;'`
17.7 + case "${CT_THREADS}" in
17.8 + linuxthreads) addons_list="${addons_list} linuxthreads";;
17.9 + esac
17.10 + [ "${CT_LIBC_GLIBC_USE_PORTS}" = "y" ] && addons_list="${addons_list} ports"
17.11 for addon in ${addons_list}; do
17.12 CT_GetFile "${CT_LIBC}-${addon}-${CT_LIBC_VERSION}" ftp://ftp.gnu.org/gnu/glibc
17.13 done
17.14 - [ "${CT_LIBC_GLIBC_USE_PORTS}" = "y" ] && CT_GetFile "${CT_LIBC}-ports-${CT_LIBC_VERSION}" ftp://ftp.gnu.org/gnu/glibc
17.15
17.16 return 0
17.17 }
17.18 @@ -25,10 +28,13 @@
17.19
17.20 # C library addons
17.21 addons_list=`echo "${CT_LIBC_ADDONS_LIST}" |sed -r -e 's/,/ /g; s/ $//g;'`
17.22 + case "${CT_THREADS}" in
17.23 + linuxthreads) addons_list="${addons_list} linuxthreads";;
17.24 + esac
17.25 + [ "${CT_LIBC_GLIBC_USE_PORTS}" = "y" ] && addons_list="${addons_list} ports"
17.26 for addon in ${addons_list}; do
17.27 CT_ExtractAndPatch "${CT_LIBC}-${addon}-${CT_LIBC_VERSION}"
17.28 done
17.29 - [ "${CT_LIBC_GLIBC_USE_PORTS}" = "y" ] && CT_ExtractAndPatch "${CT_LIBC}-ports-${CT_LIBC_VERSION}"
17.30
17.31 return 0
17.32 }
17.33 @@ -68,21 +74,27 @@
17.34 # 'a version of binutils that supports .machine "altivec" is needed'.
17.35
17.36 # We also need to use the ports addon if specified
17.37 - addons=
17.38 - [ "${CT_LIBC_GLIBC_USE_PORTS}" = "y" ] && addons="${CT_LIBC}-ports-${CT_LIBC_VERSION}"
17.39 + addons_list=
17.40 + case "${CT_LIBC_ADDONS},${CT_LIBC_GLIBC_USE_PORTS}" in
17.41 + y,y) addons_list="${CT_LIBC_ADDONS_LIST},ports";;
17.42 + y,) addons_list="${CT_LIBC_ADDONS_LIST}";;
17.43 + ,y) addons_list="ports";;
17.44 + *) addons_list="";;
17.45 + esac
17.46 + addons_config="--enable-add-ons=`echo ${addons_list} |sed -r -e 's/,+/,/g; s/^,+//; s/,+$//;'`"
17.47
17.48 libc_cv_ppc_machine=yes \
17.49 CC=${CT_CC_NATIVE} \
17.50 "${CT_SRC_DIR}/${CT_LIBC_FILE}/configure" \
17.51 - --build="${CT_BUILD}" \
17.52 + --build="${CT_UNIQ_BUILD}" \
17.53 --host="${CT_TARGET}" \
17.54 --prefix=/usr \
17.55 --with-headers="${CT_HEADERS_DIR}" \
17.56 --without-cvs \
17.57 --disable-sanity-checks \
17.58 --enable-hacker-mode \
17.59 - --enable-add-ons="${addons}" \
17.60 - --without-nptl 2>&1 |CT_DoLog ALL
17.61 + --without-nptl \
17.62 + ${addons_config} 2>&1 |CT_DoLog ALL
17.63
17.64 CT_DoLog EXTRA "Installing C library headers"
17.65
17.66 @@ -133,6 +145,131 @@
17.67 # but it breaks arm, see http://sourceware.org/ml/crossgcc/2006-01/msg00091.html
17.68 [ "${CT_ARCH}" != "arm" ] && cp misc/syscall-list.h "${CT_HEADERS_DIR}/bits/syscall.h" || true
17.69
17.70 + # Those headers are to be manually copied so gcc can build properly
17.71 + pthread_h=
17.72 + pthreadtypes_h=
17.73 + case "${CT_THREADS}" in
17.74 + nptl)
17.75 + # NOTE: for some archs, the pathes are different, but they are not
17.76 + # supported by ct-ng right now. See original crosstool when they are.
17.77 + pthread_h="${CT_SRC_DIR}/${CT_LIBC_FILE}/${CT_THREADS}/sysdeps/pthread/pthread.h"
17.78 + pthreadtypes_h="${CT_SRC_DIR}/${CT_LIBC_FILE}/nptl/sysdeps/unix/sysv/linux/${CT_KERNEL_ARCH}/bits/pthreadtypes.h"
17.79 + ;;
17.80 + linuxthreads)
17.81 + pthread_h="${CT_SRC_DIR}/${CT_LIBC_FILE}/${CT_THREADS}/sysdeps/pthread/pthread.h"
17.82 + pthreadtypes_h="${CT_SRC_DIR}/${CT_LIBC_FILE}/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h"
17.83 + ;;
17.84 + esac
17.85 + if [ -n "${pthread_h}" ]; then
17.86 + cp -v "${pthread_h}" "${CT_HEADERS_DIR}/pthread.h" 2>&1 |CT_DoLog ALL
17.87 + fi
17.88 + if [ -n "${pthreadtypes_h}" ]; then
17.89 + cp -v "${pthreadtypes_h}" "${CT_HEADERS_DIR}/bits/pthreadtypes.h" 2>&1 |CT_DoLog ALL
17.90 + fi
17.91 +
17.92 + CT_EndStep
17.93 +}
17.94 +
17.95 +# Build and install start files
17.96 +do_libc_start_files() {
17.97 + # Needed only in the NPTL case. Otherwise, return.
17.98 + [ "${CT_THREADS}" = "nptl" ] || return 0
17.99 +
17.100 + CT_DoStep INFO "Installing C library start files"
17.101 +
17.102 + mkdir -p "${CT_BUILD_DIR}/build-libc-startfiles"
17.103 + cd "${CT_BUILD_DIR}/build-libc-startfiles"
17.104 +
17.105 + CT_DoLog EXTRA "Configuring C library"
17.106 +
17.107 + # Add some default glibc config options if not given by user.
17.108 + extra_config=""
17.109 + case "${CT_LIBC_GLIBC_EXTRA_CONFIG}" in
17.110 + *enable-kernel*) ;;
17.111 + *) extra_config="${extra_config} --enable-kernel=`echo ${CT_KERNEL_VERSION} |sed -r -e 's/^([^.]+\.[^.]+\.[^.]+)(|\.[^.]+)$/\1/;'`"
17.112 + esac
17.113 + case "${CT_LIBC_GLIBC_EXTRA_CONFIG}" in
17.114 + *-tls*) ;;
17.115 + *) extra_config="${extra_config} --with-tls"
17.116 + esac
17.117 + case "${CT_SHARED_LIBS}" in
17.118 + y) extra_config="${extra_config} --enable-shared";;
17.119 + *) extra_config="${extra_config} --disable-shared";;
17.120 + esac
17.121 + case "${CT_LIBC_GLIBC_EXTRA_CONFIG}" in
17.122 + *--with-fp*) ;;
17.123 + *--without-fp*) ;;
17.124 + *) case "${CT_ARCH_FLOAT_HW},${CT_ARCH_FLOAT_SW}" in
17.125 + y,) extra_config="${extra_config} --with-fp";;
17.126 + ,y) extra_config="${extra_config} --without-fp";;
17.127 + esac;;
17.128 + esac
17.129 + # Obviously, we want threads, as we come here only for NPTL
17.130 + extra_config="${extra_config} --with-__thread"
17.131 +
17.132 + addons_list=
17.133 + case "${CT_LIBC_ADDONS},${CT_LIBC_GLIBC_USE_PORTS}" in
17.134 + y,y) addons_list="nptl,${CT_LIBC_ADDONS_LIST},ports";;
17.135 + y,) addons_list="nptl,${CT_LIBC_ADDONS_LIST}";;
17.136 + ,y) addons_list="nptl,ports";;
17.137 + *) addons_list="nptl";;
17.138 + esac
17.139 + addons_config="--enable-add-ons=`echo ${addons_list} |sed -r -e 's/,+/,/g; s/^,+//; s/,+$//;'`"
17.140 + extra_config="${extra_config} ${addons_config}"
17.141 +
17.142 + # Add some default CC args
17.143 + extra_cc_args="${CT_CFLAGS_FOR_HOST}"
17.144 + case "${CT_LIBC_EXTRA_CC_ARGS}" in
17.145 + *-mbig-endian*) ;;
17.146 + *-mlittle-endian*) ;;
17.147 + *) case "${CT_ARCH_BE},${CT_ARCH_LE}" in
17.148 + y,) extra_cc_args="${extra_cc_args} -mbig-endian";;
17.149 + ,y) extra_cc_args="${extra_cc_args} -mlittle-endian";;
17.150 + esac;;
17.151 + esac
17.152 +
17.153 + CT_DoLog DEBUG "Configuring with addons : \"${addons_list}\""
17.154 + CT_DoLog DEBUG "Extra config args passed: \"${extra_config}\""
17.155 + CT_DoLog DEBUG "Extra CC args passed: \"${extra_cc_args}\""
17.156 +
17.157 + # sh3 and sh4 really need to set configparms as of gcc-3.4/glibc-2.3.2
17.158 + # note: this is awkward, doesn't work well if you need more than one line in configparms
17.159 + echo ${CT_LIBC_GLIBC_CONFIGPARMS} > configparms
17.160 +
17.161 + echo "libc_cv_forced_unwind=yes" > config.cache
17.162 + echo "libc_cv_c_cleanup=yes" >> config.cache
17.163 +
17.164 + # Please see the comment for the configure step in do_libc().
17.165 +
17.166 + BUILD_CC=${CT_CC_NATIVE} \
17.167 + CFLAGS="${CT_TARGET_CFLAGS} ${CT_LIBC_GLIBC_EXTRA_CFLAGS} -O" \
17.168 + CC="${CT_TARGET}-gcc ${CT_LIBC_EXTRA_CC_ARGS} ${extra_cc_args}" \
17.169 + AR=${CT_TARGET}-ar \
17.170 + RANLIB=${CT_TARGET}-ranlib \
17.171 + "${CT_SRC_DIR}/${CT_LIBC_FILE}/configure" \
17.172 + --prefix=/usr \
17.173 + --build="${CT_UNIQ_BUILD}" \
17.174 + --host=${CT_TARGET} \
17.175 + --without-cvs \
17.176 + --disable-profile \
17.177 + --disable-debug \
17.178 + --without-gd \
17.179 + --with-headers="${CT_HEADERS_DIR}" \
17.180 + --cache-file=config.cache \
17.181 + ${extra_config} \
17.182 + ${CT_LIBC_GLIBC_EXTRA_CONFIG} 2>&1 |CT_DoLog ALL
17.183 +
17.184 +
17.185 + #TODO: should check whether slibdir has been set in configparms to */lib64
17.186 + # and copy the startfiles into the appropriate libdir.
17.187 + make csu/subdir_lib 2>&1 |CT_DoLog ALL
17.188 +
17.189 + if [ "${CT_USE_SYSROOT}" = "y" ]; then
17.190 + cp -fp csu/crt[1in].o "${CT_SYSROOT_DIR}/usr/lib/"
17.191 + else
17.192 + cp -fp csu/crt[1in].o "${CT_SYSROOT_DIR}/lib/"
17.193 + fi
17.194 +
17.195 CT_EndStep
17.196 }
17.197
17.198 @@ -146,51 +283,59 @@
17.199 CT_DoLog EXTRA "Configuring C library"
17.200
17.201 # Add some default glibc config options if not given by user.
17.202 - extra_config=""
17.203 - case "${CT_LIBC_GLIBC_EXTRA_CONFIG}" in
17.204 - *enable-kernel*) ;;
17.205 - *) extra_config="${extra_config} --enable-kernel=`echo ${CT_KERNEL_VERSION} |sed -r -e 's/^([^.]+\.[^.]+\.[^.]+)(|\.[^.]+)$/\1/;'`"
17.206 + # We don't need to be conditional on wether the user did set different
17.207 + # values, as they CT_LIBC_GLIBC_EXTRA_CONFIG is passed after extra_config
17.208 +
17.209 + extra_config="--enable-kernel=`echo ${CT_KERNEL_VERSION} |sed -r -e 's/^([^.]+\.[^.]+\.[^.]+)(|\.[^.]+)$/\1/;'`"
17.210 +
17.211 + case "${CT_THREADS}" in
17.212 + nptl) extra_config="${extra_config} --with-__thread --with-tls";;
17.213 + linuxthreads) extra_config="${extra_config} --with-__thread --without-tls --without-nptl";;
17.214 + none) extra_config="${extra_config} --without-__thread --without-nptl"
17.215 + case "${CT_LIBC_GLIBC_EXTRA_CONFIG}" in
17.216 + *-tls*) ;;
17.217 + *) extra_config="${extra_config} --without-tls";;
17.218 + esac
17.219 + ;;
17.220 esac
17.221 - case "${CT_LIBC_GLIBC_EXTRA_CONFIG}" in
17.222 - *-tls*) ;;
17.223 - *) extra_config="${extra_config} --without-tls"
17.224 - esac
17.225 - case "${CT_LIBC_GLIBC_EXTRA_CONFIG}" in
17.226 - *-__thread*) ;;
17.227 - *) extra_config="${extra_config} --without-__thread"
17.228 - esac
17.229 +
17.230 case "${CT_SHARED_LIBS}" in
17.231 y) extra_config="${extra_config} --enable-shared";;
17.232 *) extra_config="${extra_config} --disable-shared";;
17.233 esac
17.234 - case "${CT_LIBC_GLIBC_EXTRA_CONFIG}" in
17.235 - *--with-fp*) ;;
17.236 - *--without-fp*) ;;
17.237 - *) case "${CT_ARCH_FLOAT_HW},${CT_ARCH_FLOAT_SW}" in
17.238 - y,) extra_config="${extra_config} --with-fp";;
17.239 - ,y) extra_config="${extra_config} --without-fp";;
17.240 - esac;;
17.241 +
17.242 + case "${CT_ARCH_FLOAT_HW},${CT_ARCH_FLOAT_SW}" in
17.243 + y,) extra_config="${extra_config} --with-fp";;
17.244 + ,y) extra_config="${extra_config} --without-fp";;
17.245 esac
17.246
17.247 + addons_list=
17.248 case "${CT_LIBC_ADDONS},${CT_LIBC_GLIBC_USE_PORTS}" in
17.249 - y,y) addons_config="--enable-add-ons=${CT_LIBC_ADDONS_LIST},${CT_LIBC}-ports-${CT_LIBC_VERSION}";;
17.250 - y,) addons_config="--enable-add-ons=${CT_LIBC_ADDONS_LIST}";;
17.251 - ,y) addons_config="--enable-add-ons=${CT_LIBC}-ports-${CT_LIBC_VERSION}";;
17.252 - *) addons_config="";;
17.253 + y,y) addons_list="${CT_LIBC_ADDONS_LIST},ports";;
17.254 + y,) addons_list="${CT_LIBC_ADDONS_LIST}";;
17.255 + ,y) addons_list="ports";;
17.256 + *) addons_list="";;
17.257 + esac
17.258 + case "${CT_THREADS}" in
17.259 + none) ;;
17.260 + *) addons_list="${addons_list},${CT_THREADS}";;
17.261 + esac
17.262 + case "${addons_list}" in
17.263 + "") ;;
17.264 + *) addons_config="--enable-add-ons=`echo ${addons_list} |sed -r -e 's/,+/,/g; s/^,+//g; s/,+$//;'`";;
17.265 + esac
17.266 + extra_config="${extra_config} ${addons_config}"
17.267 +
17.268 + # Add some default CC args
17.269 + if [ "${CT_USE_PIPES}" = "y" ]; then
17.270 + extra_cc_args="-pipe"
17.271 + fi
17.272 + case "${CT_ARCH_BE},${CT_ARCH_LE}" in
17.273 + y,) extra_cc_args="${extra_cc_args} -mbig-endian";;
17.274 + ,y) extra_cc_args="${extra_cc_args} -mlittle-endian";;
17.275 esac
17.276
17.277 - # Add some default CC args
17.278 - extra_cc_args="${CT_CFLAGS_FOR_HOST}"
17.279 - case "${CT_LIBC_EXTRA_CC_ARGS}" in
17.280 - *-mbig-endian*) ;;
17.281 - *-mlittle-endian*) ;;
17.282 - *) case "${CT_ARCH_BE},${CT_ARCH_LE}" in
17.283 - y,) extra_cc_args="${extra_cc_args} -mbig-endian";;
17.284 - ,y) extra_cc_args="${extra_cc_args} -mlittle-endian";;
17.285 - esac;;
17.286 - esac
17.287 -
17.288 - CT_DoLog DEBUG "Configuring with addons : \"${addons_config}\""
17.289 + CT_DoLog DEBUG "Configuring with addons : \"${addons_list}\""
17.290 CT_DoLog DEBUG "Extra config args passed: \"${extra_config}\""
17.291 CT_DoLog DEBUG "Extra CC args passed: \"${extra_cc_args}\""
17.292
17.293 @@ -201,11 +346,10 @@
17.294 # For glibc 2.3.4 and later we need to set some autoconf cache
17.295 # variables, because nptl/sysdeps/pthread/configure.in does not
17.296 # work when cross-compiling.
17.297 - if test -d ${GLIBC_DIR}/nptl; then
17.298 - libc_cv_forced_unwind=yes
17.299 - libc_cv_c_cleanup=yes
17.300 - export libc_cv_forced_unwind libc_cv_c_cleanup
17.301 - fi
17.302 + if [ "${CT_THREADS}" = "nptl" ]; then
17.303 + echo libc_cv_forced_unwind=yes
17.304 + echo libc_cv_c_cleanup=yes
17.305 + fi >config.cache
17.306
17.307 # Configure with --prefix the way we want it on the target...
17.308 # There are a whole lot of settings here. You'll probably want
17.309 @@ -216,19 +360,26 @@
17.310 # Set BUILD_CC, or you won't be able to build datafiles
17.311 # Set --build, else glibc-2.3.2 will think you're not cross-compiling, and try to run the test programs
17.312
17.313 + # OK. I'm fed up with those folks telling me what I should do.
17.314 + # I don't configure nptl? Well, maybe that's purposedly because
17.315 + # I don't want nptl! --disable-sanity-checks will shut up those
17.316 + # silly messages. GNU folks again, he?
17.317 +
17.318 BUILD_CC=${CT_CC_NATIVE} \
17.319 CFLAGS="${CT_TARGET_CFLAGS} ${CT_LIBC_GLIBC_EXTRA_CFLAGS} -O" \
17.320 - CC="${CT_TARGET}-gcc ${CT_LIBC_EXTRA_CC_ARGS} ${extra_cc_args}" \
17.321 + CC="${CT_TARGET}-gcc ${extra_cc_args} ${CT_LIBC_EXTRA_CC_ARGS}" \
17.322 AR=${CT_TARGET}-ar \
17.323 RANLIB=${CT_TARGET}-ranlib \
17.324 "${CT_SRC_DIR}/${CT_LIBC_FILE}/configure" \
17.325 --prefix=/usr \
17.326 - --build=${CT_BUILD} --host=${CT_TARGET} \
17.327 + --build=${CT_UNIQ_BUILD} \
17.328 + --host=${CT_TARGET} \
17.329 --without-cvs \
17.330 - --without-nptl \
17.331 --disable-profile \
17.332 --disable-debug \
17.333 --without-gd \
17.334 + --disable-sanity-checks \
17.335 + --cache-file=config.cache \
17.336 --with-headers="${CT_HEADERS_DIR}" \
17.337 ${addons_config} \
17.338 ${extra_config} \
18.1 --- a/scripts/build/libc_uClibc.sh Fri May 25 19:30:42 2007 +0000
18.2 +++ b/scripts/build/libc_uClibc.sh Sun May 27 20:22:06 2007 +0000
18.3 @@ -79,6 +79,11 @@
18.4 CT_EndStep
18.5 }
18.6
18.7 +# Build and install start files
18.8 +do_libc_start_files() {
18.9 + :
18.10 +}
18.11 +
18.12 # This function build and install the full uClibc
18.13 do_libc() {
18.14 CT_DoStep INFO "Installing C library"
19.1 --- a/scripts/build/libfloat.sh Fri May 25 19:30:42 2007 +0000
19.2 +++ b/scripts/build/libfloat.sh Sun May 27 20:22:06 2007 +0000
19.3 @@ -40,11 +40,11 @@
19.4 make clean 2>&1 |CT_DoLog ALL
19.5
19.6 CT_DoLog EXTRA "Building library"
19.7 - make CROSS_COMPILE="${CT_CC_CORE_PREFIX_DIR}/bin/${CT_TARGET}-" 2>&1 |CT_DoLog ALL
19.8 + make CROSS_COMPILE="${CT_CC_CORE_SHARED_PREFIX_DIR}/bin/${CT_TARGET}-" 2>&1 |CT_DoLog ALL
19.9
19.10 CT_DoLog EXTRA "Installing library"
19.11 - make CROSS_COMPILE="${CT_CC_CORE_PREFIX_DIR}/bin/${CT_TARGET}-" \
19.12 - DESTDIR="${CT_SYSROOT_DIR}" install 2>&1 |CT_DoLog ALL
19.13 + make CROSS_COMPILE="${CT_CC_CORE_SHARED_PREFIX_DIR}/bin/${CT_TARGET}-" \
19.14 + DESTDIR="${CT_SYSROOT_DIR}" install 2>&1 |CT_DoLog ALL
19.15
19.16 CT_Popd
19.17
20.1 --- a/scripts/crosstool.sh Fri May 25 19:30:42 2007 +0000
20.2 +++ b/scripts/crosstool.sh Sun May 27 20:22:06 2007 +0000
20.3 @@ -31,7 +31,7 @@
20.4 # - first of all, save stdout so we can see the live logs: fd #6
20.5 exec 6>&1
20.6 # - then point stdout to the log file (temporary for now)
20.7 -tmp_log_file="${CT_TOP_DIR}/$$.log"
20.8 +tmp_log_file="${CT_TOP_DIR}/log.$$"
20.9 exec >>"${tmp_log_file}"
20.10
20.11 # Are we configured? We'll need that later...
20.12 @@ -118,7 +118,8 @@
20.13 # Note: we'll always install the core compiler in its own directory, so as to
20.14 # not mix the two builds: core and final. Anyway, its generic, wether we use
20.15 # a different compiler as core, or not.
20.16 -CT_CC_CORE_PREFIX_DIR="${CT_BUILD_DIR}/${CT_CC}-core"
20.17 +CT_CC_CORE_STATIC_PREFIX_DIR="${CT_BUILD_DIR}/${CT_CC}-core-static"
20.18 +CT_CC_CORE_SHARED_PREFIX_DIR="${CT_BUILD_DIR}/${CT_CC}-core-shared"
20.19 CT_STATE_DIR="${CT_TOP_DIR}/targets/${CT_TARGET}/state"
20.20
20.21 # Make all path absolute, it so much easier!
20.22 @@ -201,11 +202,12 @@
20.23 mkdir -p "${CT_INSTALL_DIR}"
20.24 mkdir -p "${CT_PREFIX_DIR}"
20.25 mkdir -p "${CT_DEBUG_INSTALL_DIR}"
20.26 -mkdir -p "${CT_CC_CORE_PREFIX_DIR}"
20.27 +mkdir -p "${CT_CC_CORE_STATIC_PREFIX_DIR}"
20.28 +mkdir -p "${CT_CC_CORE_SHARED_PREFIX_DIR}"
20.29 mkdir -p "${CT_STATE_DIR}"
20.30
20.31 # Kludge: CT_INSTALL_DIR and CT_PREFIX_DIR might have grown read-only if
20.32 -# the previous build was successfull. To ba able to move the logfile there,
20.33 +# the previous build was successfull. To be able to move the logfile there,
20.34 # switch them back to read/write
20.35 chmod -R u+w "${CT_INSTALL_DIR}" "${CT_PREFIX_DIR}"
20.36
20.37 @@ -269,16 +271,22 @@
20.38 mkdir -p "${CT_SYSROOT_DIR}/usr/lib"
20.39
20.40 # Canadian-cross are really picky on the way they are built. Tweak the values.
20.41 + CT_UNIQ_BUILD=`echo "${CT_BUILD}" |sed -r -e 's/-/-build_/'`
20.42 if [ "${CT_CANADIAN}" = "y" ]; then
20.43 # Arrange so that gcc never, ever think that build system == host system
20.44 - CT_CANADIAN_OPT="--build=`echo \"${CT_BUILD}\" |sed -r -e 's/-/-build_/'`"
20.45 + CT_CANADIAN_OPT="--build=${CT_UNIQ_BUILD}"
20.46 # We shall have a compiler for this target!
20.47 # Do test here...
20.48 else
20.49 CT_HOST="${CT_BUILD}"
20.50 CT_CANADIAN_OPT="--build=${CT_BUILD}"
20.51 # Add the target toolchain in the path so that we can build the C library
20.52 - export PATH="${CT_PREFIX_DIR}/bin:${CT_CC_CORE_PREFIX_DIR}/bin:${PATH}"
20.53 + # Carefully add paths in the order we want them:
20.54 + # - first try in ${CT_PREFIX_DIR}/bin
20.55 + # - then try in ${CT_CC_CORE_SHARED_PREFIX_DIR}/bin
20.56 + # - then try in ${CT_CC_CORE_STATIC_PREFIX_DIR}/bin
20.57 + # - fall back to searching user's PATH
20.58 + export PATH="${CT_PREFIX_DIR}/bin:${CT_CC_CORE_SHARED_PREFIX_DIR}/bin:${CT_CC_CORE_STATIC_PREFIX_DIR}/bin:${PATH}"
20.59 fi
20.60
20.61 # Modify GCC_HOST to never be equal to $BUILD or $TARGET
20.62 @@ -294,7 +302,7 @@
20.63 # (Copied almost as-is from original crosstool):
20.64 case "${CT_KERNEL},${CT_CANADIAN}" in
20.65 cygwin,y) ;;
20.66 - *) CT_HOST="`echo \"${CT_HOST}\" |sed -r -e 's/-/-host_/;'`";;
20.67 + *,y) CT_HOST="`echo \"${CT_HOST}\" |sed -r -e 's/-/-host_/;'`";;
20.68 esac
20.69
20.70 # Ah! Recent versions of binutils need some of the build and/or host system
20.71 @@ -304,10 +312,9 @@
20.72 mkdir -p "${CT_PREFIX_DIR}/bin"
20.73 for tool in ar as dlltool gcc g++ gnatbind gnatmake ld nm ranlib strip windres objcopy objdump; do
20.74 if [ -n "`which ${tool}`" ]; then
20.75 - ln -sv "`which ${tool}`" "${CT_PREFIX_DIR}/bin/${CT_BUILD}-${tool}"
20.76 - case "${CT_TOOLCHAIN_TYPE}" in
20.77 - cross|native) ln -sv "`which ${tool}`" "${CT_PREFIX_DIR}/bin/${CT_HOST}-${tool}";;
20.78 - esac
20.79 + ln -sfv "`which ${tool}`" "${CT_PREFIX_DIR}/bin/${CT_BUILD}-${tool}"
20.80 + ln -sfv "`which ${tool}`" "${CT_PREFIX_DIR}/bin/${CT_UNIQ_BUILD}-${tool}"
20.81 + ln -sfv "`which ${tool}`" "${CT_PREFIX_DIR}/bin/${CT_HOST}-${tool}"
20.82 fi |CT_DoLog DEBUG
20.83 done
20.84
20.85 @@ -392,8 +399,10 @@
20.86 kernel_check_config \
20.87 kernel_headers \
20.88 binutils \
20.89 + cc_core_pass_1 \
20.90 libc_headers \
20.91 - cc_core \
20.92 + libc_start_files \
20.93 + cc_core_pass_2 \
20.94 libfloat \
20.95 libc \
20.96 cc \
21.1 --- a/scripts/functions Fri May 25 19:30:42 2007 +0000
21.2 +++ b/scripts/functions Sun May 27 20:22:06 2007 +0000
21.3 @@ -2,6 +2,7 @@
21.4 # Copyright 2007 Yann E. MORIN
21.5 # Licensed under the GPL v2. See COPYING in the root of this package
21.6
21.7 +# Prepare the fault handler
21.8 CT_OnError() {
21.9 ret=$?
21.10 CT_DoLog ERROR "Build failed in step \"${CT_STEP_MESSAGE[${CT_STEP_COUNT}]}\""
21.11 @@ -17,11 +18,23 @@
21.12 CT_DoEnd ERROR
21.13 exit $ret
21.14 }
21.15 +
21.16 +# Install the fault handler
21.17 trap CT_OnError ERR
21.18
21.19 +# Inherit the fault handler in subshells and functions
21.20 set -E
21.21 +
21.22 +# Make pipes fail on the _first_ failed command
21.23 +# Not supported on bash < 3.x, but we need it, so drop the obsoleting bash-2.x
21.24 set -o pipefail
21.25
21.26 +# Don't hash commands' locations, and search every time it is requested.
21.27 +# This is slow, but needed because of the static/shared core gcc which shall
21.28 +# always match to shared if it exists, and only fallback to static if the
21.29 +# shared is not found
21.30 +set +o hashall
21.31 +
21.32 # The different log levels:
21.33 CT_LOG_LEVEL_ERROR=0
21.34 CT_LOG_LEVEL_WARN=1
21.35 @@ -392,8 +405,16 @@
21.36 # a libc addon, or a plain package. Apply patches now.
21.37 CT_DoLog EXTRA "Patching \"${file}\""
21.38
21.39 - # If libc addon, we're already in the correct place.
21.40 - [ -z "${libc_addon}" ] && cd "${file}"
21.41 + if [ "${libc_addon}" = "y" ]; then
21.42 + # Some addons tarball directly contian the correct addon directory,
21.43 + # while others have the addon directory named ofter the tarball.
21.44 + # Fix that bu always using the short name (eg: linuxthreads, ports, etc...)
21.45 + addon_short_name=`echo "${file}" |sed -r -e 's/^[^-]+-//; s/-[^-]+$//;'`
21.46 + [ -d "${addon_short_name}" ] || ln -s "${file}" "${addon_short_name}"
21.47 + # If libc addon, we're already in the correct place
21.48 + else
21.49 + cd "${file}"
21.50 + fi
21.51
21.52 [ "${CUSTOM_PATCH_ONLY}" = "y" ] || official_patch_dir="${CT_TOP_DIR}/patches/${base_file}/${ver_file}"
21.53 [ "${CT_CUSTOM_PATCH}" = "y" ] && custom_patch_dir="${CT_CUSTOM_PATCH_DIR}/${base_file}/${ver_file}"
21.54 @@ -493,14 +514,19 @@
21.55 $0 == "}" { _p = 1; }
21.56 ' |egrep -v '^[^ ]+ \(\)' >"${state_dir}/env.sh"
21.57
21.58 - CT_DoLog DEBUG " Saving CT_CC_CORE_PREFIX_DIR=\"${CT_CC_CORE_PREFIX_DIR}\""
21.59 - CT_Pushd "${CT_CC_CORE_PREFIX_DIR}"
21.60 - tar ${tar_opt} "${state_dir}/cc_core_prefix_dir${tar_ext}" .
21.61 + CT_DoLog DEBUG " Saving CT_CC_CORE_STATIC_PREFIX_DIR=\"${CT_CC_CORE_STATIC_PREFIX_DIR}\""
21.62 + CT_Pushd "${CT_CC_CORE_STATIC_PREFIX_DIR}"
21.63 + tar ${tar_opt} "${state_dir}/cc_core_static_prefix_dir${tar_ext}" .
21.64 + CT_Popd
21.65 +
21.66 + CT_DoLog DEBUG " Saving CT_CC_CORE_SHARED_PREFIX_DIR=\"${CT_CC_CORE_SHARED_PREFIX_DIR}\""
21.67 + CT_Pushd "${CT_CC_CORE_SHARED_PREFIX_DIR}"
21.68 + tar ${tar_opt} "${state_dir}/cc_core_shared_prefix_dir${tar_ext}" .
21.69 CT_Popd
21.70
21.71 CT_DoLog DEBUG " Saving CT_PREFIX_DIR=\"${CT_PREFIX_DIR}\""
21.72 CT_Pushd "${CT_PREFIX_DIR}"
21.73 - tar ${tar_opt} "${state_dir}/prefix_dir${tar_ext}" .
21.74 + tar ${tar_opt} "${state_dir}/prefix_dir${tar_ext}" --exclude '*.log' .
21.75 CT_Popd
21.76
21.77 if [ "${CT_LOG_TO_FILE}" = "y" ]; then
21.78 @@ -514,7 +540,7 @@
21.79 fi
21.80 }
21.81
21.82 -# This functions restores a previously saved state
21.83 +# This function restores a previously saved state
21.84 # Usage: CT_DoLoadState <state_name>
21.85 CT_DoLoadState(){
21.86 local state_name="$1"
21.87 @@ -534,18 +560,23 @@
21.88 esac
21.89
21.90 CT_DoLog DEBUG " Removing previous build directories"
21.91 - chmod -R u+rwX "${CT_PREFIX_DIR}" "${CT_CC_CORE_PREFIX_DIR}"
21.92 - rm -rf "${CT_PREFIX_DIR}" "${CT_CC_CORE_PREFIX_DIR}"
21.93 - mkdir -p "${CT_PREFIX_DIR}" "${CT_CC_CORE_PREFIX_DIR}"
21.94 + chmod -R u+rwX "${CT_PREFIX_DIR}" "${CT_CC_CORE_SHARED_PREFIX_DIR}" "${CT_CC_CORE_STATIC_PREFIX_DIR}"
21.95 + rm -rf "${CT_PREFIX_DIR}" "${CT_CC_CORE_SHARED_PREFIX_DIR}" "${CT_CC_CORE_STATIC_PREFIX_DIR}"
21.96 + mkdir -p "${CT_PREFIX_DIR}" "${CT_CC_CORE_SHARED_PREFIX_DIR}" "${CT_CC_CORE_STATIC_PREFIX_DIR}"
21.97
21.98 CT_DoLog DEBUG " Restoring CT_PREFIX_DIR=\"${CT_PREFIX_DIR}\""
21.99 CT_Pushd "${CT_PREFIX_DIR}"
21.100 tar ${tar_opt} "${state_dir}/prefix_dir${tar_ext}"
21.101 CT_Popd
21.102
21.103 - CT_DoLog DEBUG " Restoring CT_CC_CORE_PREFIX_DIR=\"${CT_CC_CORE_PREFIX_DIR}\""
21.104 - CT_Pushd "${CT_CC_CORE_PREFIX_DIR}"
21.105 - tar ${tar_opt} "${state_dir}/cc_core_prefix_dir${tar_ext}"
21.106 + CT_DoLog DEBUG " Restoring CT_CC_CORE_SHARED_PREFIX_DIR=\"${CT_CC_CORE_SHARED_PREFIX_DIR}\""
21.107 + CT_Pushd "${CT_CC_CORE_SHARED_PREFIX_DIR}"
21.108 + tar ${tar_opt} "${state_dir}/cc_core_shared_prefix_dir${tar_ext}"
21.109 + CT_Popd
21.110 +
21.111 + CT_DoLog DEBUG " Restoring CT_CC_CORE_STATIC_PREFIX_DIR=\"${CT_CC_CORE_STATIC_PREFIX_DIR}\""
21.112 + CT_Pushd "${CT_CC_CORE_STATIC_PREFIX_DIR}"
21.113 + tar ${tar_opt} "${state_dir}/cc_core_static_prefix_dir${tar_ext}"
21.114 CT_Popd
21.115
21.116 # Restore the environment, discarding any error message