Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bugzilla DB migration completed. Please report issues to Infra team via email via infra@gentoo.org or IRC

Bug 582522

Summary: dev-qt/qtscript-4.8.7 fails to build with gcc-6: ‘std::tr1’ has not been declared
Product: Gentoo Linux Reporter: Mark Wright <gienah>
Component: Current packagesAssignee: Qt Bug Alias <qt>
Status: RESOLVED FIXED    
Severity: normal CC: alex.iris.parker, plevine457, toralf
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 582084    
Attachments: qtscript-4.8.7-gcc-6.0.patch
qtscript-4.8.7-gcc6.patch

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 gentoo-dev 2016-10-11 09:42:51 UTC
*** Bug 596830 has been marked as a duplicate of this bug. ***