Re: [Interest] QMake, (static) libraries and LTCG (LTO) on Mac

2017-11-13 Thread Thiago Macieira
On segunda-feira, 13 de novembro de 2017 03:24:46 PST René J. V. Bertin wrote:
> Thiago Macieira wrote:
> > it's a limitation of your environment. Static linking LTCG precompiled
> > code
> > requires a special linker. It's not very well supported everywhere.
> 
> Erm, this is on Mac, and I am using a much more recent linker editor than
> the one from the system. I've been able to build Qt itself with LTCG (I
> rebuilt Qt4 that way only a week or 2 ago) so while you're undoubtedly
> right in general I think this is not at cause here.

Right, it's not very well supported everywhere. Clang + Apple's ld is one of 
those environments where it's not.

I test LTCG frequently, but only with GCC and Linux. I know GCC + Binutils 
(gold and BFD) work properly for static linking, but I'm not sure about Clang 
+ LLVM. Please volunteer to make it work for Clang and macOS. Please see 
mkspecs/features/ltcg.prf.

(because qtbase's build involves creating one static library and using it, you 
don't need a static build to confirm that it works; just force ltcg in qtbase/
src)

-- 
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] QMake, (static) libraries and LTCG (LTO) on Mac

2017-11-13 Thread René J . V . Bertin
Thiago Macieira wrote:


> it's a limitation of your environment. Static linking LTCG precompiled code
> requires a special linker. It's not very well supported everywhere.

Erm, this is on Mac, and I am using a much more recent linker editor than the 
one from the system. I've been able to build Qt itself with LTCG (I rebuilt Qt4 
that way only a week or 2 ago) so while you're undoubtedly right in general I 
think this is not at cause here.

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


Re: [Interest] QMake, (static) libraries and LTCG (LTO) on Mac

2017-11-11 Thread Thiago Macieira
On sábado, 11 de novembro de 2017 05:01:53 PST René J.V. Bertin wrote:
> Am I doing something wrong or am I simply hitting a limitation?

it's a limitation of your environment. Static linking LTCG precompiled code 
requires a special linker. It's not very well supported everywhere.

-- 
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] QMake, (static) libraries and LTCG (LTO) on Mac

2017-11-11 Thread René J . V . Bertin
On Saturday November 11 2017 17:47:14 Konstantin Tokarev wrote:

>Well, LTO and missing symbols go hand in hand, you should be ready to deal 
>with such errors.

That shouldn't be the case IMHO, and most of the time it isn't at least not 
when building Qt.

>What is your reason to use LTO? Can you avoid using it?

In this case it's mostly to obtain the most compact build possible, esp. since 
I'm using a static build of libQtHelp . On Linux the size difference is 
considerable for the assistant executable (a factor 2-3 IIRC). It's not a great 
deal otherwise, just something I like to understand.

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


Re: [Interest] QMake, (static) libraries and LTCG (LTO) on Mac

2017-11-11 Thread Konstantin Tokarev


> On Saturday November 11 2017 16:12:38 Konstantin Tokarev wrote:
> 
>> Note that you should be able to build whole qttools module against any Qt 
>> install. It should work without any modifications.
> 
> That's what I'd expect but not really what I'm looking for here. I could try 
> it once to see if I get the same LTO-related failures, though.

Well, LTO and missing symbols go hand in hand, you should be ready to deal with 
such errors.

What is your reason to use LTO? Can you avoid using it?

> 
> FWIW, I found that I had to remove the `help` module from the `QT` line in 
> assistant.pro because otherwise the linker would use the installed version 
> (5.8.0 in my case, which evidently lacks some API). That surprised me a bit, 
> I would have expected that qmake knows how to link the library from the same 
> project, given that it's marked as a dependency for the assistant target.
> 
> R.
-- 
Regards,
Konstantin
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QMake, (static) libraries and LTCG (LTO) on Mac

2017-11-11 Thread René J . V . Bertin
On Saturday November 11 2017 16:12:38 Konstantin Tokarev wrote:

>Note that you should be able to build whole qttools module against any Qt 
>install. It should work without any modifications.

That's what I'd expect but not really what I'm looking for here. I could try it 
once to see if I get the same LTO-related failures, though.

FWIW, I found that I had to remove the `help` module from the `QT` line in 
assistant.pro because otherwise the linker would use the installed version 
(5.8.0 in my case, which evidently lacks some API). That surprised me a bit, I 
would have expected that qmake knows how to link the library from the same 
project, given that it's marked as a dependency for the assistant target.

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


Re: [Interest] QMake, (static) libraries and LTCG (LTO) on Mac

2017-11-11 Thread Konstantin Tokarev


> Hi,
> 
> I have made some tweaks to the qttools/src/assistant directories so that I 
> can build the Assistant as a standalone application against any Qt install.

Note that you should be able to build whole qttools module against any Qt 
install. It should work without any modifications.

>To do that, I removed the qtNomakeTools(), load(qt_module) and load(qt_app) 
>statements from the relevant .pro files, set up QtHelp to build as a static 
>library and removed the `help` from `QT` in the Assistant's .pro file, 
>replacing that with `LIB += -L../help -lQHelp`.
> 
> That works, and on Linux I can build the resulting application with LTO by 
> adding `-config ltcg` to the qmake invocation. On Mac however that leads to a 
> whole list of missing symbol errors in the final link step, all from the 
> QtHelp library.
> 
> Am I doing something wrong or am I simply hitting a limitation?
> 
> Thanks,
> René
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
-- 
Regards,
Konstantin
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] QMake, (static) libraries and LTCG (LTO) on Mac

2017-11-11 Thread René J . V . Bertin
Hi,

I have made some tweaks to the qttools/src/assistant directories so that I can 
build the Assistant as a standalone application against any Qt install. To do 
that, I removed the qtNomakeTools(), load(qt_module) and load(qt_app) 
statements from the relevant .pro files, set up QtHelp to build as a static 
library and removed the `help` from `QT` in the Assistant's .pro file, 
replacing that with `LIB += -L../help -lQHelp`.

That works, and on Linux I can build the resulting application with LTO by 
adding `-config ltcg` to the qmake invocation. On Mac however that leads to a 
whole list of missing symbol errors in the final link step, all from the QtHelp 
library.

Am I doing something wrong or am I simply hitting a limitation?

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