
Hi, Has anyone successfully used boost with the "new" apple gcc 4.2? I would like to since gcc42 has openmp, but I cant seem to be able to use boost. I compiled and installed boost with apple gcc 4.2 by directly using bjam with --toolset=darwin-4.2. When I try to use it I get an error (detailed output of gcc below) which hints towards problems with inline assembly. Actually, to get it compiled at all I had to set -fasm-blocks. Am I missing a flag of sorts? Or is it "just" another woe with apple's modified assembler? Daniel error message of gcc4.2 with boost::filesystem: In file included from /opt/boost-gcc4.2/include/boost-1_35/boost/detail/sp_counted_base.hpp:32, from /opt/boost-gcc4.2/include/boost-1_35/boost/detail/shared_count.hpp:29, from /opt/boost-gcc4.2/include/boost-1_35/boost/shared_ptr.hpp:28, from /opt/boost-gcc4.2/include/boost-1_35/boost/filesystem/path.hpp:19, from /opt/boost-gcc4.2/include/boost-1_35/boost/filesystem/operations.hpp:17, from /opt/boost-gcc4.2/include/boost-1_35/boost/filesystem.hpp:16, from mmm_fileloader.hpp:12, from mmm_tool_gui.hpp:5, from mmm_tool_gui.cpp:1: /opt/boost-gcc4.2/include/boost-1_35/boost/detail/sp_counted_base_gcc_x86.hpp: In function ‘int boost::detail::atomic_exchange_and_add(int*, int)’: /opt/boost-gcc4.2/include/boost-1_35/boost/detail/sp_counted_base_gcc_x86.hpp:46: error: expected `)' before ‘:’ token /opt/boost-gcc4.2/include/boost-1_35/boost/detail/sp_counted_base_gcc_x86.hpp: In function ‘void boost::detail::atomic_increment(int*)’: /opt/boost-gcc4.2/include/boost-1_35/boost/detail/sp_counted_base_gcc_x86.hpp:62: error: expected `)' before ‘:’ token /opt/boost-gcc4.2/include/boost-1_35/boost/detail/sp_counted_base_gcc_x86.hpp: In function ‘int boost::detail::atomic_conditional_increment(int*)’: /opt/boost-gcc4.2/include/boost-1_35/boost/detail/sp_counted_base_gcc_x86.hpp:88: error: expected `)' before ‘:’ token In file included from /opt/boost-gcc4.2/include/boost-1_35/boost/detail/sp_counted_base.hpp:32, from /opt/boost-gcc4.2/include/boost-1_35/boost/detail/shared_count.hpp:29, from /opt/boost-gcc4.2/include/boost-1_35/boost/shared_ptr.hpp:28, from /opt/boost-gcc4.2/include/boost-1_35/boost/filesystem/path.hpp:19, from /opt/boost-gcc4.2/include/boost-1_35/boost/filesystem/operations.hpp:17, from /opt/boost-gcc4.2/include/boost-1_35/boost/filesystem.hpp:16, from mmm_fileloader.hpp:12, from mmm_tool_gui.hpp:5, from mmm_tool_2.cpp:3: /opt/boost-gcc4.2/include/boost-1_35/boost/detail/sp_counted_base_gcc_x86.hpp: In function ‘int boost::detail::atomic_exchange_and_add(int*, int)’: /opt/boost-gcc4.2/include/boost-1_35/boost/detail/sp_counted_base_gcc_x86.hpp:46: error: expected `)' before ‘:’ token /opt/boost-gcc4.2/include/boost-1_35/boost/detail/sp_counted_base_gcc_x86.hpp: In function ‘void boost::detail::atomic_increment(int*)’: /opt/boost-gcc4.2/include/boost-1_35/boost/detail/sp_counted_base_gcc_x86.hpp:62: error: expected `)' before ‘:’ token /opt/boost-gcc4.2/include/boost-1_35/boost/detail/sp_counted_base_gcc_x86.hpp: In function ‘int boost::detail::atomic_conditional_increment(int*)’: /opt/boost-gcc4.2/include/boost-1_35/boost/detail/sp_counted_base_gcc_x86.hpp:88: error: expected `)' before ‘:’ token In file included from /opt/boost-gcc4.2/include/boost-1_35/boost/detail/sp_counted_base.hpp:32, from /opt/boost-gcc4.2/include/boost-1_35/boost/detail/shared_count.hpp:29, from /opt/boost-gcc4.2/include/boost-1_35/boost/shared_ptr.hpp:28, from /opt/boost-gcc4.2/include/boost-1_35/boost/archive/shared_ptr_helper.hpp:23, from /opt/boost-gcc4.2/include/boost-1_35/boost/archive/polymorphic_iarchive.hpp:161, from mmm_tool_net.hpp:8, from mmm_tool_net.cpp:1: /opt/boost-gcc4.2/include/boost-1_35/boost/detail/sp_counted_base_gcc_x86.hpp: In function ‘int boost::detail::atomic_exchange_and_add(int*, int)’: /opt/boost-gcc4.2/include/boost-1_35/boost/detail/sp_counted_base_gcc_x86.hpp:46: error: expected `)' before ‘:’ token /opt/boost-gcc4.2/include/boost-1_35/boost/detail/sp_counted_base_gcc_x86.hpp: In function ‘void boost::detail::atomic_increment(int*)’: /opt/boost-gcc4.2/include/boost-1_35/boost/detail/sp_counted_base_gcc_x86.hpp:62: error: expected `)' before ‘:’ token /opt/boost-gcc4.2/include/boost-1_35/boost/detail/sp_counted_base_gcc_x86.hpp: In function ‘int boost::detail::atomic_conditional_increment(int*)’: /opt/boost-gcc4.2/include/boost-1_35/boost/detail/sp_counted_base_gcc_x86.hpp:88: error: expected `)' before ‘:’ token

