Add katest Linux kernel versions: 2.6.27.22, 2.6.28.10 and 2.6.29.2.
-------- diffstat follows --------
/trunk/config/kernel/linux.in | 16 13 3 0 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
1 # This file adds the function to build the gcc C compiler
2 # Copyright 2007 Yann E. MORIN
3 # Licensed under the GPL v2. See COPYING in the root of this package
7 local version="${CT_CC_VERSION}${CT_CC_GCC_4_4_snapshot_date}"
9 # Ah! gcc folks are kind of 'different': they store the tarballs in
10 # subdirectories of the same name! That's because gcc is such /crap/ that
11 # it is such /big/ that it needs being splitted for distribution! Sad. :-(
12 # Arrgghh! Some of those versions does not follow this convention:
13 # gcc-3.3.3 lives in releases/gcc-3.3.3, while gcc-2.95.* isn't in a
14 # subdirectory! You bastard!
15 CT_GetFile "gcc-${version}" \
16 {ftp,http}://ftp.gnu.org/gnu/gcc{,{,/releases}/gcc-${version}} \
17 ftp://ftp.irisa.fr/pub/mirrors/gcc.gnu.org/gcc/releases/gcc-${version} \
18 ftp://ftp.uvsq.fr/pub/gcc/snapshots/${version}
20 # Starting with GCC 4.3, ecj is used for Java, and will only be
21 # built if the configure script finds ecj.jar at the top of the
22 # GCC source tree, which will not be there unless we get it and
23 # put it there ourselves
24 if [ "${CT_CC_LANG_JAVA_USE_ECJ}" = "y" ]; then
25 CT_GetFile ecj-latest .jar ftp://gcc.gnu.org/pub/java \
26 ftp://sourceware.org/pub/java
32 local version="${CT_CC_VERSION}${CT_CC_GCC_4_4_snapshot_date}"
34 CT_Extract "gcc-${version}"
35 CT_Patch "gcc-${version}"
37 # Copy ecj-latest.jar to ecj.jar at the top of the GCC source tree
38 if [ "${CT_CC_LANG_JAVA_USE_ECJ}" = "y" \
39 -a ! -f "${CT_SRC_DIR}/gcc-${version}/ecj.jar" \
41 CT_DoExecLog ALL cp -v "${CT_TARBALLS_DIR}/ecj-latest.jar" "${CT_SRC_DIR}/gcc-${version}/ecj.jar"
45 #------------------------------------------------------------------------------
48 # If we're building for bare metal, build the static core gcc,
50 # In case we're not bare metal, and we're NPTL, build the static core gcc.
51 # In any other case, do nothing.
52 case "${CT_BARE_METAL},${CT_THREADS}" in
53 y,*) do_cc_core mode=baremetal build_libgcc=yes;;
54 ,nptl) do_cc_core mode=static build_libgcc=no;;
61 # In case we're building for bare metal, do nothing, we already have
63 # In case we're NPTL, build the shared core gcc and the target libgcc.
64 # In any other case, build the static core gcc and, if using gcc-4.3+,
65 # also build the target libgcc.
66 case "${CT_BARE_METAL},${CT_THREADS}" in
69 do_cc_core mode=shared build_libgcc=yes
71 *) if [ "${CT_CC_GCC_4_3_or_later}" = "y" ]; then
72 do_cc_core mode=static build_libgcc=yes
74 do_cc_core mode=static build_libgcc=no
80 #------------------------------------------------------------------------------
82 # This function is used to build both the static and the shared core C conpiler,
83 # with or without the target libgcc. We need to know wether:
84 # - we're building static, shared or bare metal: mode=[static|shared|baremetal]
85 # - we need to build libgcc or not : build_libgcc=[yes|no]
86 # Usage: do_cc_core_static mode=[static|shared|baremetal] build_libgcc=[yes|no]
93 local version="${CT_CC_VERSION}${CT_CC_GCC_4_4_snapshot_date}"
97 CT_TestOrAbort "Internal Error: 'mode' must either 'static', 'shared' or 'baremetal', not '${mode:-(empty)}'" "${mode}" = "static" -o "${mode}" = "shared" -o "${mode}" = "baremetal"
98 CT_TestOrAbort "Internal Error: 'build_libgcc' must be either 'yes' or 'no', not '${build_libgcc:-(empty)}'" "${build_libgcc}" = "yes" -o "${build_libgcc}" = "no"
99 # In normal conditions, ( "${mode}" = "shared" ) implies
100 # ( "${build_libgcc}" = "yes" ), but I won't check for that
102 CT_DoStep INFO "Installing ${mode} core C compiler"
103 mkdir -p "${CT_BUILD_DIR}/build-cc-core-${mode}"
104 cd "${CT_BUILD_DIR}/build-cc-core-${mode}"
109 core_prefix_dir="${CT_CC_CORE_STATIC_PREFIX_DIR}"
110 extra_config="${extra_config} --with-newlib --enable-threads=no --disable-shared"
114 core_prefix_dir="${CT_CC_CORE_SHARED_PREFIX_DIR}"
115 extra_config="${extra_config} --enable-shared"
119 core_prefix_dir="${CT_PREFIX_DIR}"
120 extra_config="${extra_config} --with-newlib --enable-threads=no --disable-shared"
121 [ "${CT_CC_LANG_CXX}" = "y" ] && lang_opt="${lang_opt},c++"
126 if [ "${copy_headers}" = "y" ]; then
127 CT_DoLog DEBUG "Copying headers to install area of bootstrap gcc, so it can build libgcc2"
128 CT_DoExecLog ALL mkdir -p "${core_prefix_dir}/${CT_TARGET}/include"
129 CT_DoExecLog ALL cp -r "${CT_HEADERS_DIR}"/* "${core_prefix_dir}/${CT_TARGET}/include"
132 CT_DoLog EXTRA "Configuring ${mode} core C compiler"
134 extra_config="${extra_config} ${CT_ARCH_WITH_ARCH}"
135 extra_config="${extra_config} ${CT_ARCH_WITH_ABI}"
136 extra_config="${extra_config} ${CT_ARCH_WITH_CPU}"
137 extra_config="${extra_config} ${CT_ARCH_WITH_TUNE}"
138 extra_config="${extra_config} ${CT_ARCH_WITH_FPU}"
139 extra_config="${extra_config} ${CT_ARCH_WITH_FLOAT}"
140 [ "${CT_GMP_MPFR}" = "y" ] && extra_config="${extra_config} --with-gmp=${CT_PREFIX_DIR} --with-mpfr=${CT_PREFIX_DIR}"
141 if [ "${CT_CC_CXA_ATEXIT}" = "y" ]; then
142 extra_config="${extra_config} --enable-__cxa_atexit"
144 extra_config="${extra_config} --disable-__cxa_atexit"
147 CT_DoLog DEBUG "Extra config passed: '${extra_config}'"
149 # Use --with-local-prefix so older gccs don't look in /usr/local (http://gcc.gnu.org/PR10532)
150 CC_FOR_BUILD="${CT_BUILD}-gcc" \
151 CFLAGS="${CT_CFLAGS_FOR_HOST}" \
153 "${CT_SRC_DIR}/gcc-${version}/configure" \
154 --build=${CT_BUILD} \
156 --target=${CT_TARGET} \
157 --prefix="${core_prefix_dir}" \
158 --with-local-prefix="${CT_SYSROOT_DIR}" \
160 ${CC_CORE_SYSROOT_ARG} \
163 --enable-symvers=gnu \
164 --enable-languages="${lang_opt}" \
165 --enable-target-optspace \
166 ${CT_CC_CORE_EXTRA_CONFIG}
168 if [ "${build_libgcc}" = "yes" ]; then
169 # HACK: we need to override SHLIB_LC from gcc/config/t-slibgcc-elf-ver or
170 # gcc/config/t-libunwind so -lc is removed from the link for
171 # libgcc_s.so, as we do not have a target -lc yet.
172 # This is not as ugly as it appears to be ;-) All symbols get resolved
173 # during the glibc build, and we provide a proper libgcc_s.so for the
174 # cross toolchain during the final gcc build.
176 # As we cannot modify the source tree, nor override SHLIB_LC itself
177 # during configure or make, we have to edit the resultant
178 # gcc/libgcc.mk itself to remove -lc from the link.
179 # This causes us to have to jump through some hoops...
181 # To produce libgcc.mk to edit we firstly require libiberty.a,
182 # so we configure then build it.
183 # Next we have to configure gcc, create libgcc.mk then edit it...
184 # So much easier if we just edit the source tree, but hey...
185 if [ ! -f "${CT_SRC_DIR}/gcc-${version}/gcc/BASE-VER" ]; then
186 CT_DoExecLog ALL make configure-libiberty
187 CT_DoExecLog ALL make ${PARALLELMFLAGS} -C libiberty libiberty.a
188 CT_DoExecLog ALL make configure-gcc configure-libcpp
189 CT_DoExecLog ALL make ${PARALLELMFLAGS} all-libcpp
191 CT_DoExecLog ALL make configure-gcc configure-libcpp configure-build-libiberty
192 CT_DoExecLog ALL make ${PARALLELMFLAGS} all-libcpp all-build-libiberty
194 # HACK: gcc-4.2 uses libdecnumber to build libgcc.mk, so build it here.
195 if [ -d "${CT_SRC_DIR}/gcc-${version}/libdecnumber" ]; then
196 CT_DoExecLog ALL make configure-libdecnumber
197 CT_DoExecLog ALL make ${PARALLELMFLAGS} -C libdecnumber libdecnumber.a
200 # Starting with GCC 4.3, libgcc.mk is no longer built,
201 # and libgcc.mvars is used instead.
203 if [ "${CT_CC_GCC_4_3_or_later}" = "y" ]; then
204 libgcc_rule="libgcc.mvars"
205 build_rules="all-gcc all-target-libgcc"
206 install_rules="install-gcc install-target-libgcc"
208 libgcc_rule="libgcc.mk"
209 build_rules="all-gcc"
210 install_rules="install-gcc"
213 CT_DoExecLog ALL make ${PARALLELMFLAGS} -C gcc ${libgcc_rule}
214 sed -r -i -e 's@-lc@@g' gcc/${libgcc_rule}
216 build_rules="all-gcc"
217 install_rules="install-gcc"
220 if [ "${CT_CANADIAN}" = "y" ]; then
221 CT_DoLog EXTRA "Building libiberty"
222 CT_DoExecLog ALL make ${PARALLELMFLAGS} all-build-libiberty
225 CT_DoLog EXTRA "Building ${mode} core C compiler"
226 CT_DoExecLog ALL make ${PARALLELMFLAGS} ${build_rules}
228 CT_DoLog EXTRA "Installing ${mode} core C compiler"
229 CT_DoExecLog ALL make ${install_rules}
231 # Create a symlink ${CT_TARGET}-cc to ${CT_TARGET}-gcc to always be able
232 # to call the C compiler with the same, somewhat canonical name.
233 CT_DoExecLog ALL ln -sv "${CT_TARGET}"-gcc "${core_prefix_dir}/bin/${CT_TARGET}"-cc
238 #------------------------------------------------------------------------------
241 local version="${CT_CC_VERSION}${CT_CC_GCC_4_4_snapshot_date}"
243 # If building for bare metal, nothing to be done here, the static core conpiler is enough!
244 [ "${CT_BARE_METAL}" = "y" ] && return 0
246 CT_DoStep INFO "Installing final compiler"
248 mkdir -p "${CT_BUILD_DIR}/build-cc"
249 cd "${CT_BUILD_DIR}/build-cc"
251 CT_DoLog EXTRA "Configuring final compiler"
253 # Enable selected languages
255 [ "${CT_CC_LANG_CXX}" = "y" ] && lang_opt="${lang_opt},c++"
256 [ "${CT_CC_LANG_FORTRAN}" = "y" ] && lang_opt="${lang_opt},fortran"
257 [ "${CT_CC_LANG_ADA}" = "y" ] && lang_opt="${lang_opt},ada"
258 [ "${CT_CC_LANG_JAVA}" = "y" ] && lang_opt="${lang_opt},java"
259 [ "${CT_CC_LANG_OBJC}" = "y" ] && lang_opt="${lang_opt},objc"
260 [ "${CT_CC_LANG_OBJCXX}" = "y" ] && lang_opt="${lang_opt},obj-c++"
261 CT_Test "Building ADA language is not yet supported. Will try..." "${CT_CC_LANG_ADA}" = "y"
262 CT_Test "Building Objective-C language is not yet supported. Will try..." "${CT_CC_LANG_OBJC}" = "y"
263 CT_Test "Building Objective-C++ language is not yet supported. Will try..." "${CT_CC_LANG_OBJCXX}" = "y"
264 CT_Test "Building ${CT_CC_LANG_OTHERS//,/ } language(s) is not yet supported. Will try..." -n "${CT_CC_LANG_OTHERS}"
265 lang_opt=$(echo "${lang_opt},${CT_CC_LANG_OTHERS}" |sed -r -e 's/,+/,/g; s/,*$//;')
267 extra_config="--enable-languages=${lang_opt}"
268 extra_config="${extra_config} --disable-multilib"
269 extra_config="${extra_config} ${CT_ARCH_WITH_ARCH}"
270 extra_config="${extra_config} ${CT_ARCH_WITH_ABI}"
271 extra_config="${extra_config} ${CT_ARCH_WITH_CPU}"
272 extra_config="${extra_config} ${CT_ARCH_WITH_TUNE}"
273 extra_config="${extra_config} ${CT_ARCH_WITH_FPU}"
274 extra_config="${extra_config} ${CT_ARCH_WITH_FLOAT}"
275 [ "${CT_SHARED_LIBS}" = "y" ] || extra_config="${extra_config} --disable-shared"
276 [ "${CT_GMP_MPFR}" = "y" ] && extra_config="${extra_config} --with-gmp=${CT_PREFIX_DIR} --with-mpfr=${CT_PREFIX_DIR}"
277 [ -n "${CT_CC_PKGVERSION}" ] && extra_config="${extra_config} --with-pkgversion=${CT_CC_PKGVERSION}"
278 [ -n "${CT_CC_BUGURL}" ] && extra_config="${extra_config} --with-bugurl=${CT_CC_BUGURL}"
279 [ "${CT_CC_SJLJ_EXCEPTIONS_USE}" = "y" ] && extra_config="${extra_config} --enable-sjlj-exceptions"
280 [ "${CT_CC_SJLJ_EXCEPTIONS_DONT_USE}" = "y" ] && extra_config="${extra_config} --disable-sjlj-exceptions"
281 if [ "${CT_CC_CXA_ATEXIT}" = "y" ]; then
282 extra_config="${extra_config} --enable-__cxa_atexit"
284 extra_config="${extra_config} --disable-__cxa_atexit"
287 CT_DoLog DEBUG "Extra config passed: '${extra_config}'"
289 # --enable-symvers=gnu really only needed for sh4 to work around a
290 # detection problem only matters for gcc-3.2.x and later, I think.
291 # --disable-nls to work around crash bug on ppc405, but also because
292 # embedded systems don't really need message catalogs...
293 CC_FOR_BUILD="${CT_BUILD}-gcc" \
294 CFLAGS="${CT_CFLAGS_FOR_HOST}" \
295 CFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS}" \
296 CXXFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS}" \
297 LDFLAGS_FOR_TARGET="${CT_TARGET_LDFLAGS}" \
299 "${CT_SRC_DIR}/gcc-${version}/configure" \
300 --build=${CT_BUILD} \
302 --target=${CT_TARGET} \
303 --prefix="${CT_PREFIX_DIR}" \
306 --with-local-prefix="${CT_SYSROOT_DIR}" \
308 --enable-threads=posix \
309 --enable-symvers=gnu \
312 --enable-target-optspace \
313 ${CT_CC_EXTRA_CONFIG}
315 if [ "${CT_CANADIAN}" = "y" ]; then
316 CT_DoLog EXTRA "Building libiberty"
317 CT_DoExecLog ALL make ${PARALLELMFLAGS} all-build-libiberty
320 CT_DoLog EXTRA "Building final compiler"
321 CT_DoExecLog ALL make ${PARALLELMFLAGS} all
323 CT_DoLog EXTRA "Installing final compiler"
324 CT_DoExecLog ALL make install
326 # Create a symlink ${CT_TARGET}-cc to ${CT_TARGET}-gcc to always be able
327 # to call the C compiler with the same, somewhat canonical name.
328 CT_DoExecLog ALL ln -sv "${CT_TARGET}"-gcc "${CT_PREFIX_DIR}/bin/${CT_TARGET}"-cc