diff mbox series

[oe,meta-qt5,1/2] maliit-framework-qt5: Always have optimize flags

Message ID 20170712211501.45048-1-raj.khem@gmail.com
State New
Headers show
Series [oe,meta-qt5,1/2] maliit-framework-qt5: Always have optimize flags | expand

Commit Message

Khem Raj July 12, 2017, 9:15 p.m. UTC
When building with hardening flags we need some optlevel > 0
enabled, otherwise FORTIFY_SOURCE wont work

Fixes
maliit-framework-qt5/0.99.0+git999-r0/recipe-sysroot/usr/include/features.h:376:4: error: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp
]
|  #  warning _FORTIFY_SOURCE requires compiling with optimization (-O)
|     ^~~~~~~

Signed-off-by: Khem Raj <raj.khem@gmail.com>

---
 ...ig.pri-Use-O1-optimization-in-DEBUG-flags.patch | 34 ++++++++++++++++++++++
 recipes-qt/maliit/maliit-framework-qt5_git.bb      |  8 ++---
 2 files changed, 38 insertions(+), 4 deletions(-)
 create mode 100644 recipes-qt/maliit/maliit-framework-qt5/0001-config.pri-Use-O1-optimization-in-DEBUG-flags.patch

-- 
2.13.2

-- 
_______________________________________________
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
diff mbox series

Patch

diff --git a/recipes-qt/maliit/maliit-framework-qt5/0001-config.pri-Use-O1-optimization-in-DEBUG-flags.patch b/recipes-qt/maliit/maliit-framework-qt5/0001-config.pri-Use-O1-optimization-in-DEBUG-flags.patch
new file mode 100644
index 0000000..7356034
--- /dev/null
+++ b/recipes-qt/maliit/maliit-framework-qt5/0001-config.pri-Use-O1-optimization-in-DEBUG-flags.patch
@@ -0,0 +1,34 @@ 
+From cb38c078fa34a3d0cff6bc195edd9f507477d2e1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 12 Jul 2017 11:45:06 -0700
+Subject: [PATCH] config.pri: Use -O1 optimization in DEBUG flags
+
+when building wit FORTIFY_SOURCES we need some level of
+optimization turned on for the compile to succeed
+
+O1 is a good compromise between debug quality and
+optimization level.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ config.pri | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/config.pri b/config.pri
+index 1505f9d..7cc196a 100644
+--- a/config.pri
++++ b/config.pri
+@@ -13,8 +13,8 @@ include(defines.pri)
+ # Linker optimization for release build
+ QMAKE_LFLAGS_RELEASE+=-Wl,--as-needed
+ # Compiler warnings are error if the build type is debug
+-QMAKE_CXXFLAGS_DEBUG+=-Werror -O0
+-QMAKE_CFLAGS_DEBUG+=-Werror -O0
++QMAKE_CXXFLAGS_DEBUG+=-Werror -O1
++QMAKE_CFLAGS_DEBUG+=-Werror -O1
+ 
+ OBJECTS_DIR = .obj
+ MOC_DIR = .moc
+-- 
+2.13.2
+
diff --git a/recipes-qt/maliit/maliit-framework-qt5_git.bb b/recipes-qt/maliit/maliit-framework-qt5_git.bb
index 62a7209..e0a0e0e 100644
--- a/recipes-qt/maliit/maliit-framework-qt5_git.bb
+++ b/recipes-qt/maliit/maliit-framework-qt5_git.bb
@@ -7,9 +7,10 @@  LIC_FILES_CHKSUM = "file://LICENSE.LGPL;md5=5c917f6ce94ceb8d8d5e16e2fca5b9ad"
 inherit qmake5 qmake5_paths
 
 SRC_URI = "git://github.com/maliit/framework.git;branch=master \
-    file://0001-Fix-MALIIT_INSTALL_PRF-to-allow-the-build-with-opene.patch \
-    file://maliit-server.desktop \
-"
+           file://0001-Fix-MALIIT_INSTALL_PRF-to-allow-the-build-with-opene.patch \
+           file://maliit-server.desktop \
+           file://0001-config.pri-Use-O1-optimization-in-DEBUG-flags.patch \
+           "
 
 SRCREV = "60b1b10de14f932420313c547ab801daf522d539"
 PV = "0.99.0+git${SRCPV}"
@@ -57,7 +58,6 @@  EXTRA_QMAKEVARS_PRE = "\
     CONFIG+=enable-dbus-activation \
     CONFIG+=qt5-inputcontext \
 "
-
 EXTRA_OEMAKE += "INSTALL_ROOT=${D}"
 
 do_install_append() {