Daniel Oberhoff:
Hi,
Has anyone successfully used boost with the "new" apple gcc 4.2? I would like to since gcc42 has openmp, but I cant seem to be able to use boost. I compiled and installed boost with apple gcc 4.2 by directly using bjam with --toolset=darwin-4.2. When I try to use it I get an error (detailed output of gcc below) which hints towards problems with inline assembly. Actually, to get it compiled at all I had to set -fasm-blocks. Am I missing a flag of sorts? Or is it "just" another woe with apple's modified assembler?
Is the new Apple GCC documented somewhere? I wasn't able to find anything related to a new assembler syntax or -fasm-blocks. Can you ask Apple to explain the issue? Stock g++ 4.2.x compiles the code, so the problem must be Apple-specific.

Am Tue, 29 Apr 2008 01:22:34 +0300 schrieb Peter Dimov:
Daniel Oberhoff:
Hi,
Has anyone successfully used boost with the "new" apple gcc 4.2? I would like to since gcc42 has openmp, but I cant seem to be able to use boost. I compiled and installed boost with apple gcc 4.2 by directly using bjam with --toolset=darwin-4.2. When I try to use it I get an error (detailed output of gcc below) which hints towards problems with inline assembly. Actually, to get it compiled at all I had to set -fasm-blocks. Am I missing a flag of sorts? Or is it "just" another woe with apple's modified assembler?
Is the new Apple GCC documented somewhere? I wasn't able to find anything related to a new assembler syntax or -fasm-blocks. Can you ask Apple to explain the issue? Stock g++ 4.2.x compiles the code, so the problem must be Apple-specific.
Well, it is open source. The current version is here: http://www.opensource.apple.com/darwinsource/DevToolsMar2008/gcc_42-5553/ and there is a changelog and all :).

On Mon, Apr 28, 2008 at 3:22 PM, Peter Dimov
Daniel Oberhoff:
Hi,
Has anyone successfully used boost with the "new" apple gcc 4.2? I would like to since gcc42 has openmp, but I cant seem to be able to use boost. I compiled and installed boost with apple gcc 4.2 by directly using bjam with --toolset=darwin-4.2. When I try to use it I get an error (detailed output of gcc below) which hints towards problems with inline assembly. Actually, to get it compiled at all I had to set -fasm-blocks. Am I missing a flag of sorts? Or is it "just" another woe with apple's modified assembler?
Is the new Apple GCC documented somewhere? I wasn't able to find anything related to a new assembler syntax or -fasm-blocks. Can you ask Apple to explain the issue? Stock g++ 4.2.x compiles the code, so the problem must be Apple-specific.
Ok, I've got a little bit more information on the Apple gcc 4.2 situation. Here is a snippet from an email dialog between a user and an apple compiler engineer: user appears below with with prefix ">>" apple compiler engineer appears below with with prefix ">"
Thank you very much for the detailed reply. Based on your information I deduce:
1) Using gcc 4.2 with 4.0 (c++) libraries is a supported configuration by Apple
Right.
I then conclude that the C++ ABI is fully compatible between 4.0 and 4.2
Right.
[snip, then user hypothesizes as to why there are problems with boost under gcc 4.2/libstdc++ 4.0 on current Apple systems]
This is the case because boost assumes that a 4.2 compiler implies 4.2 libraries in flies such as boost/detail/atomic_count_gcc.hpp:
#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) # include
#else # include #endif Yes, this is a bug or faulty assumption in boost.
[snip]
The 4.2 library issue is a bug in Boost, not a problem with our compiler. I'd suggest raising the issue on one of the boost mailing lists and see what they say.
Comments? Mat

