minifi-cpp: Disable lto.

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 <raj.khem@gmail.com>
This commit is contained in:
Khem Raj
2022-09-06 20:49:52 -07:00
parent 62db1c041f
commit 5b73deaf18
2 changed files with 39 additions and 2 deletions

View File

@@ -0,0 +1,33 @@
From 120c708d51f72ade4a31d3d8f35bcfad7b12e723 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
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 <raj.khem@gmail.com>
---
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)

View File

@@ -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}