This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 781859 - Boost + gcc-4.7 is causing build failures
Boost + gcc-4.7 is causing build failures
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: boost (Show other bugs)
rawhide
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Petr Machata
Fedora Extras Quality Assurance
:
Depends On:
Blocks: 754865
  Show dependency treegraph
 
Reported: 2012-01-15 13:34 EST by Hans de Goede
Modified: 2015-05-04 21:36 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-01-16 18:12:57 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
Compilation fix (622 bytes, patch)
2012-01-16 09:52 EST, Petr Machata
no flags Details | Diff
Boost fix (696 bytes, patch)
2012-01-16 10:08 EST, Petr Machata
no flags Details | Diff
Boost fix (10.34 KB, patch)
2012-01-16 17:03 EST, Petr Machata
no flags Details | Diff

  None (edit)
Description Hans de Goede 2012-01-15 13:34:47 EST
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 09:52:46 EST
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 10:08:48 EST
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 17:03:26 EST
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 18:12:57 EST
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 03:16:01 EST
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.