Well, first, I think you prolly ought to be posting to the developers'
list, and second I think you need a tag in the subject like "atomic
count" so that the right people will look at it :-)
on Thu Jul 31 2008, "Mat Marcus"
On Mon, Apr 28, 2008 at 3:22 PM, Peter Dimov
wrote: Daniel Oberhoff:
Hi,
Has anyone successfully used boost with the "new" apple gcc 4.2? I would like to since gcc42 has openmp, but I cant seem to be able to use boost. I compiled and installed boost with apple gcc 4.2 by directly using bjam with --toolset=darwin-4.2. When I try to use it I get an error (detailed output of gcc below) which hints towards problems with inline assembly. Actually, to get it compiled at all I had to set -fasm-blocks. Am I missing a flag of sorts? Or is it "just" another woe with apple's modified assembler?
Is the new Apple GCC documented somewhere? I wasn't able to find anything related to a new assembler syntax or -fasm-blocks. Can you ask Apple to explain the issue? Stock g++ 4.2.x compiles the code, so the problem must be Apple-specific.
Ok, I've got a little bit more information on the Apple gcc 4.2 situation. Here is a snippet from an email dialog between a user and an apple compiler engineer:
user appears below with with prefix ">>" apple compiler engineer appears below with with prefix ">"
Thank you very much for the detailed reply. Based on your information I deduce:
1) Using gcc 4.2 with 4.0 (c++) libraries is a supported configuration by Apple
Right.
I then conclude that the C++ ABI is fully compatible between 4.0 and 4.2
Right.
[snip, then user hypothesizes as to why there are problems with boost under gcc 4.2/libstdc++ 4.0 on current Apple systems]
This is the case because boost assumes that a 4.2 compiler implies 4.2 libraries in flies such as boost/detail/atomic_count_gcc.hpp:
#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) # include
#else # include #endif Yes, this is a bug or faulty assumption in boost.
[snip]
The 4.2 library issue is a bug in Boost, not a problem with our compiler. I'd suggest raising the issue on one of the boost mailing lists and see what they say.
Comments? Mat _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- Dave Abrahams BoostPro Computing http://www.boostpro.com

Hi,
On Fri, Aug 1, 2008 at 2:50 AM, Mat Marcus
I then conclude that the C++ ABI is fully compatible between 4.0 and 4.2
Right.
[snip, then user hypothesizes as to why there are problems with boost under gcc 4.2/libstdc++ 4.0 on current Apple systems]
This is the case because boost assumes that a 4.2 compiler implies 4.2 libraries in flies such as boost/detail/atomic_count_gcc.hpp:
#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) # include
#else # include #endif Yes, this is a bug or faulty assumption in boost.
[snip]
The 4.2 library issue is a bug in Boost, not a problem with our compiler. I'd suggest raising the issue on one of the boost mailing lists and see what they say.
Comments? Mat
From Debian GNU/Linux ABI transition history, I found that gcc 3.0, 3.1, 3.2, 3.3 have C++ ABI compatibility (libstdc++5) and gcc > 3.4 also have C++ ABI compatibility (libstdc++6). (Of cource this may not apply on other OSs.)
Note that gcc major version don't jump simultaneously with C++ ABI update. Regards, -- Ryo IGARASHI rigarash@gmail.com

