Bug 781859 - Boost + gcc-4.7 is causing build failures
Summary: Boost + gcc-4.7 is causing build failures
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: boost
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Petr Machata
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 754865
TreeView+ depends on / blocked
 
Reported: 2012-01-15 18:34 UTC by Hans de Goede
Modified: 2015-05-05 01:36 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-01-16 23:12:57 UTC
Type: ---


Attachments (Terms of Use)
Compilation fix (622 bytes, patch)
2012-01-16 14:52 UTC, Petr Machata
no flags Details | Diff
Boost fix (696 bytes, patch)
2012-01-16 15:08 UTC, Petr Machata
no flags Details | Diff
Boost fix (10.34 KB, patch)
2012-01-16 22:03 UTC, Petr Machata
no flags Details | Diff

Description Hans de Goede 2012-01-15 18:34:47 UTC
Description of problem:

/usr/include/boost/random/detail/integer_log2.hpp:39:5: error: 'always_inline' was not declared in this scope
/usr/include/boost/random/detail/integer_log2.hpp:39:5: error: expected ')' before 'inline'
/usr/include/boost/random/detail/integer_log2.hpp:39:5: error: expected ')' before 'inline'
/usr/include/boost/random/detail/integer_log2.hpp:39:5: error: expected unqualified-id before ')' token
/usr/include/boost/random/detail/integer_log2.hpp:51:5: error: 'always_inline' was not declared in this scope
/usr/include/boost/random/detail/integer_log2.hpp:51:5: error: expected ')' before 'inline'
/usr/include/boost/random/detail/integer_log2.hpp:51:5: error: expected ')' before 'inline'
/usr/include/boost/random/detail/integer_log2.hpp:51:5: error: expected unqualified-id before ')' token
/usr/include/boost/random/detail/integer_log2.hpp:58:1: error: 'always_inline' was not declared in this scope
/usr/include/boost/random/detail/integer_log2.hpp:58:1: error: expected ')' before 'inline'
/usr/include/boost/random/detail/integer_log2.hpp:58:1: error: expected ')' before 'inline'
/usr/include/boost/random/detail/integer_log2.hpp:58:1: error: expected unqualified-id before ')' token

Also see:
http://koji.fedoraproject.org/koji/getfile?taskID=3697161&name=build.log

Comment 1 Petr Machata 2012-01-16 14:52:46 UTC
Created attachment 555525 [details]
Compilation fix

The problem is that OpenLieroX/src/gusanos/blitters/mmx.h defines a macro always_inline.  This gets expanded inside __attribute__((always_inline)) that boost random uses, resulting in expansions like:

    template<class T> __attribute__((const))
    __attribute__((__attribute__((always_inline)) inline))
    inline static int apply(T t, int accum, int update = 0) /* ... */

GCC barfs on that.  I grepped through the sources and it doesn't seem that the value of always_inline macro is not used anywhere in the source, apart from that definition.  (Unless the expansion is cleverly masked somewhere.)  So the easiest fix seems to be to just drop the definition.  That's what's in this patch.  Liero compiles successfully with this patch applied.

Comment 2 Petr Machata 2012-01-16 15:08:48 UTC
Created attachment 555527 [details]
Boost fix

In any case, on boost side, I think it would be prudent to name the attribute with the underscores, __attribute__((__always_inline__)), instead of the bare thing.  This way, we would avoid clashes with user-defined attributes.

Comment 3 Petr Machata 2012-01-16 22:03:26 UTC
Created attachment 555617 [details]
Boost fix

Updated version with all publicly-visible occurrences of bare attributes replaced.  This is what I intend to add to Fedora package.  I'll open and link bug reports for this.

Comment 4 Petr Machata 2012-01-16 23:12:57 UTC
Corresponding upstream bugs are https://svn.boost.org/trac/boost/ticket/6406 to https://svn.boost.org/trac/boost/ticket/6416

Comment 5 Hans de Goede 2012-01-17 08:16:01 UTC
Many thanks for working on this, the lierox patch as well as the boost based solution!


Note You need to log in before you can comment on or make changes to this bug.