Bug#823145: Qt4-using packages fail to build with gcc6

2016-05-08 Thread Rene Engelhard
Hi,

On Sun, May 08, 2016 at 02:38:18PM +0300, Dmitry Shachnev wrote:
> Will anything break if these -isystem's are replaced with -I's?
Not except upstreams Warnings-are-errors configuration:

https://cgit.freedesktop.org/libreoffice/core/tree/configure.ac#n3227

We could ignore that, but I'd keep the patch minimal, see my other reply.

Regards,

Rene



Bug#823145: Qt4-using packages fail to build with gcc6

2016-05-08 Thread Rene Engelhard
reassign 823145 src:libreoffice
retitle 823145 FTBFS with gcc 6: -isystem /usr/include in KDE4_CFLAGS breaks 
includes
thanks
  
Hi,

On Sun, May 08, 2016 at 01:23:32PM +0200, Rene Engelhard wrote:
> Jup. See "checking for KDE4 headers... /usr/include". Which ends up as
> 
> export KDE4_CFLAGS=$(gb_SPACE)-isystem /usr/include -DQT_SHARED -isystem 
> /usr/include/qt4 -isystem /usr/include/qt4/QtNetwork -isystem 
> /usr/include/qt4 -isystem /usr/include/qt4/QtGui -isystem /usr/include/qt4 
> -isystem /usr/include/qt4/QtCore -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT

And indeed a 

@@ -11094,6 +11145,9 @@ the root of your Qt installation by exporting QT4DIR 
before running "configure".
 if test "x$kde_incdir" = "xno"; then
 AC_MSG_ERROR([KDE4 headers not found.  Please specify the root of your 
KDE4 installation by exporting KDE4DIR before running "configure".])
 fi
+# see http://bugs.debian.org/823145. -isystem /usr/include fails with
+# gcc6
+if test "$kde_incdir" = "/usr/include"; then kde_incdir=; fi
 
 dnl Check for KDE4 libraries
 AC_MSG_CHECKING([for KDE4 libraries])

makes it work.

(though it mysteriously ends up as
export KDE4_CFLAGS=$(gb_SPACE)-isystem  -DQT_SHARED -isystem /usr/include/qt4 
-isystem /usr/include/qt4/QtNetwork -isystem /usr/include/qt4 -isystem 
/usr/include/qt4/QtGui -isystem /usr/include/qt4 -isystem 
/usr/include/qt4/QtCore -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT
but anyway.)

Reassigning to LO.

Regards,



Bug#823145: Qt4-using packages fail to build with gcc6

2016-05-08 Thread Dmitry Shachnev
On Sun, May 08, 2016 at 01:23:32PM +0200, Rene Engelhard wrote:
> From configure:
>
> [...]
>
> Jup. See "checking for KDE4 headers... /usr/include". Which ends up as
>
> export KDE4_CFLAGS=$(gb_SPACE)-isystem /usr/include -DQT_SHARED -isystem
> /usr/include/qt4 -isystem /usr/include/qt4/QtNetwork -isystem /usr/include/qt4
> -isystem /usr/include/qt4/QtGui -isystem /usr/include/qt4 -isystem
> /usr/include/qt4/QtCore -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT

Will anything break if these -isystem's are replaced with -I's?

--
Dmitry Shachnev


signature.asc
Description: PGP signature


Bug#823145: Qt4-using packages fail to build with gcc6

2016-05-08 Thread Dmitry Shachnev
Hi Rene,

On Sun, May 08, 2016 at 01:05:47PM +0200, Rene Engelhard wrote:
> Or are you implying it does work without that -isystem?
>
> (cowbuilder-unstable)rene@frodo:~$ g++-6 -isystem /usr/include -c test.c
> In file included from test.c:1:0:
> /usr/include/c++/6/cstdlib:75:25: fatal error: stdlib.h: No such file or 
> directory
>  #include_next 
>  ^
> compilation terminated.
> (cowbuilder-unstable)rene@frodo:~$ g++-6 -I/usr/include -c test.c
> (cowbuilder-unstable)rene@frodo:~$ g++-6 -c test.c
> (cowbuilder-unstable)rene@frodo:~$
>
> Hmm. Indeed

Basically #include_next is "#include, but skip the first found file".

And with -isystem /usr/include the first found stdlib.h file is
/usr/include/stdlib.h (otherwise it would be i.e. /usr/include/c++/6/stdlib.h).

