x11-misc/lightdm-1.19.0 compile failure due to missing C++11 support in qt5
Created attachment 436868 [details] emerge.info
Created attachment 436870 [details] build log
$ emerge -pqv lightdm [ebuild U ] x11-misc/lightdm-1.19.0 [1.16.6] USE="gtk introspection qt5 -audit -gnome -kde -qt4"
see also https://bugs.gentoo.org/show_bug.cgi?id=566950#c12
still the same with x11-misc/lightdm-1.19.1
Qt starting from version 5.7 requires C++11 support from the C++ compiler [1]. This is usually no problem, one has to pass -std=c11 as a compiler flag (CFLAGS or CXXFLAGS?). I haven't tested it, but I strongly assume that using Qt 5.6 will work fine with lightdm. [1] https://wiki.qt.io/New_Features_in_Qt_5.7
Created attachment 439920 [details, diff] Set compiler flag to enable C++-11 This simple patch sets the compiler flag -std=c++11 to enable C++-11 support for the compiler. Seems to work for both the current stable version 1.16.7 as well as the latest unstable in Portage, 1.19.0. Not covered: - Test if compiler actually supports C++11, but all current C++ compilers should do it - Not tested with any other compiler than GNU C++ 4.9.3 This patch should be submitted upstream if it can be confirmed to fix the problem for the bug reporter.
Patch works for x11-misc/lightdm-1.19.1 too. But I see this warning: libtool: compile: x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I.. -pthread -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/libxml2 -Wall -Wstrict-prototypes -Wnested-externs -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-self -Werror=format-security -Werror=format=2 -Werror=missing-include-dirs -I../common -DCONFIG_DIR=\"/etc/lightdm\" -DSESSIONS_DIR=\"/usr/share/lightdm/sessions:/usr/share/xsessions:/usr/share/wayland-sessions\" -DWAYLAND_SESSIONS_DIR=\"/usr/share/wayland-sessions\" -DREMOTE_SESSIONS_DIR=\"/usr/share/lightdm/remote-sessions\" -march=native -O2 -pipe -std=c++11 -c user.c -fPIC -DPIC -o .libs/liblightdm_gobject_1_la-user.o cc1: warning: command line option ‘-std=c++11’ is valid for C++/ObjC++ but not for C cc1: warning: command line option ‘-std=c++11’ is valid for C++/ObjC++ but not for C
Created attachment 441472 [details, diff] Enable C++-11 (In reply to jospezial from comment #8) > Patch works for x11-misc/lightdm-1.19.1 too. But I see this warning: > [..] > cc1: warning: command line option ‘-std=c++11’ is valid for C++/ObjC++ but > not for C > cc1: warning: command line option ‘-std=c++11’ is valid for C++/ObjC++ but > not for C This revised patch only sets CXXFLAGS. I cannot observe this warning on my system when using this revised patch.
*** Bug 592828 has been marked as a duplicate of this bug. ***
Thanks, fixed in git. https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=982352bbef9975f795c521bea2f06bf2771ecf06