Daniel Oberhoff wrote:
Hi,
Has anyone successfully used boost with the "new" apple gcc 4.2? I would like to since gcc42 has openmp, but I cant seem to be able to use boost. I compiled and installed boost with apple gcc 4.2 by directly using bjam with --toolset=darwin-4.2. When I try to use it I get an error (detailed output of gcc below) which hints towards problems with inline assembly. Actually, to get it compiled at all I had to set -fasm-blocks. Am I missing a flag of sorts? Or is it "just" another woe with apple's modified assembler?
Daniel
error message of gcc4.2 with boost::filesystem:
In file included from /opt/boost-gcc4.2/include/boost-1_35/boost/detail/sp_counted_base.hpp:32,
from /opt/boost-gcc4.2/include/boost-1_35/boost/detail/shared_count.hpp:29, from /opt/boost-gcc4.2/include/boost-1_35/boost/shared_ptr.hpp:28, from /opt/boost-gcc4.2/include/boost-1_35/boost/filesystem/path.hpp:19, from /opt/boost-gcc4.2/include/boost-1_35/boost/filesystem/operations.hpp:17, from /opt/boost-gcc4.2/include/boost-1_35/boost/filesystem.hpp:16, from mmm_fileloader.hpp:12, from mmm_tool_gui.hpp:5, from mmm_tool_gui.cpp:1: /opt/boost-gcc4.2/include/boost-1_35/boost/detail/sp_counted_base_gcc_x86.hpp: In function ‘int boost::detail::atomic_exchange_and_add(int*, int)’: /opt/boost-gcc4.2/include/boost-1_35/boost/detail/sp_counted_base_gcc_x86.hpp:46: error: expected `)' before ‘:’ token /opt/boost-gcc4.2/include/boost-1_35/boost/detail/sp_counted_base_gcc_x86.hpp: In function ‘void boost::detail::atomic_increment(int*)’: /opt/boost-gcc4.2/include/boost-1_35/boost/detail/sp_counted_base_gcc_x86.hpp:62: error: expected `)' before ‘:’ token /opt/boost-gcc4.2/include/boost-1_35/boost/detail/sp_counted_base_gcc_x86.hpp: In function ‘int boost::detail::atomic_conditional_increment(int*)’: /opt/boost-gcc4.2/include/boost-1_35/boost/detail/sp_counted_base_gcc_x86.hpp:88: error: expected `)' before ‘:’ token In file included from /opt/boost-gcc4.2/include/boost-1_35/boost/detail/sp_counted_base.hpp:32,
from /opt/boost-gcc4.2/include/boost-1_35/boost/detail/shared_count.hpp:29, from /opt/boost-gcc4.2/include/boost-1_35/boost/shared_ptr.hpp:28, from /opt/boost-gcc4.2/include/boost-1_35/boost/filesystem/path.hpp:19, from /opt/boost-gcc4.2/include/boost-1_35/boost/filesystem/operations.hpp:17, from /opt/boost-gcc4.2/include/boost-1_35/boost/filesystem.hpp:16, from mmm_fileloader.hpp:12, from mmm_tool_gui.hpp:5, from mmm_tool_2.cpp:3: /opt/boost-gcc4.2/include/boost-1_35/boost/detail/sp_counted_base_gcc_x86.hpp: In function ‘int boost::detail::atomic_exchange_and_add(int*, int)’: /opt/boost-gcc4.2/include/boost-1_35/boost/detail/sp_counted_base_gcc_x86.hpp:46: error: expected `)' before ‘:’ token /opt/boost-gcc4.2/include/boost-1_35/boost/detail/sp_counted_base_gcc_x86.hpp: In function ‘void boost::detail::atomic_increment(int*)’: /opt/boost-gcc4.2/include/boost-1_35/boost/detail/sp_counted_base_gcc_x86.hpp:62: error: expected `)' before ‘:’ token /opt/boost-gcc4.2/include/boost-1_35/boost/detail/sp_counted_base_gcc_x86.hpp: In function ‘int boost::detail::atomic_conditional_increment(int*)’: /opt/boost-gcc4.2/include/boost-1_35/boost/detail/sp_counted_base_gcc_x86.hpp:88: error: expected `)' before ‘:’ token In file included from /opt/boost-gcc4.2/include/boost-1_35/boost/detail/sp_counted_base.hpp:32,
from /opt/boost-gcc4.2/include/boost-1_35/boost/detail/shared_count.hpp:29, from /opt/boost-gcc4.2/include/boost-1_35/boost/shared_ptr.hpp:28, from /opt/boost-gcc4.2/include/boost-1_35/boost/archive/shared_ptr_helper.hpp:23,
from /opt/boost-gcc4.2/include/boost-1_35/boost/archive/polymorphic_iarchive.hpp:161,
from mmm_tool_net.hpp:8, from mmm_tool_net.cpp:1: /opt/boost-gcc4.2/include/boost-1_35/boost/detail/sp_counted_base_gcc_x86.hpp: In function ‘int boost::detail::atomic_exchange_and_add(int*, int)’: /opt/boost-gcc4.2/include/boost-1_35/boost/detail/sp_counted_base_gcc_x86.hpp:46: error: expected `)' before ‘:’ token /opt/boost-gcc4.2/include/boost-1_35/boost/detail/sp_counted_base_gcc_x86.hpp: In function ‘void boost::detail::atomic_increment(int*)’: /opt/boost-gcc4.2/include/boost-1_35/boost/detail/sp_counted_base_gcc_x86.hpp:62: error: expected `)' before ‘:’ token /opt/boost-gcc4.2/include/boost-1_35/boost/detail/sp_counted_base_gcc_x86.hpp: In function ‘int boost::detail::atomic_conditional_increment(int*)’: /opt/boost-gcc4.2/include/boost-1_35/boost/detail/sp_counted_base_gcc_x86.hpp:88: error: expected `)' before ‘:’ token
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Hi, any progress on getting this work? I would also like to use gcc 4.2 :) BTW, adding --toolset=darwin-4.2 does not cause bjam to use gcc 4.2.. It still uses 4.0, so that's probably the reason why the OP managed to compile boost. -- Anders
participants (6)
-
Anders Wang Kristensen
-
Daniel Oberhoff
-
David Abrahams
-
Mat Marcus
-
Peter Dimov
-
Ryo IGARASHI