Now, a quick Google search tells me that GCC developers closed a bug
about this as WONTFIX: .

So maybe the best way for LO will be getting rid of that -isystem flag.

--
Dmitry Shachnev


signature.asc
Description: PGP signature


Bug#823145: Qt4-using packages fail to build with gcc6

2016-05-08 Thread Rene Engelhard
On Sun, May 08, 2016 at 01:05:47PM +0200, Rene Engelhard wrote:
> > By the way, is there any particular reason why LibreOffice buildsystem uses
> > -isystem /usr/include?
> 
> Probably some bug where it just adds whatever -I it finds (and be it
> /usr/include, which shouldn't be specificied but..) and then turns that into
> a -isystem...

>From configure:

checking for Qt4 headers... /usr/include/qt4
checking for qmake-qt4... /usr/bin/qmake-qt4
checking for Qt4 libraries... /usr/lib/aarch64-linux-gnu
checking for moc-qt4... /usr/bin/moc-qt4
checking for KDE4 headers... /usr/include
checking for KDE4 libraries... /usr/lib
checking for QT4... yes
checking whether KDE is >= 4.2... yes
checking for KDE_GLIB... yes
checking whether Qt has fixed ExcludeSocketNotifiers... no
configure: WARNING: native KDE4 file pickers will be disabled at runtime
tput: No value for $TERM and no -T specified
./configure: line 5038: test: -ge: unary operator expected
checking whether Qt avoids QClipboard recursion caused by posted events... no
configure: WARNING: native KDE4 file pickers will be disabled at runtime

Jup. See "checking for KDE4 headers... /usr/include". Which ends up as

export KDE4_CFLAGS=$(gb_SPACE)-isystem /usr/include -DQT_SHARED -isystem 
/usr/include/qt4 -isystem /usr/include/qt4/QtNetwork -isystem /usr/include/qt4 
-isystem /usr/include/qt4/QtGui -isystem /usr/include/qt4 -isystem 
/usr/include/qt4/QtCore -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT

Regards,
 
Rene



Bug#823145: Qt4-using packages fail to build with gcc6

2016-05-08 Thread Rene Engelhard
Hi,

On Tue, May 03, 2016 at 09:32:55PM +0300, Dmitry Shachnev wrote:
> > In file included from /usr/include/c++/6/bits/stl_algo.h:59:0,
> >  from /usr/include/c++/6/algorithm:62,
> >  from /usr/include/qt4/QtCore/qglobal.h:68,
> >  from /usr/include/kdemacros.h:162,
> >  from /usr/include/kdecore_export.h:24,
> >  from /usr/include/kdeversion.h:30,
> >  from conftest.cpp:139:
> > /usr/include/c++/6/cstdlib:75:25: fatal error: stdlib.h: No such file or 
> > directory
> >  #include_next 
> 
> This has nothing to do with Qt 4. I can reproduce this with the following
> minimal example:
[...]
>   In file included from test.c:1:0:
>   /usr/include/c++/6/cstdlib:75:25: fatal error: stdlib.h: No such file or 
> directory
>#include_next 
>^
>   compilation terminated.
> 
> This does not happen with g++-5, so it is a behavior change in GCC 6.

That's why I said "reassign as appropriate".

> I am not sure whether this is a bug or intended change, so not yet reassigning
> this bug, however CCing the GCC maintainer to get his opinion.

Sure, but if libstdc++'s header (cdstlib) includes stdlib.h, it should simply 
work, no?

> By the way, is there any particular reason why LibreOffice buildsystem uses
> -isystem /usr/include?

Probably some bug where it just adds whatever -I it finds (and be it
/usr/include, which shouldn't be specificied but..) and then turns that into
a -isystem...

Or are you implying it does work without that -isystem?

(cowbuilder-unstable)rene@frodo:~$ g++-6 -isystem /usr/include -c test.c
In file included from test.c:1:0:
/usr/include/c++/6/cstdlib:75:25: fatal error: stdlib.h: No such file or 
directory
 #include_next 
 ^
compilation terminated.
(cowbuilder-unstable)rene@frodo:~$ g++-6 -I/usr/include -c test.c
(cowbuilder-unstable)rene@frodo:~$ g++-6 -c test.c
(cowbuilder-unstable)rene@frodo:~$

Hmm. Indeed

Regards,

Rene



Bug#823145: Qt4-using packages fail to build with gcc6

2016-05-03 Thread Dmitry Shachnev
Hi Rene,

On Sun, May 01, 2016 at 02:55:23PM +0200, Rene Engelhard wrote:
> When I try to compile LibreOffice (which otherwise is ready for gcc 6, see
> below) with gcc 6 I get:
>
> [...]
>
> configure:37742: x86_64-linux-gnu-g++ -o conftest -g -O2 
> -fstack-protector-stron
> g -Wformat -Werror=format-security -isystem /usr/include -DQT_SHARED -isystem 
> /u
> sr/include/qt4 -isystem /usr/include/qt4/QtNetwork -isystem /usr/include/qt4 
> -is
> ystem /usr/include/qt4/QtGui -isystem /usr/include/qt4 -isystem 
> /usr/include/qt4
> /QtCore -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT -Wdate-time 
> -D_FORTIFY_SOURCE=2
>   -Wl,-z,relro   conftest.cpp  >&5
> In file included from /usr/include/c++/6/bits/stl_algo.h:59:0,
>  from /usr/include/c++/6/algorithm:62,
>  from /usr/include/qt4/QtCore/qglobal.h:68,
>  from /usr/include/kdemacros.h:162,
>  from /usr/include/kdecore_export.h:24,
>  from /usr/include/kdeversion.h:30,
>  from conftest.cpp:139:
> /usr/include/c++/6/cstdlib:75:25: fatal error: stdlib.h: No such file or 
> directory
>  #include_next 

This has nothing to do with Qt 4. I can reproduce this with the following
minimal example:

  $ cat test.c
  #include 
  $ g++-6 -isystem /usr/include -c test.c
  In file included from test.c:1:0:
  /usr/include/c++/6/cstdlib:75:25: fatal error: stdlib.h: No such file or 
directory
   #include_next 
   ^
  compilation terminated.

This does not happen with g++-5, so it is a behavior change in GCC 6.

I am not sure whether this is a bug or intended change, so not yet reassigning
this bug, however CCing the GCC maintainer to get his opinion.

By the way, is there any particular reason why LibreOffice buildsystem uses
-isystem /usr/include?

--
Dmitry Shachnev


signature.asc
Description: PGP signature


Bug#823145: Qt4-using packages fail to build with gcc6

2016-05-01 Thread Rene Engelhard
Package: libqt4-dev
Version: 4:4.8.7+dfsg-6
Severity: important

Hi,

When I try to compile LibreOffice (which otherwise is ready for gcc 6, see
below) with gcc 6 I get:

checking for Qt4 headers... /usr/include/qt4
checking for qmake-qt4... /usr/bin/qmake-qt4
checking for Qt4 libraries... /usr/lib/x86_64-linux-gnu
checking for moc-qt4... /usr/bin/moc-qt4
checking for KDE4 headers... /usr/include
checking for KDE4 libraries... /usr/lib
checking for QT4... yes
checking whether KDE is >= 4.2... configure: error: KDE version too old
Error running configure at ./autogen.sh line 281.
/home/rene/Debian/Pakete/LibreOffice/libreoffice/libreoffice-5.2.0.0.alpha1/debian/rules:1943:
 recipe for target 'debian/stampdir/build-arch' failed
make[1]: *** [debian/stampdir/build-arch] Error 25
make[1]: Leaving directory 
'/home/rene/Debian/Pakete/LibreOffice/libreoffice/libreoffice-5.2.0.0.alpha1'
debian/rules:1936: recipe for target 'build' failed
make: *** [build] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2
debuild: fatal error at line 1376:
dpkg-buildpackage -rfakeroot -D -us -uc -b failed

This check is the following:

AC_LANG_PUSH([C++])
save_CXXFLAGS=$CXXFLAGS
CXXFLAGS="$CXXFLAGS $KDE4_CFLAGS"
AC_MSG_CHECKING([whether KDE is >= 4.2])
   AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include 

int main(int argc, char **argv) {
   if (KDE_VERSION_MAJOR == 4 && KDE_VERSION_MINOR >= 2) return 0;
   else return 1;
}
]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([KDE version too 
old])],[AC_MSG_ERROR([KDE support not tested with cross-compilation])])
CXXFLAGS=$save_CXXFLAGS
AC_LANG_POP([C++])

