Created
January 20, 2022 20:23
-
-
Save cveilleux/3690f085e6cbb6fd74d50611a87f56db to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 6ed4c5ff2d7133038d084ea9c2147bad24b3ed2c Mon Sep 17 00:00:00 2001 | |
From: Cedric Veilleux <[email protected]> | |
Date: Wed, 19 Jan 2022 12:55:55 -0500 | |
Subject: [PATCH] Revert "build: support native cross-compilation for ARM64 | |
(#3152)" | |
This reverts commit bfce2316d93a3ead43965d5034676200269f93c0. | |
--- | |
CMakeLists.txt | 8 ++++---- | |
cmake/linux-arm64.cmake | 17 ----------------- | |
cmake/luajit.cmake | 2 +- | |
cmake/onigmo.cmake | 8 ++++---- | |
4 files changed, 9 insertions(+), 26 deletions(-) | |
delete mode 100644 cmake/linux-arm64.cmake | |
diff --git a/CMakeLists.txt b/CMakeLists.txt | |
index e8208963..b0cb2dbb 100644 | |
--- a/CMakeLists.txt | |
+++ b/CMakeLists.txt | |
@@ -666,9 +666,9 @@ if(FLB_JEMALLOC AND ${CMAKE_SYSTEM_NAME} MATCHES "Linux") | |
# Link to Jemalloc as an external dependency | |
ExternalProject_Add(jemalloc | |
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib/jemalloc-5.2.1 | |
- CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/lib/jemalloc-5.2.1/configure ${AUTOCONF_HOST_OPT} --host=${HOST} --with-lg-quantum=3 --prefix=<INSTALL_DIR> | |
+ CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/lib/jemalloc-5.2.1/configure ${AUTOCONF_HOST_OPT} --with-lg-quantum=3 --prefix=<INSTALL_DIR> | |
CFLAGS=-std=gnu99\ -Wall\ -pipe\ -g3\ -O3\ -funroll-loops | |
- BUILD_COMMAND $(MAKE) CC=${CMAKE_C_COMPILER} | |
+ BUILD_COMMAND $(MAKE) | |
INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/ | |
INSTALL_COMMAND $(MAKE) install_lib_static install_include) | |
add_library(libjemalloc STATIC IMPORTED GLOBAL) | |
@@ -692,8 +692,8 @@ if(FLB_BACKTRACE) | |
endif() | |
ExternalProject_Add(backtrace | |
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib/libbacktrace-ca0de05/ | |
- CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/lib/libbacktrace-ca0de05/configure ${AUTOCONF_HOST_OPT} --host=${HOST} --prefix=<INSTALL_DIR> --enable-shared=no --enable-static=yes | |
- BUILD_COMMAND $(MAKE) CC=${DEPS_C_COMPILER} | |
+ CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/lib/libbacktrace-ca0de05/configure ${AUTOCONF_HOST_OPT} --prefix=<INSTALL_DIR> --enable-shared=no --enable-static=yes | |
+ BUILD_COMMAND $(MAKE) | |
INSTALL_COMMAND $(MAKE) DESTDIR= install | |
) | |
add_library(libbacktrace STATIC IMPORTED GLOBAL) | |
diff --git a/cmake/linux-arm64.cmake b/cmake/linux-arm64.cmake | |
deleted file mode 100644 | |
index d21e176b..00000000 | |
--- a/cmake/linux-arm64.cmake | |
+++ /dev/null | |
@@ -1,17 +0,0 @@ | |
-SET(HOST aarch64-linux-gnu) | |
- | |
-SET(CROSS_PREFIX ${HOST}-) | |
-SET(CMAKE_SYSROOT /) | |
- | |
-SET(CMAKE_SYSTEM_NAME Linux) | |
-SET(CMAKE_C_COMPILER ${CROSS_PREFIX}gcc) | |
-SET(CMAKE_CXX_COMPILER ${CROSS_PREFIX}g++) | |
- | |
-SET(CMAKE_FIND_ROOT_PATH /usr/lib/aarch64-linux-gnu /usr/aarch64-linux-gnu /lib/aarch64-linux-gnu) | |
-SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | |
-SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | |
-SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) | |
-SET(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) | |
- | |
-SET(PKG_CONFIG_EXECUTABLE "/usr/bin/aarch64-linux-gnu-pkg-config" CACHE FILEPATH "pkg-config executable") | |
-SET(PKG_CONFIG_PATH /usr/lib/aarch64-linux-gnu/pkgconfig) | |
diff --git a/cmake/luajit.cmake b/cmake/luajit.cmake | |
index 8cc3ac5f..ac359779 100644 | |
--- a/cmake/luajit.cmake | |
+++ b/cmake/luajit.cmake | |
@@ -30,7 +30,7 @@ ExternalProject_Add(luajit | |
EXCLUDE_FROM_ALL TRUE | |
SOURCE_DIR ${LUAJIT_SRC} | |
CONFIGURE_COMMAND ./configure | |
- BUILD_COMMAND $(MAKE) CROSS=${CROSS_PREFIX} CFLAGS=${CFLAGS} BUILD_MODE=static "XCFLAGS=-fPIC" ${DEPLOYMENT_TARGET} | |
+ BUILD_COMMAND $(MAKE) CC=${CMAKE_C_COMPILER} CFLAGS=${CFLAGS} BUILD_MODE=static "XCFLAGS=-fPIC" | |
INSTALL_COMMAND cp src/libluajit.a "${LUAJIT_DEST}/lib/libluajit.a") | |
# luajit (Windows) | |
diff --git a/cmake/onigmo.cmake b/cmake/onigmo.cmake | |
index efa59644..dd9cb311 100644 | |
--- a/cmake/onigmo.cmake | |
+++ b/cmake/onigmo.cmake | |
@@ -33,9 +33,9 @@ ExternalProject_Add(onigmo | |
EXCLUDE_FROM_ALL TRUE | |
SOURCE_DIR ${ONIGMO_SRC} | |
INSTALL_DIR ${ONIGMO_DEST} | |
- CONFIGURE_COMMAND ./configure ${AUTOCONF_HOST_OPT} --host=${HOST} --with-pic --disable-shared --enable-static --prefix=${ONIGMO_DEST} | |
+ CONFIGURE_COMMAND ./configure ${AUTOCONF_HOST_OPT} --with-pic --disable-shared --enable-static --prefix=${ONIGMO_DEST} | |
CFLAGS=-std=gnu99\ -Wall\ -pipe\ -Os\ -g0\ -s\ -fno-stack-protector\ -fomit-frame-pointer\ -DNDEBUG\ -U_FORTIFY_SOURCE | |
- BUILD_COMMAND $(MAKE) CC=${DEPS_C_COMPILER} | |
+ BUILD_COMMAND $(MAKE) | |
INSTALL_COMMAND $(MAKE) DESTDIR= install) | |
else() | |
ExternalProject_Add(onigmo | |
@@ -43,9 +43,9 @@ ExternalProject_Add(onigmo | |
EXCLUDE_FROM_ALL TRUE | |
SOURCE_DIR ${ONIGMO_SRC} | |
INSTALL_DIR ${ONIGMO_DEST} | |
- CONFIGURE_COMMAND ./configure ${AUTOCONF_HOST_OPT} --host=${HOST} --with-pic --disable-shared --enable-static --prefix=${ONIGMO_DEST} | |
+ CONFIGURE_COMMAND ./configure ${AUTOCONF_HOST_OPT} --with-pic --disable-shared --enable-static --prefix=${ONIGMO_DEST} | |
CFLAGS=-std=gnu99\ -Wall\ -pipe\ -g3\ -O3\ -funroll-loops | |
- BUILD_COMMAND $(MAKE) CC=${DEPS_C_COMPILER} | |
+ BUILD_COMMAND $(MAKE) | |
INSTALL_COMMAND $(MAKE) DESTDIR= install) | |
endif() | |
-- | |
2.25.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Fluent Bit - Yocto / Bitbake | |
# ============================ | |
# The following Bitbake package the latest Fluent Bit stable release. | |
SUMMARY = "Fast Log processor and Forwarder" | |
DESCRIPTION = "Fluent Bit is a data collector, processor and \ | |
forwarder for Linux. It supports several input sources and \ | |
backends (destinations) for your data. \ | |
" | |
HOMEPAGE = "http://fluentbit.io" | |
BUGTRACKER = "https://github.com/fluent/fluent-bit/issues" | |
LICENSE = "Apache-2.0" | |
LIC_FILES_CHKSUM = "file://LICENSE;md5=2ee41112a44fe7014dce33e26468ba93" | |
SECTION = "net" | |
PR = "r0" | |
PV = "1.8.9" | |
SRCREV = "v${PV}" | |
SRC_URI = "git://github.com/fluent/fluent-bit.git;nobranch=1 \ | |
" | |
SRC_URI_append = " \ | |
file://0001-Revert-build-support-native-cross-compilation-for-AR.patch \ | |
" | |
S = "${WORKDIR}/git" | |
DEPENDS = "zlib bison-native flex-native openssl" | |
DEPENDS_append_libc-musl = " fts " | |
INSANE_SKIP_${PN}-dev += "dev-elf" | |
# Use CMake 'Unix Makefiles' generator | |
OECMAKE_GENERATOR ?= "Unix Makefiles" | |
# Fluent Bit build options | |
# ======================== | |
# Host related setup | |
EXTRA_OECMAKE += "-DGNU_HOST=${HOST_SYS} -DFLB_ALL=ON -DFLB_TD=" | |
# Disable LuaJIT and filter_lua support | |
EXTRA_OECMAKE += "-DFLB_LUAJIT=Off -DFLB_FILTER_LUA=Off " | |
# Disable Library and examples | |
EXTRA_OECMAKE += "-DFLB_SHARED_LIB=Off -DFLB_EXAMPLES=Off " | |
# Systemd support (optional) | |
DEPENDS += "systemd" | |
EXTRA_OECMAKE += "-DFLB_IN_SYSTEMD=On " | |
SYSTEMD_SERVICE_${PN} = "fluent-bit.service" | |
inherit cmake systemd features_check | |
# by-passes errors "FORTIFY_SOURCE requires compiling with optimization (-O)" | |
TARGET_CC_ARCH_append = " ${SELECTED_OPTIMIZATION}" | |
TARGET_CC_ARCH_remove = "-D_FORTIFY_SOURCE=2" | |
# https://github.com/fluent/fluent-bit/issues/4204 | |
EXTRA_OECMAKE += "-DFLB_DEBUG=Off " | |
EXTRA_OECMAKE += "-DFLB_RELEASE=On " | |
# Disable modules we don't need | |
EXTRA_OECMAKE += "-DFLB_OUT_STACKDRIVER=Off " | |
EXTRA_OECMAKE += "-DFLB_OUT_SPLUNK=Off " | |
EXTRA_OECMAKE += "-DFLB_OUT_LOKI=Off " | |
EXTRA_OECMAKE += "-DFLB_OUT_ES=Off " | |
EXTRA_OECMAKE += "-DFLB_OUT_PROMETHEUS_EXPORTER=Off " | |
EXTRA_OECMAKE += "-DFLB_IN_TAIL=Off " | |
EXTRA_OECMAKE += "-DFLB_IN_DOCKER_EVENTS=Off " | |
# FLB_HTTP_SERVER can NOT be disabled, as there will be compilation failures without. | |
#EXTRA_OECMAKE += "-DFLB_HTTP_SERVER=Off " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment