Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 488160 - dev-qt/*: please replace USE=c++0x with USE=c++11
Summary: dev-qt/*: please replace USE=c++0x with USE=c++11
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Qt Bug Alias
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 488536
  Show dependency tree
 
Reported: 2013-10-16 04:06 UTC by Michał Górny
Modified: 2014-11-19 12:42 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-10-16 04:06:57 UTC
Qt packages are the major consumer of 'c++0x' flag. However, that name is deprecated for some time already, and USE=c++11 should probably be used instead -- if any.
Comment 1 Ben de Groot (RETIRED) gentoo-dev 2013-10-20 12:58:39 UTC
We could possibly just drop the useflag and always enable it, if the active gcc version supports it.
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-10-20 15:45:42 UTC
Doesn't it affect the package ABI? I was wondering about the same thing but use of std::pair<> in the API made it impossible.
Comment 3 Davide Pesavento gentoo-dev 2013-10-20 15:49:15 UTC
(In reply to Michał Górny from comment #2)

AFAIK, ABI is unaffected.
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-10-20 15:57:59 UTC
(In reply to Davide Pesavento from comment #3)
> (In reply to Michał Górny from comment #2)
> 
> AFAIK, ABI is unaffected.

I suspect Qt overrides all standard types anyway but please take a look at [1] just to make sure :).

[1]:http://gcc.gnu.org/wiki/Cxx11AbiCompatibility
Comment 5 Davide Pesavento gentoo-dev 2013-10-20 16:50:22 UTC
Thiago (QtCore maintainer) confirmed that ABI does not change.
Comment 6 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-10-20 16:56:00 UTC
(In reply to Davide Pesavento from comment #5)
> Thiago (QtCore maintainer) confirmed that ABI does not change.

Thanks for checking this. Then I'm all for auto-enabling it whenever available. And I think the build system should autodetect it then.
Comment 7 Davide Pesavento gentoo-dev 2013-10-20 21:55:27 UTC
Actually, upstream said that building qt4 with C++11 is pointless. Real C++11 support came only in qt5.

Therefore I completely removed c++0x/c++11 USE flags from qt 4.8.5 and later.
Qt5's configure detects and enables C++11 automatically.
Comment 8 David Carlos Manuelda 2014-11-19 12:24:27 UTC
(In reply to Davide Pesavento from comment #7)
> Actually, upstream said that building qt4 with C++11 is pointless. Real
> C++11 support came only in qt5.
> 
> Therefore I completely removed c++0x/c++11 USE flags from qt 4.8.5 and later.
> Qt5's configure detects and enables C++11 automatically.

I found that this is partially true only. When trying to compile Qt 5.3.2 with gcc 4.9.2, Qt detects c++11 support, but watching compile lines, I see it is using only -std=c++0x instead.

AN example with qtopengl-5.3.2-r1 ebuild (despite it is common for all qt5 ebuilds):

(I highlighted the issue between ** symbols in compilation line)


Build parts ............ libs tools
  Mode ................... release
  Using C++11 ............ yes
  Using PCH .............. no
  Target compiler supports:
    SSE2/SSE3/SSSE3 ...... yes/yes/yes
    SSE4.1/SSE4.2 ........ yes/yes
    AVX/AVX2 ............. yes/yes
(......)
make -j4 
x86_64-pc-linux-gnu-g++ -c -O2 -pipe -mtune=native -march=native -fomit-frame-pointer -fvisibility=hidden -fvisibility-inlines-hidden **-std=c++0x** -fno-exceptions -Wall -W -D_REENTRANT -fPIC -DQT_NO_MTDEV -DQT_NO_EVDEV -DQT_NO_USING_NAMESPACE -DQT_BUILD_OPENGL_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../mkspecs/linux-g++ -I. -I../../include -I../../include/QtOpenGL -I../../include/QtOpenGL/5.3.2 -I../../include/QtOpenGL/5.3.2/QtOpenGL -isystem /usr/include/qt5/QtWidgets/5.3.2 -isystem /usr/include/qt5/QtWidgets/5.3.2/QtWidgets -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtGui/5.3.2 -isystem /usr/include/qt5/QtGui/5.3.2/QtGui -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtCore/5.3.2 -isystem /usr/include/qt5/QtCore/5.3.2/QtCore -isystem /usr/include/qt5/QtCore -I.moc -o .obj/qgl.o qgl.cpp
(...)

Should I open a new bugreport?
Comment 9 Davide Pesavento gentoo-dev 2014-11-19 12:42:59 UTC
There's no difference between -std=c++11 and -std=c++0x AFAIK. They use the latter because it's understood by earlier versions of gcc too.