Re: [Interest] [OS X] Qt 5.6.0 minimal build configuration (error compiling qlatincodec.cpp)

2016-03-20 Thread Thiago Macieira
On quinta-feira, 17 de março de 2016 17:14:45 PDT Samuel Gaist wrote:
> > /usr/bin/clang++ -c -O3 -march=native -g -ffunction-sections -O2 -g -fPIC
> > -std=c++11 
[...]
> > -I/Users/bertin/work/src/new/Qt/qt-everywhere-opensource-src-5.6.0/qtbase
> > /mkspecs/macx-clang 

> Hi,
> 
> Looks like it's not using
> 
> QMAKE_CXXFLAGS+= -stdlib=libc++
> QMAKE_LFLAGS  += -stdlib=libc++
> 
> However, why, I don't know.

Seems impossible. 5.6's mkspecs/macx-clang/qmake.conf contains:

include(../common/clang-mac.conf)

And that file has:
QMAKE_CXXFLAGS += -stdlib=libc++
QMAKE_LFLAGS   += -stdlib=libc++

The hint is in that "-O3 -march=native" in the command-line. The only place 
where "-march=native" shows up in the Qt sources is part of ANGLE [*], which 
is never compiled on OS X.

So I conclude that René has overwritten QMAKE_CXXFLAGS.

[*] that's a bug
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] [OS X] Qt 5.6.0 minimal build configuration (error compiling qlatincodec.cpp)

2016-03-19 Thread René J . V . Bertin
Thiago Macieira wrote:


> Ok, I'll send the change to remove it. People will not be happy.

No, indeed, even I won't be now that I found a workaround that's easier than 
editing qmake.conf .


> That is an answer by itself. The fact that only the src/tools Makefiles are
> affected is a red herring: you only have those Makefiles to look into.

No, that's not true. AFAICR there were plenty of other Makefiles that did have 
the option.

R.

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] [OS X] Qt 5.6.0 minimal build configuration (error compiling qlatincodec.cpp)

2016-03-19 Thread Thiago Macieira
On quinta-feira, 17 de março de 2016 11:38:58 PDT Thiago Macieira wrote:
> > - -stdlib=libc++ appear to be missing only from CXXFLAGS in the Makefiles
> > under qtbase/src/tools
> 
> Hmm... those are "bootstrapped" tools. But I can't find anything that
> overrides  QMAKE_CXXFLAGS.

Can you confirm that it *is* present in src/corelib/Makefile?

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] [OS X] Qt 5.6.0 minimal build configuration (error compiling qlatincodec.cpp)

2016-03-19 Thread Thiago Macieira
On sexta-feira, 18 de março de 2016 11:27:38 PDT René J. V. Bertin wrote:
> > Autoconf-based configure scripts override the default settings.
> 
> Another thing I'll take your word on, with the caveat outlined above. I've
> a  whole collection of wrapper scripts that allow me to build
> configure/autoconf and cmake based projects using hand-picked optimisation
> options. I think I'd have noticed if those options replaced everything set
> by configure/cmake systematically (possibly including all -I options).
> That said, variables like CC, CXX etc. override instead of append,
> fortunately  (if respected at all.)

So you can just fix this by accepting the issue to be in your scripts. Just 
append "-stdlib=libc++" to your CXXFLAGS environment variable.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] [OS X] Qt 5.6.0 minimal build configuration (error compiling qlatincodec.cpp)

2016-03-19 Thread René J . V . Bertin
Thiago Macieira wrote:

> The proper way of adding options is to modify the mkspec's qmake.conf file

qmake.conf or .qmake.conf?

>> Checking my build scripts, I can confirm that CFLAGS and CXXFLAGS are set
>> *through the environment*, not by any direct action of mine.
> 
> Yeah, not tested. This is the cause of your problem.

