Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 582522 - dev-qt/qtscript-4.8.7 fails to build with gcc-6: ‘std::tr1’ has not been declared
Summary: dev-qt/qtscript-4.8.7 fails to build with gcc-6: ‘std::tr1’ has not been decl...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Qt Bug Alias
URL:
Whiteboard:
Keywords:
: 593850 596830 (view as bug list)
Depends on:
Blocks: gcc-6
  Show dependency tree
 
Reported: 2016-05-09 09:09 UTC by Mark Wright
Modified: 2016-11-25 17:49 UTC (History)
3 users (show)

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


Attachments
qtscript-4.8.7-gcc-6.0.patch (qtscript-4.8.7-gcc-6.0.patch,3.35 KB, patch)
2016-05-09 09:09 UTC, Mark Wright
Details | Diff
qtscript-4.8.7-gcc6.patch (qtscript-4.8.7-gcc6.patch,8.86 KB, patch)
2016-05-31 03:19 UTC, Peter Levine
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Wright gentoo-dev 2016-05-09 09:09:05 UTC
Created attachment 433746 [details, diff]
qtscript-4.8.7-gcc-6.0.patch

Encounters errors due to gcc 6.x compiling with -std=gnu++14 by default, like:

/var/tmp/portage/dev-qt/qtscript-4.8.7/work/qt-everywhere-opensource-src-4.8.7/src/3rdparty/javascriptcore/JavaScriptCore/wtf/TypeTraits.h:173:69: error: ‘std::tr1’ has not been declared
     template<typename T> struct HasTrivialConstructor : public std::tr1::has_trivial_constructor<T> { };
                                                                     ^~~
/var/tmp/portage/dev-qt/qtscript-4.8.7/work/qt-everywhere-opensource-src-4.8.7/src/3rdparty/javascriptcore/JavaScriptCore/wtf/TypeTraits.h:173:74: error: expected ‘{’ before ‘has_trivial_constructor’
     template<typename T> struct HasTrivialConstructor : public std::tr1::has_trivial_constructor<T> { };
                                                                          ^~~~~~~~~~~~~~~~~~~~~~~
/var/tmp/portage/dev-qt/qtscript-4.8.7/work/qt-everywhere-opensource-src-4.8.7/src/3rdparty/javascriptcore/JavaScriptCore/wtf/TypeTraits.h:174:68: error: ‘std::tr1’ has not been declared
     template<typename T> struct HasTrivialDestructor : public std::tr1::has_trivial_destructor<T> { };
                                                                    ^~~
/var/tmp/portage/dev-qt/qtscript-4.8.7/work/qt-everywhere-opensource-src-4.8.7/src/3rdparty/javascriptcore/JavaScriptCore/wtf/TypeTraits.h:174:73: error: expected ‘{’ before ‘has_trivial_destructor’
     template<typename T> struct HasTrivialDestructor : public std::tr1::has_trivial_destructor<T> { };
                                                                         ^~~~~~~~~~~~~~~~~~~~~~
...
/var/tmp/portage/dev-qt/qtscript-4.8.7/work/qt-everywhere-opensource-src-4.8.7/src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h:264:83: error: ‘template<class T, class U> void QTWTF::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)’ conflicts with a previous declaration
     template<typename T, typename U> inline void swap(pair<T, U>& a, pair<T, U>& b)
...
/var/tmp/portage/dev-qt/qtscript-4.8.7/work/qt-everywhere-opensource-src-4.8.7/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Structure.h:320:137: error: cannot bind bitfield ‘existingTransition->QTJSC::Structure::m_attributesInPrevious’ to ‘unsigned int&’
             add(StructureTransitionTableHash::Key(RefPtr<UString::Rep>(existingTransition->m_nameInPrevious.get()), existingTransition->m_attributesInPrevious), existingTransition, existingTransition->m_specificValueInPrevious);
                                                                                                                     ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
...
/var/tmp/portage/dev-qt/qtscript-4.8.7/work/qt-everywhere-opensource-src-4.8.7/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Structure.h:320:137: error: cannot bind bitfield ‘existingTransition->QTJSC::Structure::m_attributesInPrevious’ to ‘unsigned int&’
             add(StructureTransitionTableHash::Key(RefPtr<UString::Rep>(existingTransition->m_nameInPrevious.get()), existingTransition->m_attributesInPrevious), existingTransition, existingTransition->m_specificValueInPrevious);
                                                                                                                     ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~

I guess the easiest way to fix it would be to add -std=gnu++98 to CXXFLAGS.
Or alternatively, we could try patching it to compile with -std=gnu++14,
like the attached patch.
Comment 1 Peter Levine 2016-05-31 03:19:11 UTC
Created attachment 435892 [details, diff]
qtscript-4.8.7-gcc6.patch

There also exist other incompatibilities with gcc-6. i.e, 

> error: cannot bind bitfield 'existingTransition->QTJSC::Structure::m_attributesInPrevious' to 'unsigned int&'
> error: call of overloaded 'swap(std::pair<std::pair<QTWTF::RefPtr<QTJSC::UStringImpl>, unsigned int>, std::pair<QTJSC::Structure*, QTJSC::Structure*> >&, std::pair<std::pair<QTWTF::RefPtr<QTJSC::UStringImpl>, unsigned int>, std::pair<QTJSC::Structure*, QTJSC::Structure*> >&)' is ambiguous

This patch contains several gcc6/c++11 fix-ups backported from qtscript-5, including the issue with ‘std::tr1’ not having been declared.
Comment 2 Francesco Turco 2016-08-31 13:24:44 UTC
I confirm adding -std=gnu++98 to CXXFLAGS fixes the build problem. I haven't tried the patches yet.
Comment 3 Arfrever Frehtes Taifersar Arahesis 2016-09-15 09:24:58 UTC
*** Bug 593850 has been marked as a duplicate of this bug. ***
Comment 4 Davide Pesavento (RETIRED) gentoo-dev 2016-10-11 09:42:51 UTC
*** Bug 596830 has been marked as a duplicate of this bug. ***