summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-extended/minifi-cpp
diff options
context:
space:
mode:
authorYi Zhao <yi.zhao@windriver.com>2020-10-28 13:26:04 +0800
committerKhem Raj <raj.khem@gmail.com>2020-11-02 09:00:51 -0800
commitc697727db79465b4df11dabf701e56277469b9bd (patch)
tree83859d6950588de230d9e9c60db90e6a11e1282b /meta-oe/recipes-extended/minifi-cpp
parent260809cffdaad4fcd42b0977090f2c467a5474ef (diff)
downloadmeta-openembedded-c697727db79465b4df11dabf701e56277469b9bd.tar.gz
minifi-cpp: specify GCC_AR and GCC_RANLIB
We encountered a minifi-cpp build error on a self-hosted image: [snip] /build/tmp-glibc/work/corei7-64-wrs-linux/minifi-cpp/0.7.0-r0/recipe-sysroot-native/usr/bin/x86_64-wrs-linux/x86_64-wrs-linux-ranlib: thirdparty/civetweb-1.10/src/libcivetweb-cpp.a(CivetServer.cpp.o): plugin needed to handle lto object /build/tmp-glibc/work/corei7-64-wrs-linux/minifi-cpp/0.7.0-r0/recipe-sysroot-native/usr/bin/x86_64-wrs-linux/x86_64-wrs-linux-ranlib: thirdparty/civetweb-1.10/src/libcivetweb.a(civetweb.c.o): plugin needed to handle lto object [snip] /build/tmp-glibc/work/corei7-64-wrs-linux/minifi-cpp/0.7.0-r0/recipe-sysroot-native/usr/bin/x86_64-wrs-linux/../../libexec/x86_64-wrs-linux/gcc/x86_64-wrs-linux/10.2.0/ld: DWARF error: could not find variable specification at offset c960f /build/tmp-glibc/work/corei7-64-wrs-linux/minifi-cpp/0.7.0-r0/recipe-sysroot-native/usr/bin/x86_64-wrs-linux/../../libexec/x86_64-wrs-linux/gcc/x86_64-wrs-linux/10.2.0/ld: DWARF error: could not find variable specification at offset c961d [snip] extensions/civetweb/libminifi-civet-extensions.a(ListenHTTP.cpp.o): in function `org::apache::nifi::minifi::processors::ListenHTTP::WriteCallback::process(std::shared_ptr<org::apache::nifi::minifi::io::BaseStream>)': /usr/src/debug/minifi-cpp/0.7.0-r0/git/extensions/civetweb/processors/ListenHTTP.cpp:464: undefined reference to `mg_read' [snip] When using GCC's link-time optimization with static linked libraries, we should use gcc-ar and gcc-ranlib to create the static libraries. By default, it will search gcc-ar and gcc-ranlib in the system. But if the gcc-ranlib is not found, it will use ranlib instead which causes this issue. Specify GCC_AR and GCC_RANLIB in EXTRA_OECMAKE to make sure it can find the correct gcc-ar/gcc-ranlib. Signed-off-by: Yi Zhao <yi.zhao@windriver.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-extended/minifi-cpp')
-rw-r--r--meta-oe/recipes-extended/minifi-cpp/files/0001-civetweb-CMakeLists.txt-do-not-search-gcc-ar-and-gcc.patch34
-rw-r--r--meta-oe/recipes-extended/minifi-cpp/minifi-cpp_0.7.0.bb3
2 files changed, 37 insertions, 0 deletions
diff --git a/meta-oe/recipes-extended/minifi-cpp/files/0001-civetweb-CMakeLists.txt-do-not-search-gcc-ar-and-gcc.patch b/meta-oe/recipes-extended/minifi-cpp/files/0001-civetweb-CMakeLists.txt-do-not-search-gcc-ar-and-gcc.patch
new file mode 100644
index 0000000000..bc480d9699
--- /dev/null
+++ b/meta-oe/recipes-extended/minifi-cpp/files/0001-civetweb-CMakeLists.txt-do-not-search-gcc-ar-and-gcc.patch
@@ -0,0 +1,34 @@
1From 0eee3fb85dad084b6b42f7b219d8aa3a62620a27 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Wed, 28 Oct 2020 09:52:40 +0800
4Subject: [PATCH] civetweb/CMakeLists.txt: do not search gcc-ar and gcc-ranlib
5
6Do not search gcc-ar and gcc-ranlib. Specify GCC_AR and GCC_RANLIB in
7EXTRA_OECMAKE to avoid host contamination.
8
9Upstream-Status: Inappropriate [embedded specific]
10
11Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
12---
13 thirdparty/civetweb-1.10/CMakeLists.txt | 2 --
14 1 file changed, 2 deletions(-)
15
16diff --git a/thirdparty/civetweb-1.10/CMakeLists.txt b/thirdparty/civetweb-1.10/CMakeLists.txt
17index f559a04e..0689e3f6 100644
18--- a/thirdparty/civetweb-1.10/CMakeLists.txt
19+++ b/thirdparty/civetweb-1.10/CMakeLists.txt
20@@ -246,11 +246,9 @@ set_property(CACHE CIVETWEB_CXX_STANDARD PROPERTY STRINGS auto c++14 c++11 c++98
21
22 # Configure the linker
23 if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
24- find_program(GCC_AR gcc-ar)
25 if (GCC_AR)
26 set(CMAKE_AR ${GCC_AR})
27 endif()
28- find_program(GCC_RANLIB gcc-ranlib)
29 if (GCC_RANLIB)
30 set(CMAKE_RANLIB ${GCC_RANLIB})
31 endif()
32--
332.17.1
34
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 9113fa67ad..9b66c48e37 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
@@ -27,6 +27,7 @@ SRC_URI = "git://github.com/apache/nifi-minifi-cpp.git \
27 file://0001-CMakeLists.txt-use-curl-local-source-tarball.patch \ 27 file://0001-CMakeLists.txt-use-curl-local-source-tarball.patch \
28 file://0002-cmake-LibreSSL.cmake-use-libressl-local-source-tarba.patch \ 28 file://0002-cmake-LibreSSL.cmake-use-libressl-local-source-tarba.patch \
29 file://0003-cmake-BundledOSSPUUID.cmake-use-ossp-uuid-local-sour.patch \ 29 file://0003-cmake-BundledOSSPUUID.cmake-use-ossp-uuid-local-sour.patch \
30 file://0001-civetweb-CMakeLists.txt-do-not-search-gcc-ar-and-gcc.patch \
30 file://minifi.service \ 31 file://minifi.service \
31 file://systemd-volatile.conf \ 32 file://systemd-volatile.conf \
32 file://sysvinit-volatile.conf \ 33 file://sysvinit-volatile.conf \
@@ -52,6 +53,8 @@ OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "BOTH"
52EXTRA_OECMAKE += " \ 53EXTRA_OECMAKE += " \
53 -DHOST_SYS=${HOST_SYS} -DBUILD_SYS=${BUILD_SYS} \ 54 -DHOST_SYS=${HOST_SYS} -DBUILD_SYS=${BUILD_SYS} \
54 -DSKIP_TESTS=ON \ 55 -DSKIP_TESTS=ON \
56 -DGCC_AR=${STAGING_BINDIR_TOOLCHAIN}/${AR} \
57 -DGCC_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${RANLIB} \
55 " 58 "
56EXTRA_OECMAKE_append_toolchain-clang = " -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ranlib" 59EXTRA_OECMAKE_append_toolchain-clang = " -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ranlib"
57LDFLAGS_append_toolchain-clang = " -fuse-ld=lld" 60LDFLAGS_append_toolchain-clang = " -fuse-ld=lld"