Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 547528

Summary: app-crypt/pinentry-0.9.0-r3 with USE="qt4" fails to build with GCC 5.1
Product: Gentoo Linux Reporter: Ryan Hill (RETIRED) <rhill>
Component: [OLD] GCC PortingAssignee: Crypto team [DISABLED] <crypto+disabled>
Status: RESOLVED FIXED    
Severity: normal CC: alonbl, jrmalaq, kredba, octoploid
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 536984    
Attachments: build.log
pinentry-0.9.0-r3.ebuild patch to add -std=gnu++11
pinentry-0.9.0-r3.ebuild patch to add -std=gnu++11 with only get major part

Description Ryan Hill (RETIRED) gentoo-dev 2015-04-23 23:52:11 UTC
x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I..  -I.. -I../assuan -I../secmem -I/usr/include/ncursesw -I../pinentry -Wall -DQT_SHARED -I/usr/include/qt4 -I/usr/include/qt4/QtCore  -DQT_SHARED -I/usr/include/qt4 -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I/usr/include/qt4/QtCore  -O2 -march=native -pipe -c -o secstring.o secstring.cpp
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/5.1.0/include/g++-v5/string:52:0,
                 from secstring.h:27,
                 from secstring.cpp:23:
/usr/lib/gcc/x86_64-pc-linux-gnu/5.1.0/include/g++-v5/bits/basic_string.h: In instantiation of 'union std::__cxx11::basic_string<QChar, std::char_traits<QChar>, secmem::alloc<QChar> >::<anonymous>':
/usr/lib/gcc/x86_64-pc-linux-gnu/5.1.0/include/g++-v5/bits/basic_string.h:119:7:   required from 'class std::__cxx11::basic_string<QChar, std::char_traits<QChar>, secmem::alloc<QChar> >'
secstring.h:37:270:   required from here
/usr/lib/gcc/x86_64-pc-linux-gnu/5.1.0/include/g++-v5/bits/basic_string.h:121:43: error: member 'QChar std::__cxx11::basic_string<QChar, std::char_traits<QChar>, secmem::alloc<QChar> >::<anonymous union>::_M_local_buf [8]' with constructor not allowed in union
  _CharT           _M_local_buf[_S_local_capacity + 1];
                                           ^
/usr/lib/gcc/x86_64-pc-linux-gnu/5.1.0/include/g++-v5/bits/basic_string.h:121:43: note: unrestricted unions only available with -std=c++11 or -std=gnu++11
secstring.cpp: In function 'secstring toUtf8(const secqstring&)':
secstring.cpp:71:16: warning: unused variable 'cursor' [-Wunused-variable]
         uchar *cursor = (uchar*)ba.data();
                ^
Makefile:456: recipe for target 'secstring.o' failed
Comment 1 Ryan Hill (RETIRED) gentoo-dev 2015-04-24 00:00:54 UTC
Created attachment 401896 [details]
build.log
Comment 2 octoploid 2015-04-24 05:46:51 UTC
gcc is right to reject this. This is an upstream bug.
Type 'QChar' has a user-provided, non-trivial default constructor.

-std=c++11 is needed in this case.
Comment 3 Mark Wright gentoo-dev 2015-04-30 07:23:41 UTC
Created attachment 402276 [details, diff]
pinentry-0.9.0-r3.ebuild patch to add -std=gnu++11

Patching the pinentry-0.9.0-r3.ebuild to add -std=gnu++11 allows it to compile
with gcc version 5.1.0
Comment 4 Alon Bar-Lev (RETIRED) gentoo-dev 2015-04-30 09:56:20 UTC
(In reply to Mark Wright from comment #3)
> Created attachment 402276 [details, diff] [details, diff]
> pinentry-0.9.0-r3.ebuild patch to add -std=gnu++11
> 
> Patching the pinentry-0.9.0-r3.ebuild to add -std=gnu++11 allows it to
> compile
> with gcc version 5.1.0

can't the gcc detection can be bypassed and only get the major part? it will be empty if not gcc.
Comment 5 Mark Wright gentoo-dev 2015-04-30 11:25:47 UTC
Created attachment 402286 [details, diff]
pinentry-0.9.0-r3.ebuild patch to add -std=gnu++11 with only get major part

(In reply to Alon Bar-Lev from comment #4)
> (In reply to Mark Wright from comment #3)
> > Created attachment 402276 [details, diff] [details, diff] [details, diff]
> > pinentry-0.9.0-r3.ebuild patch to add -std=gnu++11
> > 
> > Patching the pinentry-0.9.0-r3.ebuild to add -std=gnu++11 allows it to
> > compile
> > with gcc version 5.1.0
> 
> can't the gcc detection can be bypassed and only get the major part? it will
> be empty if not gcc.

Yes that also builds fine with gcc version 5.1.0.
Comment 6 Alon Bar-Lev (RETIRED) gentoo-dev 2015-04-30 19:52:00 UTC
fixed in pinentry-0.9.0-r3
thanks!
Comment 7 Alon Bar-Lev (RETIRED) gentoo-dev 2015-05-03 15:20:53 UTC
Can you please try pinentry-0.9.1 without:

    [[ "$(gcc-major-version)" -ge 5 ]] && append-cxxflags -std=gnu++11

Thanks!