config.log says:

configure:37726: checking whether KDE is >= 4.2
configure:37742: x86_64-linux-gnu-g++ -o conftest -g -O2 -fstack-protector-stron
g -Wformat -Werror=format-security -isystem /usr/include -DQT_SHARED -isystem /u
sr/include/qt4 -isystem /usr/include/qt4/QtNetwork -isystem /usr/include/qt4 -is
ystem /usr/include/qt4/QtGui -isystem /usr/include/qt4 -isystem /usr/include/qt4
/QtCore -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT -Wdate-time -D_FORTIFY_SOURCE=2
  -Wl,-z,relro   conftest.cpp  >&5
In file included from /usr/include/c++/6/bits/stl_algo.h:59:0,
 from /usr/include/c++/6/algorithm:62,
 from /usr/include/qt4/QtCore/qglobal.h:68,
 from /usr/include/kdemacros.h:162,
 from /usr/include/kdecore_export.h:24,
 from /usr/include/kdeversion.h:30,
 from conftest.cpp:139:
/usr/include/c++/6/cstdlib:75:25: fatal error: stdlib.h: No such file or 
directory
 #include_next 
 ^
compilation terminated.
configure:37742: $? = 1
configure: program exited with status 1
configure: failed program was:
[...]
| /* end confdefs.h.  */
|
| #include 
|
| int main(int argc, char **argv) {
|if (KDE_VERSION_MAJOR == 4 && KDE_VERSION_MINOR >= 2) return 0;
|else return 1;
| }
|
configure:37746: error: KDE version too old

