From 41f0df9572bf3d0035829c60784e5155acdf3856 Mon Sep 17 00:00:00 2001 From: Exynox Date: Mon, 18 Nov 2024 06:12:29 +0000 Subject: [PATCH] Switched to CLang in order to make cryptopp compile (issues with FPU on GCC) --- Dockerfile | 10 +++++++--- src/libsql/include/CStatement.h | 2 +- src/libsql/src/CStatement.cpp | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index eaacc64..256e12c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,14 +8,18 @@ RUN echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https: # Update the system and install various dependencies RUN apt-get update && \ - apt-get install -y git cmake ninja-build build-essential tar curl zip unzip pkg-config autoconf python3 \ + apt-get install -y git cmake ninja-build clang tar curl zip unzip pkg-config autoconf python3 \ libdevil-dev libncurses5-dev libbsd-dev # Arm specific ENV VCPKG_FORCE_SYSTEM_BINARIES=1 +# Set clang as default compiler +RUN update-alternatives --set cc /usr/bin/clang +RUN update-alternatives --set c++ /usr/bin/clang++ + # Install vcpkg and the required libraries -RUN git clone https://github.com/Microsoft/vcpkg.git +RUN git clone --depth 1 https://github.com/Microsoft/vcpkg.git RUN bash ./vcpkg/bootstrap-vcpkg.sh RUN ./vcpkg/vcpkg install cryptopp effolkronium-random libmariadb libevent lzo fmt spdlog argon2 @@ -23,7 +27,7 @@ COPY . . # Build the binaries RUN mkdir build/ -RUN cd build && cmake -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake .. +RUN cd build && cmake -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Debug .. RUN cd build && make -j $(nproc) FROM ubuntu:22.04 AS app diff --git a/src/libsql/include/CStatement.h b/src/libsql/include/CStatement.h index 4938400..58a15e3 100644 --- a/src/libsql/include/CStatement.h +++ b/src/libsql/include/CStatement.h @@ -32,7 +32,7 @@ class CStmt std::vector m_vec_param; unsigned int m_uiParamCount; - uint64_t * m_puiParamLen; + unsigned long * m_puiParamLen; std::vector m_vec_result; unsigned int m_uiResultCount; diff --git a/src/libsql/src/CStatement.cpp b/src/libsql/src/CStatement.cpp index 4f666ed..89ecad4 100644 --- a/src/libsql/src/CStatement.cpp +++ b/src/libsql/src/CStatement.cpp @@ -59,7 +59,7 @@ bool CStmt::Prepare(CAsyncSQL * sql, const char * c_pszQuery) m_vec_param.resize(iParamCount); memset(&m_vec_param[0], 0, sizeof(MYSQL_BIND) * iParamCount); - m_puiParamLen = (uint64_t *) calloc(iParamCount, sizeof(uint64_t)); + m_puiParamLen = (unsigned long *) calloc(iParamCount, sizeof(unsigned long)); } m_vec_result.resize(48);