Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 298489 - dev-libs/boost-1.41.0-r3 does not compile with GCC 4.4 if altivec is enabled
Summary: dev-libs/boost-1.41.0-r3 does not compile with GCC 4.4 if altivec is enabled
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: PPC Linux
: High normal (vote)
Assignee: Dirkjan Ochtman (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-26 23:44 UTC by cyrillic
Modified: 2010-03-07 07:52 UTC (History)
7 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build log (build.log,13.03 KB, text/plain)
2009-12-26 23:44 UTC, cyrillic
Details
emerge --info (emerge.info,2.61 KB, text/plain)
2009-12-26 23:45 UTC, cyrillic
Details

Note You need to log in before you can comment on or make changes to this bug.
Description cyrillic 2009-12-26 23:44:13 UTC
dev-libs/boost claims to support altivec instructions, but fails when trying to compile with them.


Reproducible: Always

Steps to Reproduce:
1. emerge dev-libs/boost
  (all recent versions appear to have the same problem)

Actual Results:  
ERROR: dev-libs/boost-1.41.0-r3 failed:
  building boost failed


Expected Results:  
Successful merge


If I change CFLAGS to "-O2 -mcpu=G4 -mno-altivec -pipe" then dev-libs/boost compiles properly, but I would prefer to be able to take full advantage of my CPU's instruction set.
Comment 1 cyrillic 2009-12-26 23:44:56 UTC
Created attachment 214243 [details]
build log
Comment 2 cyrillic 2009-12-26 23:45:21 UTC
Created attachment 214244 [details]
emerge --info
Comment 3 Sebastian Luther (few) 2010-01-01 18:36:31 UTC
Does it work with gcc-4.3?
Comment 4 cyrillic 2010-01-05 21:06:19 UTC
Good call.
I installed gcc-4.3.4 and now boost compiles with altivec enabled.

So I guess this is one of those gcc-4.4 migration bugs, eh ?
Comment 5 Sebastian Luther (few) 2010-01-10 14:44:42 UTC
@toolchain and ppc: According to upstream, the program below does not compile on gentoo with gcc-4.4, but compiles on gentoo with gcc-4.3 and compiles on any other distribution with gcc-4.4. Could you please investigate?

##################################
#include<vector>
int main() { return 0; }
##################################
g++ -maltivec <source file>

Comment 6 SpanKY gentoo-dev 2010-01-10 21:45:13 UTC
it isnt a Gentoo issue -- the same build failure can be observed on Debian.  gcc's altivec added more reserved keywords, so boost needs fixing.

i'm not sure who said that test code fails on Gentoo because it doesnt.
Comment 7 Andrew John Hughes 2010-02-11 19:34:11 UTC
I can confirm this:

    "powerpc-unknown-linux-gnu-g++" -x c++-header -O2 -mtune=G5 -mcpu=G5 -mabi=altivec -pipe -ggdb -fno-strict-aliasing -finline-functions -Wno-inline -Wall -fPIC  -DBOOST_ALL_NO_LIB=1 -DBOOST_BUILD_PCH_ENABLED -DBOOST_MATH_TR1_DYN_LINK=1 -DNDEBUG -I"." -I"libs/math/src/tr1" -c -o "bin.v2/libs/math/build/gcc-4.4/gentoorelease/../src/tr1/pch.hpp.gch" "libs/math/build/../src/tr1/pch.hpp"
<output elided>
./boost/fusion/container/vector/detail/deref_impl.hpp:29: error: declaration does not declare anything
./boost/fusion/container/vector/detail/deref_impl.hpp:32: error: template argument 1 is invalid
./boost/fusion/container/vector/detail/deref_impl.hpp:33: error: ‘element’ in namespace ‘boost::mpl’ does not name a type
./boost/fusion/container/vector/detail/deref_impl.hpp:33: warning: ‘typedef’ was ignored in this declaration
./boost/fusion/container/vector/detail/deref_impl.hpp:37: error: type/value mismatch at argument 1 in template parameter list for ‘template<class T> struct boost::is_const’
./boost/fusion/container/vector/detail/deref_impl.hpp:37: error:   expected a type, got ‘vector’
./boost/fusion/container/vector/detail/deref_impl.hpp:38: error: ‘element’ was not declared in this scope
./boost/fusion/container/vector/detail/deref_impl.hpp:38: error: template argument 1 is invalid
./boost/fusion/container/vector/detail/deref_impl.hpp:39: error: ‘element’ was not declared in this scope
./boost/fusion/container/vector/detail/deref_impl.hpp:39: error: template argument 1 is invalid
./boost/fusion/container/vector/detail/deref_impl.hpp:40: error: template argument 1 is invalid
./boost/fusion/container/vector/detail/deref_impl.hpp:40: error: template argument 2 is invalid
./boost/fusion/container/vector/detail/deref_impl.hpp:40: error: template argument 3 is invalid
<output elided>
...failed updating 1 target...

Adding -mno-altivec to the end of CFLAGS and CXXFLAGS makes the build complete.  This should be done in the ebuild as a workaround until the underlying bug is fixed.
Comment 8 Andrew John Hughes 2010-02-11 19:34:44 UTC
# gcc --version
gcc (Gentoo 4.4.3 p1.0) 4.4.3
Comment 9 cyrillic 2010-02-21 21:45:44 UTC
I just tried boost-1.42 and the same problem is still present, so I guess upstream has not fixed the gcc-4.4 compatibility issue yet.
Comment 10 Dirkjan Ochtman (RETIRED) gentoo-dev 2010-03-03 12:21:54 UTC
This should be fixed in the latest boost-1.41.0-r3.
Comment 11 cyrillic 2010-03-07 00:23:51 UTC
Adding -mno-altivec to the ebuild allows boost to compile, but is really suboptimal as far as fixing the problem goes.
Comment 12 Sebastian Luther (few) 2010-03-07 07:52:53 UTC
(In reply to comment #11)
> Adding -mno-altivec to the ebuild allows boost to compile, but is really
> suboptimal as far as fixing the problem goes.
> 

Sure, but there is nothing we can do about. That's upstream's problem and they know it.