Optimize debug builds when -Og is available
Enables optimizing with -Og if GCC has the option available, this should produce faster debug binaries without compromising debugability. Is a privateConfig to limit it to the default Qt build. Includes two fixes for false positives of maybe_uninitialized triggered by -Og on gcc 4.9. Change-Id: I466d7a4070295714189024369312e6cbd36cfacf Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
parent
aab8e304ea
commit
d03ba0e895
@ -72,6 +72,8 @@ Build options:
|
|||||||
-debug ............... Build Qt with debugging turned on [no]
|
-debug ............... Build Qt with debugging turned on [no]
|
||||||
-debug-and-release ... Build two versions of Qt, with and without
|
-debug-and-release ... Build two versions of Qt, with and without
|
||||||
debugging turned on [yes] (Apple and Windows only)
|
debugging turned on [yes] (Apple and Windows only)
|
||||||
|
-optimize-debug ...... Enable debug-friendly optimizations in debug builds
|
||||||
|
[auto] (Not supported with MSVC)
|
||||||
-optimized-tools ..... Build optimized host tools even in debug build [no]
|
-optimized-tools ..... Build optimized host tools even in debug build [no]
|
||||||
-force-debug-info .... Create symbol files for release builds [no]
|
-force-debug-info .... Create symbol files for release builds [no]
|
||||||
-separate-debug-info . Split off debug information to separate files [no]
|
-separate-debug-info . Split off debug information to separate files [no]
|
||||||
|
@ -93,6 +93,7 @@
|
|||||||
"mp": { "type": "boolean", "name": "msvc_mp" },
|
"mp": { "type": "boolean", "name": "msvc_mp" },
|
||||||
"nomake": { "type": "addString", "values": [ "examples", "tests", "tools" ] },
|
"nomake": { "type": "addString", "values": [ "examples", "tests", "tools" ] },
|
||||||
"opensource": { "type": "void", "name": "commercial", "value": "no" },
|
"opensource": { "type": "void", "name": "commercial", "value": "no" },
|
||||||
|
"optimize-debug": { "type": "boolean", "name": "optimize_debug" },
|
||||||
"optimized-qmake": { "type": "boolean", "name": "release_tools" },
|
"optimized-qmake": { "type": "boolean", "name": "release_tools" },
|
||||||
"optimized-tools": { "type": "boolean", "name": "release_tools" },
|
"optimized-tools": { "type": "boolean", "name": "release_tools" },
|
||||||
"pch": { "type": "boolean", "name": "precompile_header" },
|
"pch": { "type": "boolean", "name": "precompile_header" },
|
||||||
@ -263,6 +264,11 @@
|
|||||||
"type": "compilerSupportsFlag",
|
"type": "compilerSupportsFlag",
|
||||||
"flag": "-fuse-ld=gold"
|
"flag": "-fuse-ld=gold"
|
||||||
},
|
},
|
||||||
|
"optimize_debug": {
|
||||||
|
"label": "-Og support",
|
||||||
|
"type": "compilerSupportsFlag",
|
||||||
|
"flag": "-Og"
|
||||||
|
},
|
||||||
"enable_new_dtags": {
|
"enable_new_dtags": {
|
||||||
"label": "new dtags support",
|
"label": "new dtags support",
|
||||||
"type": "linkerSupportsFlag",
|
"type": "linkerSupportsFlag",
|
||||||
@ -479,6 +485,11 @@
|
|||||||
"condition": "!config.msvc && !config.integrity && tests.use_gold_linker",
|
"condition": "!config.msvc && !config.integrity && tests.use_gold_linker",
|
||||||
"output": [ "privateConfig", "useGoldLinker" ]
|
"output": [ "privateConfig", "useGoldLinker" ]
|
||||||
},
|
},
|
||||||
|
"optimize_debug": {
|
||||||
|
"label": "Optimize debug build",
|
||||||
|
"condition": "!config.msvc && (features.debug || features.debug_and_release) && tests.optimize_debug",
|
||||||
|
"output": [ "privateConfig" ]
|
||||||
|
},
|
||||||
"architecture": {
|
"architecture": {
|
||||||
"label": "Architecture",
|
"label": "Architecture",
|
||||||
"output": [ "architecture" ]
|
"output": [ "architecture" ]
|
||||||
@ -1078,6 +1089,11 @@ Configure with '-qreal float' to create a build that is binary-compatible with 5
|
|||||||
"message": "Mode",
|
"message": "Mode",
|
||||||
"type": "buildMode"
|
"type": "buildMode"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "feature",
|
||||||
|
"args": "optimize_debug",
|
||||||
|
"condition": "!config.msvc && (features.debug || features.debug_and_release)"
|
||||||
|
},
|
||||||
"shared",
|
"shared",
|
||||||
{
|
{
|
||||||
"message": "Using C++ standard",
|
"message": "Using C++ standard",
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
|
|
||||||
QMAKE_CFLAGS_OPTIMIZE = -O2
|
QMAKE_CFLAGS_OPTIMIZE = -O2
|
||||||
QMAKE_CFLAGS_OPTIMIZE_FULL = -O3
|
QMAKE_CFLAGS_OPTIMIZE_FULL = -O3
|
||||||
|
QMAKE_CFLAGS_OPTIMIZE_DEBUG = -Og
|
||||||
|
|
||||||
QMAKE_CFLAGS += -pipe
|
QMAKE_CFLAGS += -pipe
|
||||||
QMAKE_CFLAGS_DEPS += -M
|
QMAKE_CFLAGS_DEPS += -M
|
||||||
|
@ -47,6 +47,11 @@ optimize_full {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
optimize_debug {
|
||||||
|
QMAKE_CFLAGS_DEBUG += $$QMAKE_CFLAGS_OPTIMIZE_DEBUG
|
||||||
|
QMAKE_CXXFLAGS_DEBUG += $$QMAKE_CFLAGS_OPTIMIZE_DEBUG
|
||||||
|
}
|
||||||
|
|
||||||
debug {
|
debug {
|
||||||
QMAKE_CFLAGS += $$QMAKE_CFLAGS_DEBUG
|
QMAKE_CFLAGS += $$QMAKE_CFLAGS_DEBUG
|
||||||
QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_DEBUG
|
QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_DEBUG
|
||||||
|
@ -1273,7 +1273,7 @@ const uchar *QFontEngine::getCMap(const uchar *table, uint tableSize, bool *isSy
|
|||||||
if (!qSafeFromBigEndian(maps + 8 * n, endPtr, &platformId))
|
if (!qSafeFromBigEndian(maps + 8 * n, endPtr, &platformId))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
quint16 platformSpecificId;
|
quint16 platformSpecificId = 0;
|
||||||
if (!qSafeFromBigEndian(maps + 8 * n + 2, endPtr, &platformSpecificId))
|
if (!qSafeFromBigEndian(maps + 8 * n + 2, endPtr, &platformSpecificId))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ void EventReader::run()
|
|||||||
{
|
{
|
||||||
Qt::MouseButtons buttons;
|
Qt::MouseButtons buttons;
|
||||||
|
|
||||||
xcb_generic_event_t *event;
|
xcb_generic_event_t *event = nullptr;
|
||||||
while (running.load() && (event = xcb_wait_for_event(m_integration->connection()))) {
|
while (running.load() && (event = xcb_wait_for_event(m_integration->connection()))) {
|
||||||
uint response_type = event->response_type & ~0x80;
|
uint response_type = event->response_type & ~0x80;
|
||||||
switch (response_type) {
|
switch (response_type) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user