diff --git a/CMakeLists.txt b/CMakeLists.txt index 06297c95..5e9c1703 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -152,9 +152,6 @@ endif() include(cxxopts) -# Lpeg -include(lpeg) - # libyaml include(libyaml) diff --git a/cmake/modules/lpeg.cmake b/cmake/modules/lpeg.cmake deleted file mode 100644 index 58df982c..00000000 --- a/cmake/modules/lpeg.cmake +++ /dev/null @@ -1,28 +0,0 @@ -# -# Copyright (C) 2020 The Falco Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the -# specific language governing permissions and limitations under the License. -# - -set(LPEG_SRC "${PROJECT_BINARY_DIR}/lpeg-prefix/src/lpeg") -set(LPEG_LIB "${PROJECT_BINARY_DIR}/lpeg-prefix/src/lpeg/build/lpeg.a") -message(STATUS "Using bundled lpeg in '${LPEG_SRC}'") -set(LPEG_DEPENDENCIES "") -list(APPEND LPEG_DEPENDENCIES "luajit") -ExternalProject_Add( - lpeg - DEPENDS ${LPEG_DEPENDENCIES} - URL "http://www.inf.puc-rio.br/~roberto/lpeg/lpeg-1.0.2.tar.gz" - URL_HASH "SHA256=48d66576051b6c78388faad09b70493093264588fcd0f258ddaab1cdd4a15ffe" - BUILD_COMMAND LUA_INCLUDE=${LUAJIT_INCLUDE} "${PROJECT_SOURCE_DIR}/scripts/build-lpeg.sh" "${LPEG_SRC}/build" - BUILD_IN_SOURCE 1 - BUILD_BYPRODUCTS ${LPEG_LIB} - CONFIGURE_COMMAND "" - INSTALL_COMMAND "") diff --git a/scripts/build-lpeg.sh b/scripts/build-lpeg.sh deleted file mode 100755 index 6f924d88..00000000 --- a/scripts/build-lpeg.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env bash -# -# Copyright (C) 2019 The Falco Authors. -# -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -set -ex - -PREFIX=$1 - -if [ -z "$PREFIX" ]; then - PREFIX=. -fi - -mkdir -p $PREFIX - -gcc -O2 -fPIC -I"$LUA_INCLUDE" -c lpcap.c -o $PREFIX/lpcap.o -gcc -O2 -fPIC -I"$LUA_INCLUDE" -c lpcode.c -o $PREFIX/lpcode.o -gcc -O2 -fPIC -I"$LUA_INCLUDE" -c lpprint.c -o $PREFIX/lpprint.o -gcc -O2 -fPIC -I"$LUA_INCLUDE" -c lptree.c -o $PREFIX/lptree.o -gcc -O2 -fPIC -I"$LUA_INCLUDE" -c lpvm.c -o $PREFIX/lpvm.o - - -# For building lpeg.so, which we don't need now that we're statically linking lpeg.a into falco -#gcc -shared -o lpeg.so -L/usr/local/lib lpcap.o lpcode.o lpprint.o lptree.o lpvm.o -#gcc -shared -o lpeg.so -L/usr/local/lib lpcap.o lpcode.o lpprint.o lptree.o lpvm.o - -pushd $PREFIX -/usr/bin/ar cr lpeg.a lpcap.o lpcode.o lpprint.o lptree.o lpvm.o -/usr/bin/ranlib lpeg.a -popd - -chmod ug+w re.lua diff --git a/userspace/engine/CMakeLists.txt b/userspace/engine/CMakeLists.txt index 2e1ceced..40a8d106 100644 --- a/userspace/engine/CMakeLists.txt +++ b/userspace/engine/CMakeLists.txt @@ -22,7 +22,7 @@ set(FALCO_ENGINE_SOURCE_FILES formats.cpp) add_library(falco_engine STATIC ${FALCO_ENGINE_SOURCE_FILES}) -add_dependencies(falco_engine njson lyaml lpeg string-view-lite) +add_dependencies(falco_engine njson lyaml string-view-lite) if(USE_BUNDLED_DEPS) add_dependencies(falco_engine libyaml) @@ -55,4 +55,4 @@ else() "${PROJECT_BINARY_DIR}/userspace/engine/lua") endif() -target_link_libraries(falco_engine "${FALCO_SINSP_LIBRARY}" "${LPEG_LIB}" "${LYAML_LIB}" "${LIBYAML_LIB}" luafiles) +target_link_libraries(falco_engine "${FALCO_SINSP_LIBRARY}" "${LYAML_LIB}" "${LIBYAML_LIB}" luafiles) diff --git a/userspace/engine/falco_engine.cpp b/userspace/engine/falco_engine.cpp index 3944e7f0..c9934c60 100644 --- a/userspace/engine/falco_engine.cpp +++ b/userspace/engine/falco_engine.cpp @@ -49,7 +49,6 @@ falco_engine::falco_engine(bool seed_rng) m_sampling_ratio(1), m_sampling_multiplier(0), m_replace_container_info(false) { - luaopen_lpeg(m_ls); luaopen_yaml(m_ls); falco_common::init(); diff --git a/userspace/engine/lpeg.h b/userspace/engine/lpeg.h deleted file mode 100644 index 88601b00..00000000 --- a/userspace/engine/lpeg.h +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright (C) 2019 The Falco Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -#pragma once - -#include "lua.h" - -int luaopen_lpeg (lua_State *L); - diff --git a/userspace/falco/CMakeLists.txt b/userspace/falco/CMakeLists.txt index 34010155..c6634851 100644 --- a/userspace/falco/CMakeLists.txt +++ b/userspace/falco/CMakeLists.txt @@ -47,7 +47,6 @@ set( libyaml b64 luajit - lpeg lyaml cxxopts )