Fix glibc 2.34 compatibility.

This commit is contained in:
Kishore Nallan 2021-12-06 20:54:42 +05:30
parent 281dc55593
commit e63193606d
4 changed files with 23 additions and 18 deletions

View File

@ -22,7 +22,7 @@ if [[ "$@" == *"--depclean"* ]]; then
fi
TYPESENSE_DEV_IMAGE="typesense-development:04-DEC-2021-1"
TYPESENSE_DEV_IMAGE="typesense-development:06-DEC-2021-1"
if [[ "$@" == *"--graviton2"* ]]; then
TYPESENSE_DEV_IMAGE="typesense-development-arm:03-DEC-2021-1"
fi

View File

@ -72,14 +72,15 @@ RUN tar -C /opt -xf /opt/elfutils-0.182.tar.bz2
RUN cd /opt/elfutils-0.182 && ./configure --disable-libdebuginfod --disable-debuginfod --without-lzma --without-bzlib && \
make -j8 && make install && rm -rf /usr/local/lib/*.so*
ADD https://github.com/apache/incubator-brpc/archive/0.9.7-rc03.tar.gz /opt/brpc-0.9.7-rc03.tar.gz
RUN tar -C /opt -xf /opt/brpc-0.9.7-rc03.tar.gz
COPY patches/brpc_cmakelists.txt /opt/incubator-brpc-0.9.7-rc03/src/CMakeLists.txt
RUN chown root:root /opt/incubator-brpc-0.9.7-rc03/src/CMakeLists.txt
RUN mkdir -p /opt/incubator-brpc-0.9.7-rc03/bld && cd /opt/incubator-brpc-0.9.7-rc03/bld && \
ADD https://github.com/typesense/incubator-brpc/archive/7d4d601.tar.gz /opt/brpc-7d4d601.tar.gz
RUN tar -C /opt -xf /opt/brpc-7d4d601.tar.gz
COPY patches/brpc_cmakelists.txt /opt/incubator-brpc-7d4d60126bcc0aefbef9fa8b3bc784bff18540be/src/CMakeLists.txt
RUN chown root:root /opt/incubator-brpc-7d4d60126bcc0aefbef9fa8b3bc784bff18540be/src/CMakeLists.txt
RUN mkdir -p /opt/incubator-brpc-7d4d60126bcc0aefbef9fa8b3bc784bff18540be/bld && \
cd /opt/incubator-brpc-7d4d60126bcc0aefbef9fa8b3bc784bff18540be/bld && \
cmake -DWITH_DEBUG_SYMBOLS=OFF -DWITH_GLOG=ON .. && \
make -j8 && make install && rm -rf /usr/local/lib/*.so* && \
rm -rf /opt/incubator-brpc-0.9.7-rc03/bld/output/bin
rm -rf /opt/incubator-brpc-7d4d60126bcc0aefbef9fa8b3bc784bff18540be/bld/output/bin
ADD https://github.com/typesense/braft/archive/938eeb5.tar.gz /opt/braft-938eeb5.tar.gz
RUN tar -C /opt -xf /opt/braft-938eeb5.tar.gz

View File

@ -74,14 +74,15 @@ RUN tar -C /opt -xf /opt/elfutils-0.182.tar.bz2
RUN cd /opt/elfutils-0.182 && ./configure --disable-libdebuginfod --disable-debuginfod --without-lzma --without-bzlib \
&& make -j8 && make install && rm -rf /usr/local/lib/*.so*
ADD https://github.com/apache/incubator-brpc/archive/0.9.7-rc03.tar.gz /opt/brpc-0.9.7-rc03.tar.gz
RUN tar -C /opt -xf /opt/brpc-0.9.7-rc03.tar.gz
COPY patches/brpc_cmakelists.txt /opt/incubator-brpc-0.9.7-rc03/src/CMakeLists.txt
RUN chown root:root /opt/incubator-brpc-0.9.7-rc03/src/CMakeLists.txt
RUN mkdir -p /opt/incubator-brpc-0.9.7-rc03/bld && cd /opt/incubator-brpc-0.9.7-rc03/bld && \
ADD https://github.com/typesense/incubator-brpc/archive/7d4d601.tar.gz /opt/brpc-7d4d601.tar.gz
RUN tar -C /opt -xf /opt/brpc-7d4d601.tar.gz
COPY patches/brpc_cmakelists.txt /opt/incubator-brpc-7d4d60126bcc0aefbef9fa8b3bc784bff18540be/src/CMakeLists.txt
RUN chown root:root /opt/incubator-brpc-7d4d60126bcc0aefbef9fa8b3bc784bff18540be/src/CMakeLists.txt
RUN mkdir -p /opt/incubator-brpc-7d4d60126bcc0aefbef9fa8b3bc784bff18540be/bld && \
cd /opt/incubator-brpc-7d4d60126bcc0aefbef9fa8b3bc784bff18540be/bld && \
cmake -DWITH_DEBUG_SYMBOLS=OFF -DWITH_GLOG=ON .. && \
make -j8 && make install && rm -rf /usr/local/lib/*.so* && \
rm -rf /opt/incubator-brpc-0.9.7-rc03/bld/output/bin
rm -rf /opt/incubator-brpc-7d4d60126bcc0aefbef9fa8b3bc784bff18540be/bld/output/bin
ADD https://github.com/typesense/braft/archive/938eeb5.tar.gz /opt/braft-938eeb5.tar.gz
RUN tar -C /opt -xf /opt/braft-938eeb5.tar.gz

View File

@ -25,18 +25,21 @@ HttpServer* server;
std::atomic<bool> quit_raft_service;
extern "C" {
typedef int (*mallctl_t)(const char *name, void *oldp, size_t *oldlenp, void *newp, size_t newlen);
// weak symbol: resolved at runtime by the linker if we are using jemalloc, nullptr otherwise
#ifdef __APPLE__
int je_mallctl(const char *name, void *oldp, size_t *oldlenp, void *newp, size_t newlen) __attribute__((weak_import));
#else
int mallctl(const char *name, void *oldp, size_t *oldlenp, void *newp, size_t newlen) __attribute__((weak));
#endif
}
bool using_jemalloc() {
// On OSX, jemalloc API is prefixed with "je_"
mallctl_t mallctl;
#ifdef __APPLE__
mallctl = (mallctl_t) ::dlsym(RTLD_DEFAULT, "je_mallctl");
return (je_mallctl != nullptr);
#else
mallctl = (mallctl_t) ::dlsym(RTLD_DEFAULT, "mallctl");
#endif
return (mallctl != nullptr);
#endif
}
void catch_interrupt(int sig) {