A bit easy, no? I'd say either you simply ignore settings from the environment, 
or else you do things correctly. And that would probably mean adding settings 
from the environment to whatever flags you set yourself as I think that's the 
accepted or at least usual way to do it (even CMake does).

Anyway, I see that I had been missing a qmodule.pri edit. For some reason Qt 
5.5.1 built fine with QMAKE_CXXFLAGS="-O3 -march=native -g". After replacing 
that with QMAKE_CXXFLAGS+=etc the build now appears to be happy.

Shouldn't be too hard to generate that file using += instead of a simple = ?

> On quinta-feira, 17 de março de 2016 11:38:58 PDT Thiago Macieira wrote:
>> > - -stdlib=libc++ appear to be missing only from CXXFLAGS in the Makefiles
>> > under qtbase/src/tools
>> 
>> Hmm... those are "bootstrapped" tools. But I can't find anything that
>> overrides  QMAKE_CXXFLAGS.
> 
> Can you confirm that it *is* present in src/corelib/Makefile?

When is that file supposed to be created? I don't have it immediately after 
running configure (and now of course it *will* contain the option that was 
missing).

R.

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] [OS X] Qt 5.6.0 minimal build configuration (error compiling qlatincodec.cpp)

2016-03-19 Thread Samuel Gaist

On 17 mars 2016, at 16:36, René J.V. Bertin  wrote:

