diff --git a/libs/CMakeLists.txt b/libs/CMakeLists.txt index b947dd0c9..399a2fe84 100644 --- a/libs/CMakeLists.txt +++ b/libs/CMakeLists.txt @@ -215,6 +215,8 @@ import_external_library(libbcrypt STATIC import_external_library(mgclient STATIC ${CMAKE_CURRENT_SOURCE_DIR}/mgclient/lib/libmgclient.a ${CMAKE_CURRENT_SOURCE_DIR}/mgclient/include - CMAKE_ARGS -DBUILD_TESTING=OFF) + CMAKE_ARGS -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} + -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} + -DBUILD_TESTING=OFF) find_package(OpenSSL REQUIRED) target_link_libraries(mgclient INTERFACE ${OPENSSL_LIBRARIES}) diff --git a/libs/setup.sh b/libs/setup.sh index 54431ee7c..4c9f83cb1 100755 --- a/libs/setup.sh +++ b/libs/setup.sh @@ -135,3 +135,4 @@ sed -i 's/TARGETS ${ROCKSDB_SHARED_LIB}/TARGETS ${ROCKSDB_SHARED_LIB} OPTIONAL/' mgclient_tag="fe94b3631385ef5dbe40a3d8458860dbcc33e6ea" # May 27, 2019 # git clone https://github.com/memgraph/mgclient.git clone git://deps.memgraph.io/mgclient.git mgclient $mgclient_tag +sed -i 's/\${CMAKE_INSTALL_LIBDIR}/lib/' mgclient/src/CMakeLists.txt diff --git a/src/auth/module.cpp b/src/auth/module.cpp index 0cd293c9d..8c1930569 100644 --- a/src/auth/module.cpp +++ b/src/auth/module.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -133,7 +134,9 @@ const std::vector kSeccompSyscallsBlacklist = { SCMP_SYS(kexec_load), SCMP_SYS(mknodat), SCMP_SYS(unshare), +#ifdef SYS_seccomp SCMP_SYS(seccomp), +#endif }; bool SetupSeccomp() { diff --git a/src/memgraph.cpp b/src/memgraph.cpp index 1245f1c59..f49c9d317 100644 --- a/src/memgraph.cpp +++ b/src/memgraph.cpp @@ -15,12 +15,6 @@ #include #include -#include "communication/bolt/v1/exceptions.hpp" -#include "communication/bolt/v1/session.hpp" -#include "communication/init.hpp" -#include "communication/server.hpp" -#include "communication/session.hpp" -#include "glue/communication.hpp" #include "helpers.hpp" #include "py/py.hpp" #include "query/exceptions.hpp" @@ -39,6 +33,24 @@ #include "utils/terminate_handler.hpp" #include "version.hpp" +// Communication libraries must be included after query libraries are included. +// This is to enable compilation of the binary when linking with old OpenSSL +// libraries (as on CentOS 7). +// +// The OpenSSL library available on CentOS 7 is v1.0.0, that version includes +// `libkrb5` in its public API headers (that we include in our communication +// stack). The `libkrb5` library has `#define`s for `TRUE` and `FALSE`. Those +// defines clash with Antlr's usage of `TRUE` and `FALSE` as enumeration keys. +// Because of that the definitions of `TRUE` and `FALSE` that are inherited +// from `libkrb5` must be included after the Antlr includes. Hence, +// communication headers must be included after query headers. +#include "communication/bolt/v1/exceptions.hpp" +#include "communication/bolt/v1/session.hpp" +#include "communication/init.hpp" +#include "communication/server.hpp" +#include "communication/session.hpp" +#include "glue/communication.hpp" + #ifdef MG_ENTERPRISE #include "audit/log.hpp" #include "auth/auth.hpp"