This also happens in the actual compilation later:

[build CXX] shell/source/backends/kde4be/kde4access.cxx
S=/home/rene/Debian/Pakete/LibreOffice/libreoffice/libreoffice-5.2.0.0.alpha1 &&
 I=$S/instdir && W=$S/workdir &&  mkdir -p $W/CxxObject/shell/source/backends/kd
e4be/ $W/Dep/CxxObject/shell/source/backends/kde4be/ && cd /home/rene/Debian/Pak
ete/LibreOffice/libreoffice/libreoffice-5.2.0.0.alpha1 &&   
x86_64-linux-gnu-g++ -DBOOST_ERROR_CODE_HEADER_ONLY 
-DBOOST_SYSTEM_NO_DEPRECATED -DCPPU_ENV=gcc3 -DLINUX -DNDEBUG -DOPTIMIZE 
-DOSL_DEBUG_LEVEL=0 -DUNIX -DUNX -DX86_64 -D_FORTIFY_SOURCE=2 -D_PTHREADS 
-D_REENTRANT -Wdate-time -Wdate-time -D_FORTIFY_SOURCE=2  -DQT_SHARED 
-DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT   -DHAVE_GCC_VISIBILITY_FEATURE 
-fvisibility=hidden   -Wall -Wno-missing-braces -Wnon-virtual-dtor 
-Wendif-labels -Wextra -Wundef -Wunused-macros -fmessage-length=0 -fno-common 
-pipe  -Wduplicated-cond -Wlogical-op -Wnull-dereference -Wshift-overflow=2 
-Wunused-const-variable=1 -fvisibility-inlines-hidden -fPIC -Wshadow 
-Woverloaded-virtual -std=gnu++14  -ggdb2  -DEXCEPTIONS_ON -fexceptions 
-fno-enforce-eh-specs -g -O2 -fstack-protector-strong -Wformat 
-Werror=format-security  -DLIBO_INTERNAL_ONLY  -c 
$S/shell/source/backends/kde4be/kde4access.cxx -o 
$W/CxxObject/shell/source/backends/kde4be/kde4access.o  
-I$S/shell/source/backends/kde4be/ -isystem /usr/include -isystem 
/usr/include/qt4 -isystem /usr/include/qt4/QtNetwork -isystem /usr/include/qt4 
-isystem /usr/include/qt4/QtGui -isystem /usr/include/qt4 -isystem 
/usr/include/qt4/QtCore  -I$S/include  -I/usr/lib/jvm/default-java/include 
-I/usr/lib/jvm/default-java/include/linux -I$S/config_host  
-I$W/UnoApiHeadersTarget/udkapi/normal -I$W/UnoApiHeadersTarget/offapi/normal 
-I/usr/include
[build CXX] shell/source/backends/kde4be/kde4backend.cxx

In file included from /usr/include/c++/6/bits/stl_algo.h:59:0,
 from /usr/include/c++/6/algorithm:62,