> Hi,
> 
> I'm running into an issue building Qt 5.6.0 on OS X 10.9.5 :
> 
> gmake[3]: Entering directory 
> '/.../qt5-kde-devel/work/build/qtbase/src/tools/bootstrap'
> /usr/bin/clang++ -c -O3 -march=native -g -ffunction-sections -O2 -g -fPIC 
> -std=c++11 -isysroot 
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk
>  -mmacosx-version-min=10.7 -fno-exceptions -Wall -W -DQT_NO_MTDEV 
> -DQT_NO_LIBUDEV -DQT_NO_EVDEV -DQT_NO_TSLIB -DQT_NO_LIBINPUT 
> -DQT_BOOTSTRAPPED -DQT_LITE_UNICODE -DQT_NO_CAST_TO_ASCII -DQT_NO_CODECS 
> -DQT_NO_DATASTREAM -DQT_NO_LIBRARY -DQT_NO_QOBJECT -DQT_NO_SYSTEMLOCALE 
> -DQT_NO_THREAD -DQT_NO_UNICODETABLES -DQT_NO_USING_NAMESPACE 
> -DQT_NO_DEPRECATED -DQT_NO_TRANSLATION -DQT_CRYPTOGRAPHICHASH_ONLY_SHA1 
> -DQT_NO_CAST_FROM_ASCII -DQT_BUILD_BOOTSTRAP_LIB -DQT_BUILDING_QT 
> -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER 
> -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x05 
> -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG 
> -I/Users/bertin/work/src/new/Qt/qt-everywhere-opensource-src-5.6.0/qtbase/src/tools/bootstrap
>  -I. -I/Users/bertin/work/s
> rc/new/Qt/qt-everywhere-opensource-src-5.6.0/qtbase/include 
> -I/Users/bertin/work/src/new/Qt/qt-everywhere-opensource-src-5.6.0/qtbase/include/QtCore
>  
> -I/Users/bertin/work/src/new/Qt/qt-everywhere-opensource-src-5.6.0/qtbase/include/QtCore/5.6.0
>  
> -I/Users/bertin/work/src/new/Qt/qt-everywhere-opensource-src-5.6.0/qtbase/include/QtCore/5.6.0/QtCore
>  
> -I/Users/bertin/work/src/new/Qt/qt-everywhere-opensource-src-5.6.0/qtbase/include/QtXml
>  
> -I/Users/bertin/work/src/new/Qt/qt-everywhere-opensource-src-5.6.0/qtbase/include/QtXml/5.6.0
>  
> -I/Users/bertin/work/src/new/Qt/qt-everywhere-opensource-src-5.6.0/qtbase/include/QtXml/5.6.0/QtXml
>  -I../../../include -I../../../include/QtCore 
> -I/.../qt5-kde-devel/work/build/qtbase/include/QtXml 
> -I/Users/bertin/work/src/new/Qt/qt-everywhere-opensource-src-5.6.0/qtbase/mkspecs/macx-clang
>  -o .obj/qlatincodec.o 
> /Users/bertin/work/src/new/Qt/qt-everywhere-opensource-src-5.6.0/qtbase/src/corelib/codecs/qlatincodec.cpp
> In file included from 
> /Users/bertin/work/src/new/Qt/qt-everywhere-opensource-src-5.6.0/qtbase/src/corelib/codecs/qlatincodec.cpp:34:
> In file included from 
> /Users/bertin/work/src/new/Qt/qt-everywhere-opensource-src-5.6.0/qtbase/src/corelib/codecs/qlatincodec_p.h:48:
> In file included from 
> /Users/bertin/work/src/new/Qt/qt-everywhere-opensource-src-5.6.0/qtbase/include/QtCore/qtextcodec.h:1:
> In file included from 
> /Users/bertin/work/src/new/Qt/qt-everywhere-opensource-src-5.6.0/qtbase/include/QtCore/../../src/corelib/codecs/qtextcodec.h:37:
> In file included from 
> /Users/bertin/work/src/new/Qt/qt-everywhere-opensource-src-5.6.0/qtbase/include/QtCore/qstring.h:1:
> /Users/bertin/work/src/new/Qt/qt-everywhere-opensource-src-5.6.0/qtbase/include/QtCore/../../src/corelib/tools/qstring.h:756:55:
>  error: no type named 'u16string' in namespace 'std'
>static inline QString fromStdU16String(const std::u16string );
> ~^
> /Users/bertin/work/src/new/Qt/qt-everywhere-opensource-src-5.6.0/qtbase/include/QtCore/../../src/corelib/tools/qstring.h:757:17:
>  error: no type named 'u16string' in namespace 'std'
>inline std::u16string toStdU16String() const;
>   ~^
> 
> In file included from 
> /Volumes/Debian/Users/bertin/work/src/new/Qt/qt-everywhere-opensource-src-5.6.0/qtbase/include/QtCore/../../src/corelib/tools/qhashfunctions.h:39:
> In file included from 
> /Volumes/Debian/Users/bertin/work/src/new/Qt/qt-everywhere-opensource-src-5.6.0/qtbase/include/QtCore/qpair.h:1:
> /Volumes/Debian/Users/bertin/work/src/new/Qt/qt-everywhere-opensource-src-5.6.0/qtbase/include/QtCore/../../src/corelib/tools/qpair.h:62:44:
>  error: no member named 'declval' in namespace 'std'
>Q_DECL_NOEXCEPT_EXPR(noexcept(std::declval() = p.first) && 
> noexcept(std::declval() = p.second))
>  ~^
> /Volumes/Debian/Users/bertin/work/src/new/Qt/qt-everywhere-opensource-src-5.6.0/qtbase/include/QtCore/../../src/corelib/global/qcompilerdetection.h:1036:43:
>  note: expanded from macro 'Q_DECL_NOEXCEPT_EXPR'
> # define Q_DECL_NOEXCEPT_EXPR(x) noexcept(x)
>  ^
> 
> 
> 
> This does not appear to be a limitation in the Xcode compiler (Xcode 6.2, 
> Apple Clang 600) because when I use clang 3.8 I get the exact same errors.
> 
> Configure command and summary are below (note the request for the 10.9 SDK 
> which is ignored in the above compile command!).
> 
> Any ideas? The same code in qstring.h doesn't cause issues in Qt 5.5.1 .
> 
> %> configure -top-level -platform macx-clang -sdk macosx10.9 -prefix 
> /opt/local -archdatadir 

