Crosstool Build Still Fails under Cygwin

Crifan Li admin@crifan.com
Thu Sep 5 14:48:00 GMT 2013


Hi Jeremy,
     About your said "Also, if it is possible to get it working, is 
there a way to resume from the point where the build failed? Since it 
took 10 hours to get there..."
several tricks to save time when build crosstool-ng:

in ct-ng menuconfig, to config like this:

1.use multiple thread compile
Paths and misc options
     (4) Number of parallel jobs

4 means 4 threads to compile crosstool-ng
about thread number:
"A good rule of thumb is twice the number of processors you have."
here my cpu is Intel two core, so use 4.

2.resume from fail step
Paths and misc options
     [*] Debug crosstool-NG
     [*]   Save intermediate steps

how to restore fail step, then continue build:
basic logic is:
ct-ng last_successful_step+
detail is :
(1) see existing steps

CLi@PC-CLI-1 ~/develop/crosstool-ng/crosstool-ng-1.18.0_build
$ ct-ng list-steps
Available build steps, in order:
   - libc_check_config
   - companion_libs_for_build
   - binutils_for_build
   - companion_libs_for_host
   - binutils_for_host
   - cc_core_pass_1
   - kernel_headers
   - libc_start_files
   - cc_core_pass_2
   - libc
   - cc_for_build
   - cc_for_host
   - libelf_for_target
   - binutils_for_target
   - debug
   - test_suite
   - finish
Use "<step>" as action to execute only that step.
Use "+<step>" as action to execute up to that step.
Use "<step>+" as action to execute from that step onward.

(2) when fail, let's say, on step cc_core_pass_1
so last successful step is: binutils_for_host
so, after you fix problem, then do:
ct-ng binutils_for_host+
so can restore binutils_for_host, then continue compile

3.use interactive shell when fail -> when error, can fix error then 
continue build

Paths and misc options
     [*] Debug crosstool-NG
     [*]   Interactive shell on failed commands

then:
when build fail, will show a interactive shell, like this:
......
[ERROR]  >>  Error happened in: CT_DoExecLog[scripts/functions@257]
[ERROR]  >>        called from: 
do_kernel_install[scripts/build/kernel/linux.sh@112]
[ERROR]  >>        called from: 
do_kernel_headers[scripts/build/kernel/linux.sh@91]
[ERROR]  >>        called from: main[scripts/crosstool-NG.sh@632]


Current command:
   'make' '-C' 
'/home/crifan/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/linux-custom' 
'O=/home/crifan/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-xscale-linux-gnueabi/build/build-kernel-headers' 
'ARCH=arm' 
'INSTALL_HDR_PATH=/home/crifan/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi/sysroot/usr' 
'V=0' 'headers_install'
exited with error code: 2
Please fix it up and finish by exiting the shell with one of these values:
     1  fixed, continue with next build command
     2  repeat this build command
     3  abort build

ct-ng:~/develop/crosstool-ng/crosstool-ng-1.18.0_build>

then, after you fix error,
let's say, vi to edit the xxx.c to fix some bug,
then do:
exit 2
to re-run the last fail command, to continue compile your xxx.c
then can go through, can continue build.


more detailed explain can refer my tutorial:
(note: written in Chinese, you can use google translate to english if 
necessary)
http://www.crifan.com/files/doc/docbook/crosstool_ng/release/htmls/crosstool_ng_config_para.html#multi_thread_save_time

http://www.crifan.com/files/doc/docbook/crosstool_ng/release/htmls/crosstool_ng_config_para.html#restore_from_fail_step

http://www.crifan.com/files/doc/docbook/crosstool_ng/release/htmls/crosstool_ng_config_para.html#error_but_not_exit

BR,
Crifan Li


-- 
Crifan Li
http://www.crifan.com/about/me/

Jeremy Cole-Baker <jeremy at rhtech dot co dot nz> wrote on Mon, 01 Jul 
2013 19:25:58 +1200:
> As mentioned in a previous message, I am trying (for complicated
> reasons) to build a PowerPC compiler to run under Cygwin.
>
> Previously, recent versions of Crosstool-NG wouldn't build at all on my
> system. Thanks to Albert Dorrington for linking this patch which allowed
> crosstools to build:
>
> http://sourceware.org/ml/crossgcc/2012-05/msg00012.html
>
> I ran 'ct-ng menuconfig' and set my target to be PowerPC, turned off
> debug facilities, and basically used defaults for everything else. I
> also used eglibc (I think it was already selected by default).
>
> However, running 'ct-ng build' still failed with an error. Here's the
> output:
>
>
> $ ct-ng build
> [INFO ]  Performing some trivial sanity checks
> [INFO ]  Build started 20130701.085943
> [INFO ]  Building environment variables
> [INFO ]  =================================================================
> [INFO ]  Retrieving needed toolchain components' tarballs
> [INFO ]  Retrieving needed toolchain components' tarballs: done in
> 1190.11s (at 20:24)
> [INFO ]  =================================================================
> [INFO ]  Extracting and patching toolchain components
> [32:18] / Useless use of /d modifier in transliteration operator at
> /usr/share/automake-1.9/Automake/Wrap.pm line 60.
> [INFO ]  Extracting and patching toolchain components: done in 2356.36s
> (at 59:41)
> [INFO ]  =================================================================
> [INFO ]  Installing kernel headers
> [INFO ]  Installing kernel headers: done in 359.98s (at 65:42)
> [INFO ]  =================================================================
> [INFO ]  Installing GMP
> [INFO ]  Installing GMP: done in 11400.93s (at 255:45)
> [INFO ]  =================================================================
> [INFO ]  Installing MPFR
> [INFO ]  Installing MPFR: done in 1567.16s (at 281:54)
> [INFO ]  =================================================================
> [INFO ]  Installing PPL
> [INFO ]  Installing PPL: done in 4307.71s (at 353:43)
> [INFO ]  =================================================================
> [INFO ]  Installing CLooG/ppl
> [INFO ]  Installing CLooG/ppl: done in 624.52s (at 364:10)
> [INFO ]  =================================================================
> [INFO ]  Installing binutils
> [INFO ]  Installing binutils: done in 6761.47s (at 476:53)
> [INFO ]  =================================================================
> [INFO ]  Installing static core C compiler
> [ERROR]
> /opt/powerpc-unknown-linux-gnu/.build/powerpc-unknown-linux-gnu/build/static/lib/libppl_c.a(ppl_c_implementation_common.o):ppl_c_implementation_common.cc:(.text+0x28e1):
> undefined reference to
> `std::length_error::length_error(std::basic_string<char,
> std::char_traits<char>, std::allocator<char> > const&)'
> [ERROR]
> /opt/powerpc-unknown-linux-gnu/.build/powerpc-unknown-linux-gnu/build/static/lib/libppl_c.a(ppl_c_implementation_common.o):ppl_c_implementation_common.cc:(.text+0x3472):
> undefined reference to
> `std::length_error::length_error(std::basic_string<char,
> std::char_traits<char>, std::allocator<char> > const&)'
> [ERROR]
> /opt/powerpc-unknown-linux-gnu/.build/powerpc-unknown-linux-gnu/build/static/lib/libppl_c.a(ppl_c_implementation_common.o):ppl_c_implementation_common.cc:(.text+0x3fa7):
> undefined reference to
> `std::length_error::length_error(std::basic_string<char,
> std::char_traits<char>, std::allocator<char> > const&)'
> [ERROR]
> /opt/powerpc-unknown-linux-gnu/.build/powerpc-unknown-linux-gnu/build/static/lib/libppl_c.a(ppl_c_implementation_common.o):ppl_c_implementation_common.cc:(.text+0x4a2a):
> undefined reference to
> `std::length_error::length_error(std::basic_string<char,
> std::char_traits<char>, std::allocator<char> > const&)'
> [ERROR]
> /opt/powerpc-unknown-linux-gnu/.build/powerpc-unknown-linux-gnu/build/static/lib/libppl_c.a(ppl_c_implementation_common.o):ppl_c_implementation_common.cc:(.text+0x4a93):
> undefined reference to
> `std::length_error::length_error(std::basic_string<char,
> std::char_traits<char>, std::allocator<char> > const&)'
> [ERROR]
> /opt/powerpc-unknown-linux-gnu/.build/powerpc-unknown-linux-gnu/build/static/lib/libppl_c.a(ppl_c_implementation_common.o):ppl_c_implementation_common.cc:(.text+0x5cc4):
> undefined reference to
> `std::length_error::length_error(std::basic_string<char,
> std::char_traits<char>, std::allocator<char> > const&)'
> [ERROR]
> /opt/powerpc-unknown-linux-gnu/.build/powerpc-unknown-linux-gnu/build/static/lib/libppl_c.a(ppl_c_implementation_common.o):ppl_c_implementation_common.cc:(.text+0x9164):
> undefined reference to
> `std::length_error::length_error(std::basic_string<char,
> std::char_traits<char>, std::allocator<char> > const&)'
> [ERROR]
> /opt/powerpc-unknown-linux-gnu/.build/powerpc-unknown-linux-gnu/build/static/lib/libppl_c.a(ppl_c_implementation_common.o):ppl_c_implementation_common.cc:(.text+0xc340):
> undefined reference to
> `std::length_error::length_error(std::basic_string<char,
> std::char_traits<char>, std::allocator<char> > const&)'
> [ERROR]
> /opt/powerpc-unknown-linux-gnu/.build/powerpc-unknown-linux-gnu/build/static/lib/libppl_c.a(ppl_c_implementation_common.o):ppl_c_implementation_common.cc:(.text+0xf271):
> undefined reference to
> `std::runtime_error::runtime_error(std::basic_string<char,
> std::char_traits<char>, std::allocator<char> > const&)'
> [ERROR]
> /opt/powerpc-unknown-linux-gnu/.build/powerpc-unknown-linux-gnu/build/static/lib/libppl_c.a(ppl_c_implementation_common.o):ppl_c_implementation_common.cc:(.text+0xf28a):
> undefined reference to `std::runtime_error::~runtime_error()'
> [ERROR]
> /opt/powerpc-unknown-linux-gnu/.build/powerpc-unknown-linux-gnu/build/static/lib/libppl_c.a(ppl_c_implementation_common.o):ppl_c_implementation_common.cc:(.text+0xf640):
> undefined reference to
> `std::length_error::length_error(std::basic_string<char,
> std::char_traits<char>, std::allocator<char> > const&)'
> [ERROR]    make[2]: *** [cc1-dummy.exe] Error 1
> [ERROR]    make[1]: *** [all-gcc] Error 2
> [ERROR]    Build failed in step 'Installing static core C compiler'
> [ERROR]    Error happened in
> '/usr/crosstool-ng/lib/ct-ng-1.9.3/scripts/functions' in function
> 'CT_DoExecLog' (line unknown, sorry)
> [ERROR]          called from
> '/usr/crosstool-ng/lib/ct-ng-1.9.3/scripts/build/cc/gcc.sh' at line #
> 289 in function 'do_cc_core'
> [ERROR]          called from
> '/usr/crosstool-ng/lib/ct-ng-1.9.3/scripts/build/cc/gcc.sh' at line # 52
> in function 'do_cc_core_pass_1'
> [ERROR]          called from
> '/usr/crosstool-ng/lib/ct-ng-1.9.3/scripts/crosstool-NG.sh' at line #
> 597 in function 'main'
> [ERROR]    Look at '/opt/x-tools/powerpc-unknown-linux-gnu/build.log'
> for more info on this error.
> [ERROR]  (elapsed: 605:57.99)
> [606:03] / /usr/crosstool-ng/bin/ct-ng:143: recipe for target `build' failed
> make: *** [build] Error 2
>
>
> Has anyone made this work under cygwin?
>
> Also, if it is possible to get it working, is there a way to resume from
> the point where the build failed? Since it took 10 hours to get there...
>
> Thanks!
> -Jeremy


--
For unsubscribe information see http://sourceware.org/lists.html#faq



More information about the crossgcc mailing list