lto does not work always. Its enabled only in civetweb and no where
else. Fow cosnsitent builds disable it everywhere.

Signed-off-by: Khem Raj <[email protected]>
---
 .../files/0001-civetweb-Disable-lto.patch     | 33 +++++++++++++++++++
 .../minifi-cpp/minifi-cpp_0.7.0.bb            |  8 +++--
 2 files changed, 39 insertions(+), 2 deletions(-)
 create mode 100644 
meta-oe/recipes-extended/minifi-cpp/files/0001-civetweb-Disable-lto.patch

diff --git 
a/meta-oe/recipes-extended/minifi-cpp/files/0001-civetweb-Disable-lto.patch 
b/meta-oe/recipes-extended/minifi-cpp/files/0001-civetweb-Disable-lto.patch
new file mode 100644
index 0000000000..ec4e6ffc45
--- /dev/null
+++ b/meta-oe/recipes-extended/minifi-cpp/files/0001-civetweb-Disable-lto.patch
@@ -0,0 +1,33 @@
+From 120c708d51f72ade4a31d3d8f35bcfad7b12e723 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 6 Sep 2022 20:38:03 -0700
+Subject: [PATCH] civetweb: Disable lto
+
+lto does not work everywhere, therefore disable it atleast in the cmake
+file, we can still enable it via environment
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ thirdparty/civetweb-1.10/CMakeLists.txt | 4 ----
+ 1 file changed, 4 deletions(-)
+
+--- a/thirdparty/civetweb-1.10/CMakeLists.txt
++++ b/thirdparty/civetweb-1.10/CMakeLists.txt
+@@ -298,7 +298,6 @@ add_c_compiler_flag(/WX)
+ add_c_compiler_flag(-pedantic-errors)
+ add_c_compiler_flag(-fvisibility=hidden)
+ add_c_compiler_flag(-fstack-protector-strong RELEASE)
+-add_c_compiler_flag(-flto RELEASE)
+ 
+ add_c_compiler_flag(-fstack-protector-all DEBUG)
+ if (MINGW)
+@@ -361,7 +360,6 @@ if (CIVETWEB_ENABLE_CXX)
+   add_cxx_compiler_flag(-pedantic-errors)
+   add_cxx_compiler_flag(-fvisibility=hidden)
+   add_cxx_compiler_flag(-fstack-protector-strong RELEASE)
+-  add_cxx_compiler_flag(-flto RELEASE)
+ 
+   add_cxx_compiler_flag(-fstack-protector-all DEBUG)
+   if (MINGW)
diff --git a/meta-oe/recipes-extended/minifi-cpp/minifi-cpp_0.7.0.bb 
b/meta-oe/recipes-extended/minifi-cpp/minifi-cpp_0.7.0.bb
index 8fc253908f..3b57ceace6 100644
--- a/meta-oe/recipes-extended/minifi-cpp/minifi-cpp_0.7.0.bb
+++ b/meta-oe/recipes-extended/minifi-cpp/minifi-cpp_0.7.0.bb
@@ -30,6 +30,7 @@ SRC_URI = 
"git://github.com/apache/nifi-minifi-cpp.git;branch=master;protocol=ht
             
file://0001-civetweb-CMakeLists.txt-do-not-search-gcc-ar-and-gcc.patch \
             file://0001-cxxopts-Add-limits-header.patch \
             file://0001-Fix-build-with-libc.patch \
+            file://0001-civetweb-Disable-lto.patch \
             file://minifi.service \
             file://systemd-volatile.conf \
             file://sysvinit-volatile.conf \
@@ -80,10 +81,13 @@ do_install[cleandirs] += "${WORKDIR}/minifi-install"
 PSEUDO_CONSIDER_PATHS .= ",${WORKDIR}/minifi-install"
 
 do_configure:prepend:libc-musl() {
-    sed -i -e 's/-DHAVE_GLIBC_STRERROR_R=1/-DHAVE_GLIBC_STRERROR_R=0/' 
${S}/CMakeLists.txt
-    sed -i -e 's/-DHAVE_POSIX_STRERROR_R=0/-DHAVE_POSIX_STRERROR_R=1/' 
${S}/CMakeLists.txt
+    sed -i -e 's/-DHAVE_GLIBC_STRERROR_R=?/-DHAVE_GLIBC_STRERROR_R=0/' 
${S}/CMakeLists.txt
+    sed -i -e 's/-DHAVE_POSIX_STRERROR_R=?/-DHAVE_POSIX_STRERROR_R=1/' 
${S}/CMakeLists.txt
 }
 
+CFLAGS:append:libc-glibc = " -D_GNU_SOURCE"
+CXXFLAGS:append:libc-glibc = " -D_GNU_SOURCE"
+
 do_install() {
     DESTDIR='${WORKDIR}/minifi-install' cmake_runcmake_build --target 
${OECMAKE_TARGET_INSTALL}
     MINIFI_BIN=${bindir}
-- 
2.37.3

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#98699): 
https://lists.openembedded.org/g/openembedded-devel/message/98699
Mute This Topic: https://lists.openembedded.org/mt/93537566/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to