Re: [Interest] [OS X] Qt 5.6.0 minimal build configuration (error compiling qlatincodec.cpp)

2016-03-19 Thread René J . V . Bertin
Thiago Macieira wrote:

> The hint is in that "-O3 -march=native" in the command-line. The only place
> where "-march=native" shows up in the Qt sources is part of ANGLE [*], which
> is never compiled on OS X.
> 
> So I conclude that René has overwritten QMAKE_CXXFLAGS.

Couple observations:
- I am doing nothing different from what I'm doing while building Qt 5.5.1
- -stdlib=libc++ appear to be missing only from CXXFLAGS in the Makefiles under 
qtbase/src/tools
- it is the only option that's missing

While you may be right that my (intention of) adding compilation options is 
somehow involved, I don't think that's the "bug" (and I'd hope that it'd be 
supported).

Checking my build scripts, I can confirm that CFLAGS and CXXFLAGS are set 
*through the environment*, not by any direct action of mine.

What I do change though is a few lines in qmodule.pri, replacing "QMAKE_CFLAGS 
=", "QMAKE_CXXFLAGS =" and "QMAKE_LFLAGS =" with the corresponding 
"QMAKE_?FLAGS 
+=" . The accompanying comment explains that this change is made exactly to 
ensure that options specified through the environment come in addition to the 
standard options, instead of replacing them.

If those statements were moved to a different file, or qmodule.pri moved to a 
different location, the changes will no longer be made (but then I guess I'd 
not 
be seeing -stdlib=libc++ anywhere anymore ?!).

R.

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] [OS X] Qt 5.6.0 minimal build configuration (error compiling qlatincodec.cpp)

2016-03-19 Thread René J . V . Bertin
Thiago Macieira wrote:


>> No, that's not true. AFAICR there were plenty of other Makefiles that did
>> have  the option.
> 
> Which ones?

The ones that scrolled off my history ;)
Seriously, to answer that question I'd have to restart a build without my fix, 
so 
are you truly interested to know?

> After this, lots of things can happen in parallel (QtGui and all non-GUI
> modules).

Yes, that's quite possible, the thought crossed my mind.

>> Shouldn't be too hard to generate that file using += instead of a simple = ?
> 
> It would just as equally break people's expectations.

I'll have to take your word on that. Myself I have come to expect that build 
systems set the required options, and that anything you want in addition 
(potentially acting as an override) you specify via the environment.

> Autoconf-based configure scripts override the default settings.

Another thing I'll take your word on, with the caveat outlined above. I've a 
whole collection of wrapper scripts that allow me to build configure/autoconf 
and 
cmake based projects using hand-picked optimisation options. I think I'd have 
noticed if those options replaced everything set by configure/cmake 
systematically (possibly including all -I options).
That said, variables like CC, CXX etc. override instead of append, fortunately 
;) (if respected at all.)

R.

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] [OS X] Qt 5.6.0 minimal build configuration (error compiling qlatincodec.cpp)

2016-03-19 Thread Thiago Macieira
On quinta-feira, 17 de março de 2016 22:06:09 PDT René J. V. Bertin wrote:
> > That is an answer by itself. The fact that only the src/tools Makefiles
> > are
> > affected is a red herring: you only have those Makefiles to look into.
> 
> No, that's not true. AFAICR there were plenty of other Makefiles that did
> have  the option.

Which ones?

The build order for a non-cross-compilation build is:
qmake   (done during configure)
src/tools/bootstrap
src/tools/moc and src/tools/rcc (built in parallel)
src/corelib

This order cannot be broken. There's no sense in even creating a Makefile for 
anything else, since everything links to QtCore.

After this, lots of things can happen in parallel (QtGui and all non-GUI 
modules).
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] [OS X] Qt 5.6.0 minimal build configuration (error compiling qlatincodec.cpp)

2016-03-19 Thread René J . V . Bertin
On Thursday March 17 2016 17:14:45 Samuel Gaist wrote:

