My non-system GCC doesn't link programs under b2

I'm still using my 2002 PowerPC/G4 Mac with Mac OS X 10.4 (Tiger). I loaded GCC 4.6 (with multiprocessor options) onto it with MacPorts. I have a "user-config.jam" in my home folder like: //===using xsltproc : /opt/local/bin/xsltproc ; using boostbook : /opt/local/share/xsl/docbook-xsl/ : /opt/local/share/xml/docbook/4.2 ; using doxygen ; using darwin ;using gcc : 4.6 : g++-mp-4.6 : <cxxflags>-std=c++0x <cxxflags>-pthread ;//=== I've tested GCC-4.6 (with C++11 active) with a "Hello World!" program, so I know it works with single-file programs. I wanted to test "base_from_member" (part of Boost.Utility) and it worked with the default "darwin" target. (I ran "b2" in "BOOST_ROOT/libs/utility/test".) However, running "b2 toolset=gcc-4.6" ended in errors like: //===common.mkdir ../../../bin.v2/libs/utility/test/base_from_member_test.test/gcc-4.6common.mkdir ../../../bin.v2/libs/utility/test/base_from_member_test.test/gcc-4.6/debuggcc.compile.c++ ../../../bin.v2/libs/utility/test/base_from_member_test.test/gcc-4.6/debug/base_from_member_test.o../base_from_member_test.cpp: In constructor 'bad_class::bad_class()':../base_from_member_test.cpp:129:21: warning: 'bad_class::x_' will be initialized after [-Wreorder]../base_from_member_test.cpp:510:39: warning: base 'base_class' [-Wreorder]../base_from_member_test.cpp:507:1: warning: when initialized here [-Wreorder]gcc.link ../../../bin.v2/libs/utility/test/base_from_member_test.test/gcc-4.6/debug/base_from_member_test/usr/bin/ld: unknown flag: --start-groupcollect2: ld returned 1 exit status "g++-mp-4.6" -o "../../../bin.v2/libs/utility/test/base_from_member_test.test/gcc-4.6/debug/base_from_member_test" -Wl,--start-group "../../../bin.v2/libs/utility/test/base_from_member_test.test/gcc-4.6/debug/base_from_member_test.o" -Wl,-Bstatic -Wl,-Bdynamic -Wl,--end-group -g ...failed gcc.link ../../../bin.v2/libs/utility/test/base_from_member_test.test/gcc-4.6/debug/base_from_member_test......skipped <p../../../bin.v2/libs/utility/test/base_from_member_test.test/gcc-4.6/debug>base_from_member_test.run for lack of <p../../../bin.v2/libs/utility/test/base_from_member_test.test/gcc-4.6/debug>base_from_member_test......failed updating 20 targets......skipped 40 targets......updated 126 targets...//=== GCC-4.6 compiles each C++ file into an object file just fine. The problem happens when linking various object and library files into an executable; whichever linker gets called (the system linker?) chokes on a "--start-group" flag. When I first started writing this message, I thought the problem was GCC-4.6 being too new for the linker, but maybe we have to tweak something in our Jam files instead. (Could it be the fact I downloaded the multiprocessor variant of GCC-4.6?) BTW, how do I specify that I only want to try out the base_from_member test without trying to build all other tests in the directory? Daryle W.

Date: Wed, 25 Jan 2012 23:13:25 +0000 From: dnljms@gmail.com On 25 January 2012 23:09, Daryle Walker <darylew@hotmail.com> wrote:> >
using gcc : 4.6 : g++-mp-4.6 : <cxxflags>-std=c++0x <cxxflags>-pthread ;
You should use the darwin toolset. It works apart from some architecture flags which aren't supported by macports gcc.
I normally do use the darwin toolset, but it's very old (like my system). I'm deliberately not doing it here so I can test C++11 stuff.

Hi Daryle, On Friday, 27. January 2012 11:23:48 Daryle Walker wrote:
Date: Wed, 25 Jan 2012 23:13:25 +0000 From: dnljms@gmail.com On 25 January 2012 23:09, Daryle Walker <darylew@hotmail.com> wrote:> >
using gcc : 4.6 : g++-mp-4.6 : <cxxflags>-std=c++0x <cxxflags>-pthread ;
You should use the darwin toolset. It works apart from some architecture flags which aren't supported by macports gcc.
I normally do use the darwin toolset, but it's very old (like my system). I'm deliberately not doing it here so I can test C++11 stuff.
Well, you should use: using darwin : 4.6 : g++-mp-4.6 : <cxxflags>-std=c++0x <cxxflags>-pthread ; for the new gcc with the darwin toolchain (apple linker and whatnot)... Yours, Jürgen -- Dipl.-Math. Jürgen Hunold | IVE mbH Software-Entwickler | Lützerodestraße 10 Tel: +49 511 897668 33 | 30161 Hannover, Germany Fax: +49 511 897668 29 | http://www.ivembh.de juergen.hunold@ivembh.de | | Geschäftsführer: Sitz des Unternehmens: Hannover | Univ.-Prof. Dr.-Ing. Thomas Siefer Amtsgericht Hannover, HRB 56965 | PD Dr.-Ing. Alfons Radtke

on Fri Jan 27 2012, Juergen Hunold <juergen.hunold-AT-ivembh.de> wrote:
Hi Daryle,
On Friday, 27. January 2012 11:23:48 Daryle Walker wrote:
Date: Wed, 25 Jan 2012 23:13:25 +0000 From: dnljms@gmail.com On 25 January 2012 23:09, Daryle Walker <darylew@hotmail.com> wrote:> >
using gcc : 4.6 : g++-mp-4.6 : <cxxflags>-std=c++0x <cxxflags>-pthread ;
You should use the darwin toolset. It works apart from some architecture flags which aren't supported by macports gcc.
I normally do use the darwin toolset, but it's very old (like my system). I'm deliberately not doing it here so I can test C++11 stuff.
Well, you should use:
using darwin : 4.6 : g++-mp-4.6 : <cxxflags>-std=c++0x <cxxflags>-pthread ;
for the new gcc with the darwin toolchain (apple linker and whatnot)...
I suggest: using darwin : 4.7 : g++-mp-4.7 : <cxxflags>-std=c++11 <cxxflags>-pthread ; -- Dave Abrahams BoostPro Computing http://www.boostpro.com
participants (4)
-
Daniel James
-
Daryle Walker
-
Dave Abrahams
-
Juergen Hunold