Bug 815 - c++ project build with collect error appears again
Summary: c++ project build with collect error appears again
Status: RESOLVED FIXED
Alias: None
Product: Meta-yocto
Classification: Build System, Metadata & Runtime
Component: meta-yocto (show other bugs)
Version: 1.0
Hardware: x86 Multiple
: Medium critical
Target Milestone: 1.0 M4
Assignee: Lianhao Lu
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2011-03-07 01:13 UTC by liping Ke
Modified: 2011-03-10 22:02 UTC (History)
6 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: ---


Attachments
error log (151.58 KB, application/octet-stream)
2011-03-07 01:14 UTC, liping Ke
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description liping Ke 2011-03-07 01:13:30 UTC
After lianhao fix LDFLAGS --sysroot problem, I cross compile sudoku c++ sample project in my i686 32 bit machine (target i586), the collect error appears again,more details are in the attachment.

Kevin used to add --sysroot to solve the problem. But now the problem appears again with the tools installed by adt-installer [ipk packages].

Thanks & Regards,
criping


Making all in src
make[2]: Entering directory `/home/lke/Downloads/sudoku-savant-1.3/src'
i586-poky-linux-g++ -DHAVE_CONFIG_H -I. -I.. -DPACKAGE_DATA_DIR=\""/usr/local/share"\" -DPACKAGE_LOCALE_DIR=\""/usr/local/share/locale"\" -pthread -I/home/lke/test-yocto/x86/usr/include/gtk-2.0 -I/home/lke/test-yocto/x86/usr/lib/gtk-2.0/include -I/home/lke/test-yocto/x86/usr/include/atk-1.0 -I/home/lke/test-yocto/x86/usr/include/cairo -I/home/lke/test-yocto/x86/usr/include/gdk-pixbuf-2.0 -I/home/lke/test-yocto/x86/usr/include/pango-1.0 -I/home/lke/test-yocto/x86/usr/include/glib-2.0 -I/home/lke/test-yocto/x86/usr/lib/glib-2.0/include -I/home/lke/test-yocto/x86/usr/include/pixman-1 -I/home/lke/test-yocto/x86/usr/include/freetype2 -I/home/lke/test-yocto/x86/usr/include/libpng12     -frepo -fno-implement-inlines -ansi -pedantic -pipe -Wall -Winline -Wshadow -Wsign-compare -Woverloaded-virtual -Wextra --param max-inline-insns-single=400 -march=i586 --sysroot=/home/lke/test-yocto/x86 -MT workset.o -MD -MP -MF .deps/workset.Tpo -c -o workset.o workset.cpp
mv -f .deps/workset.Tpo .deps/workset.Po
i586-poky-linux-g++ -frepo -fno-implement-inlines -ansi -pedantic -pipe -Wall -Winline -Wshadow -Wsign-compare -Woverloaded-virtual -Wextra --param max-inline-insns-single=400 -march=i586 --sysroot=/home/lke/test-yocto/x86 -Wl,-O -Wl,-zcombreloc -Wl,--sort-common -Wl,-znoexecstack -Wl,-zrelro  -o sudoku-savant main.o utils.o loader.o strip_leading.o strip_trailing.o date.o document.o note.o widget.o canvas.o window.o component.o numberpad.o toolbar.o filedialog.o geodialog.o strategydialog.o statusbar.o label.o textlog.o solutionlog.o bitmask.o validate.o geometry.o square.o sequence.o solution.o displaygrid.o board.o puzzle.o strategy.o completesequences.o crosssequences.o singleseqstrategy.o subsetstrategy.o hiddensubsets.o nakedsubsets.o multiseqstrategy.o multiseqpatterns.o xywings.o xyzwings.o colouring.o freedom.o workset.o selector.o generator.o aboutbox.o support.o interface.o -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lm -lcairo -lpng12 -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0    
collect: recompiling workset.cpp
workset.cpp:1:21: fatal error: algorithm: No such file or directory
compilation terminated.
main.o: In function `main':
main.cpp:(.text+0x3b0): undefined reference to `std::fpos<__mbstate_t>::operator long long() const'
utils.o: In function `sudoku::uppercase(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)':
utils.cpp:(.text+0x1ab): undefined reference to `__gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > std::transform<__gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, int (*)(int)>(__gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, int (*)(int))'
loader.o: In function `sudoku::load(sudoku::Board&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
loader.cpp:(.text+0xea): undefined reference to `std::list<sudoku::Square, std::allocator<sudoku::Square> >::begin()'
loader.cpp:(.text+0x152): undefined reference to `std::_List_iterator<sudoku::Square>::operator*() const'
loader.cpp:(.text+0x171): undefined reference to `std::_List_iterator<sudoku::Square>::operator++()'
loader.cpp:(.text+0x18f): undefined reference to `std::list<sudoku::Square, std::allocator<sudoku::Square> >::end()'
loader.cpp:(.text+0x1a2): undefined reference to `std::_List_iterator<sudoku::Square>::operator!=(std::_List_iterator<sudoku::Square> const&) const'
loader.o: In function `sudoku::Board::size() const':
Comment 1 liping Ke 2011-03-07 01:14:23 UTC
Created attachment 107 [details]
error log

error log for the sudoku make error
Comment 2 liping Ke 2011-03-07 17:08:13 UTC
Additional info:
this problem exists on all sorts platform combinations
i686-host for i586 target
x86-64 host for arm target.

criping
Comment 3 Lianhao Lu 2011-03-08 18:33:34 UTC
Kevin's previous commit f13cb20ed19c41b9ff85ef1c9ec0883a21d1d5bf should have fixed this issue. Need more dive into this problem
Comment 5 Kevin Tian 2011-03-08 18:46:01 UTC
I don't think this has been fixed. The commit that Lianhao refered to fix most of the c++ header problem, however there's still one remaining error about collect2. collect2 is a separate program (a superset of 'ld'), which is invoked to reconstruct the templates and then may recompile some c++ source files. gcc passes its compilation flags to collect2 by COLLECT_GCC_OPTIONS, which is further passed to gcc by collect2 later. However so far COLLECT_GCC_OPTIONS doesn't forward pass "--sysroot". that's the problem.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47256 is the bug I reported to gcc community, however it looks that nobody looks into it.

Lianhao, could you try baking a patch around COLLECT_GCC_OPTIONS by adding sysroot support?
Comment 6 Lianhao Lu 2011-03-09 22:30:21 UTC
The commit is sent out for review(not merged yet):

http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=llu/gcc_collect&id=6a1fe90d5a43e3260098dc90b8d467a1ba7d6335