> Hi,
> 
> Looks like it's not using
> 
> QMAKE_CXXFLAGS+= -stdlib=libc++
> QMAKE_LFLAGS  += -stdlib=libc++
> 
> However, why, I don't know.

Good eye, that's it! At least the compile command cited completes OK with that 
additional option.

Why ... maybe something/someone somewhere considered that the option should be 
redundant, and maybe it is on later OS X versions (as indeed it should).

I'll experiment some more (including with a bone stock qtbase) and see if I can 
trace this to a difference somewhere in the mkspecs files.

Thanks,
René
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] [OS X] Qt 5.6.0 minimal build configuration (error compiling qlatincodec.cpp)

2016-03-19 Thread Thiago Macieira
On quinta-feira, 17 de março de 2016 18:38:40 PDT René J. V. Bertin wrote:
> Couple observations:
> - I am doing nothing different from what I'm doing while building Qt 5.5.1
> - -stdlib=libc++ appear to be missing only from CXXFLAGS in the Makefiles
> under qtbase/src/tools

Hmm... those are "bootstrapped" tools. But I can't find anything that overrides 
QMAKE_CXXFLAGS.

> - it is the only option that's missing

But you've got things that you shouldn't have. Most likely, whatever added 
-march=native did so by overriding QMAKE_CXXFLAGS.

> While you may be right that my (intention of) adding compilation options is
> somehow involved, I don't think that's the "bug" (and I'd hope that it'd be
> supported).

The proper way of adding options is to modify the mkspec's qmake.conf file or 
to create a new one that include()s the standard one. Anything else is not 
tested.

> Checking my build scripts, I can confirm that CFLAGS and CXXFLAGS are set
> *through the environment*, not by any direct action of mine.

Yeah, not tested. This is the cause of your problem.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] [OS X] Qt 5.6.0 minimal build configuration (error compiling qlatincodec.cpp)

2016-03-18 Thread Thiago Macieira
On quinta-feira, 17 de março de 2016 20:48:19 PDT René J. V. Bertin wrote:
> Thiago Macieira wrote:
> > The proper way of adding options is to modify the mkspec's qmake.conf file
> 
> qmake.conf or .qmake.conf?

mkspec/macx-clang/qmake.conf

> >> Checking my build scripts, I can confirm that CFLAGS and CXXFLAGS are set
> >> *through the environment*, not by any direct action of mine.
> > 
> > Yeah, not tested. This is the cause of your problem.
> 
> A bit easy, no? I'd say either you simply ignore settings from the
> environment, or else you do things correctly. And that would probably mean
> adding settings from the environment to whatever flags you set yourself as
> I think that's the accepted or at least usual way to do it (even CMake
> does).

Ok, I'll send the change to remove it. People will not be happy.

> Anyway, I see that I had been missing a qmodule.pri edit. For some reason Qt
> 5.5.1 built fine with QMAKE_CXXFLAGS="-O3 -march=native -g". After
> replacing that with QMAKE_CXXFLAGS+=etc the build now appears to be happy.

Because Qt 5.6 changed the point at which it adds -stdlib=libc++. In Qt 5.5, 
it happened after the qmodule.pri parsing. In Qt 5.6, it's done before.

> Shouldn't be too hard to generate that file using += instead of a simple = ?

It would just as equally break people's expectations. Autoconf-based configure 
scripts override the default settings.

> >> Hmm... those are "bootstrapped" tools. But I can't find anything that
> >> overrides  QMAKE_CXXFLAGS.
> > 
> > Can you confirm that it *is* present in src/corelib/Makefile?
> 
> When is that file supposed to be created? I don't have it immediately after
> running configure (and now of course it *will* contain the option that was
> missing).

It's created after moc and rcc are built.

That is an answer by itself. The fact that only the src/tools Makefiles are 
affected is a red herring: you only have those Makefiles to look into.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest