File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ RUN wget --no-verbose https://git.kernel.org/torvalds/t/linux-5.18-rc6.tar.gz
55RUN wget --no-verbose https://musl.libc.org/releases/musl-1.2.3.tar.gz
66RUN wget --no-verbose https://zlib.net/zlib-1.2.12.tar.gz
77RUN wget --no-verbose https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.1/llvm-project-14.0.1.src.tar.xz
8+ RUN wget --no-verbose https://github.com/jemalloc/jemalloc/releases/download/5.3.0/jemalloc-5.3.0.tar.bz2
89
910FROM ${BASE} AS stage2
1011FROM docker.io/alpine:edge AS stage3
@@ -60,6 +61,19 @@ RUN make -C ${ZLIB_DIR} -j$(nproc)
6061RUN make -C ${ZLIB_DIR} -j$(nproc) install
6162RUN apk del make
6263
64+ ### Jemalloc
65+ COPY --from=source jemalloc-5.3.0.tar.bz2 .
66+ RUN tar xf jemalloc-5.3.0.tar.bz2
67+ ARG JEMALLOC_DIR=jemalloc-5.3.0/build
68+ RUN mkdir -p ${JEMALLOC_DIR}
69+ RUN cd ${JEMALLOC_DIR} && \
70+ CC=clang AR=llvm-ar NM=llvm-nm CPPFLAGS=${SYSROOT} LDFLAGS=${SYSROOT} \
71+ ../configure --disable-libdl --prefix=/usr
72+ RUN apk add make
73+ RUN make -C ${JEMALLOC_DIR} -j$(nproc) build_lib_static
74+ RUN make -C ${JEMALLOC_DIR} -j$(nproc) DESTDIR=/sysroot install_lib_static
75+ RUN apk del make
76+
6377### LLVM
6478COPY --from=source llvm-project-14.0.1.src.tar.xz .
6579RUN tar xf llvm-project-14.0.1.src.tar.xz && \
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ set(CMAKE_CXX_FLAGS "--sysroot=/sysroot" CACHE STRING "")
1313set (CMAKE_C_FLAGS "--sysroot=/sysroot" CACHE STRING "" )
1414
1515# Statically link resulting executable.
16- set (CMAKE_EXE_LINKER_FLAGS "-static -lc++abi" CACHE STRING "" )
16+ set (CMAKE_EXE_LINKER_FLAGS "-static -lc++abi -ljemalloc " CACHE STRING "" )
1717
1818# The compiler builtins are necessary.
1919set (COMPILER_RT_BUILD_BUILTINS ON CACHE BOOL "" )
You can’t perform that action at this time.
0 commit comments