Commit Graph

8 Commits

Author SHA1 Message Date
Allan Sandfeld Jensen
b6cf8cb794 Clang_cl: Use -O3 for full optimization
Pass it through as a traditional clang argument instead of relying on
what MSVC cl.exe can take.

Change-Id: I94405ce6ab80d16b687e62c9aa4b2866ba84f0e2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-04 16:59:29 +00:00
Yuhang Zhao
b43988ada2 Clang: use -Oz instead of -O1 to optimize for size
Change-Id: I60fecba64e968d10b87a9c1af571ff4a3aa98ad7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-03-21 23:46:32 +00:00
Yuhang Zhao
6a210e0329 clang-cl: Enable linker optimization explicitly
In release mode, MSVC linker will enable it by default
while clang-cl won't. So enable it explicitly.

Change-Id: Iabfd8698d426290fee59662acf6c124b9f226c11
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-03-21 10:16:08 +00:00
Yuhang Zhao
36827faa18 Clang: Add Thin LTO in addition to Full LTO
Change-Id: I6502f3ff31c16faebd9b931b99b77a273971f611
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-03-20 17:21:08 +00:00
Mårten Nordheim
61af5abb33 clang-cl: use GCC -m CPU feature flag option
To enable non-default options

Change-Id: I2d2f5dc8368a8235fd91e7f9986df4402612a823
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-01-16 14:23:50 +00:00
Yuhang Zhao
b34143f8a1 Fix clang LTCG config on Windows
To enable LTCG, clang-cl.exe need "-flto" instead of "-GL". But if you
enabled LTO, the lib tool will have to change to "llvm-lib.exe" and the
link tool also need to change to "lld-link.exe", because msvc linker
will see these lib files as corrupted files. Leave QMAKE_LFLAGS_LTCG
empty because lld-link doesn't need any additional parameters.

Fixes: QTBUG-72402
Change-Id: Ia34d98bd1ad919d542ea3eac83944bf8c40ce0cd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-12-16 10:40:03 +00:00
Alexander Shevchenko
7ff3032b22 unify windows mkspecs: define c++ flags explicitly
with 40e87491 merged, 'QMAKE_CXXFLAGS' variable in
'win32-g++' toolchain became defined via 'QMAKE_CFLAGS'.
the similar can be found in 'win32-clang-msvc' and
'win32-icc' toolchains too.

this works for now, because such definitions just duplicates code
from includes, like 'gcc-base.conf', 'msvc-desktop.conf', etc.
but it would became broken, if changes would be applied to
'QMAKE_CXXFLAGS' definitions in that includes, prior
to the redefinitions in 'win32-*/qmake.conf' toolchains.

thus 'QMAKE_CXXFLAGS' definitions in 'win32-*/qmake.conf' toolchains
should not depend on 'QMAKE_CFLAGS' and be done explicitly.

in order to apply this change correctly to 'win32-icc' toolchain,
its 'QMAKE_CFLAGS' variable should become dependent on definitions
in the includes, similar to 'win32-clang-msvc' and
'win32-msvc' toolchains.

Change-Id: I5e820e44a769a590ba63f70dcb3a115311093311
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-02-22 18:45:15 +00:00
Thiago Macieira
04403d5b12 Merge all "win32-msvc*" mkspecs into one
Since we can tell the MSVC version from the compiler now, each of the
qmake.conf files is now the same, so let's just have "win32-msvc" and be
future-proof. Likewise for win32-clang-msvc.

qplatformdefs.h was already common.

Since we can't obtain the MSVC version from the unified mkspec name any
more, I dropped the warning level during the qmake bootstrap to reduce
the number of warnings that need to be disabled from compiler version to
version.

There is no point in keeping the old mkspecs, but configure will re-map
the -platform argument to the unified spec as necessary, to keep
existing configure command lines working.

[ChangeLog][Visual Studio] Qt now has a common mkspec for all Visual
Studio versions, called "win32-msvc". The old names which contained the
version number are now gone (but qmake scopes based on the old names
continue to work). The version of the compiler can be obtained from the
MSC_VER and MSVC_VER variables (for example, for Visual Studio 2015,
those contain the values 1900 and 14.0, respectively). Those variables
are also available with the Intel compiler (win32-icc) and with Clang
(win32-clang-msvc).

Done-with: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Change-Id: Ib57b52598e2f452985e9fffd14587c0a77a5c09c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2016-12-23 13:45:39 +00:00