Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions ci_build_images/msan.fragment.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ENV CXXFLAGS="$CFLAGS"

# hadolint ignore=SC2046,DL3003
RUN . /etc/os-release \
&& export LLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
&& export LLVM_ENABLE_RUNTIMES="libcxx;libcxxabi" \
&& mkdir "$MSAN_LIBDIR" \
&& curl -sL https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor -o /usr/share/keyrings/llvm-snapshot.gpg \
&& if [ "$VERSION_CODENAME" = forky ]; then VERSION_CODENAME=unstable; LLVM_DEB=""; else LLVM_DEB="-$VERSION_CODENAME"; fi \
Expand Down Expand Up @@ -54,6 +54,7 @@ RUN . /etc/os-release \
&& cd ll-build \
&& cmake -S ../"$LLVM_DIR"*/runtimes \
-DCMAKE_BUILD_TYPE=Release \
-DLIBCXXABI_USE_LLVM_UNWINDER=OFF \
-DLLVM_ENABLE_RUNTIMES="${LLVM_ENABLE_RUNTIMES}" \
-DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_ENABLE_SPHINX=OFF \
-DLLVM_USE_SANITIZER=MemoryWithOrigins \
Expand All @@ -63,13 +64,6 @@ RUN . /etc/os-release \
&& cd .. \
&& rm -rf -- *

RUN for f in "$MSAN_LIBDIR"/libunwind*; do mv "$f" "$f"-disable; done; \
if [ "${CLANG_VERSION}" -ge 22 ]; then \
apt-get -y install --no-install-recommends libunwind-19; \
fi
# libunwind move/disable because of https://github.com/llvm/llvm-project/issues/128621
# libunwind-19 meets ABI compatibility as its now linked to built executables.

COPY msan.instrumentedlibs.sh /msan-build
RUN ./msan.instrumentedlibs.sh

Expand Down
28 changes: 25 additions & 3 deletions ci_build_images/msan.instrumentedlibs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ make -j "$(nproc)"
cp -aL .libs/libxml2.so* "$MSAN_LIBDIR"
rm -rf -- *

# Unixodbc used by MariaDB Connect engine.
# Unixodbc used by MariaDB Connect engine and C/ODBC.
if [ "${VERSION_CODENAME}" = trixie ]; then
# additional dependency in later debian versions.
# libltdl-dev - System independent dlopen wrapper for GNU libtool
Expand All @@ -107,9 +107,31 @@ aclocal
autoheader
autoconf
automake --add-missing
./configure --enable-fastvalidate --with-pth=no --with-included-ltdl=no
./configure --enable-fastvalidate --with-pth=no --with-included-ltdl=yes
make -j "$(nproc)"
mv ./DriverManager/.libs/libodbc.so* "$MSAN_LIBDIR"
find .
mv ./DriverManager/.libs/libodbc.so* ./odbcinst/.libs/libodbcinst.so* "$MSAN_LIBDIR"
rm -rf -- *

##libltdl - C/ODBC
## libodbc does a fixed path load of /lib/x86_64-linux-gnu/libltdl.so.7, which
## isn't the instrumented version, so changed --with-included-ltdl=yes above.
#apt-get source libltdl-dev
#mv libtool-*/* .
#./bootstrap --force --no-git --skip-po --gnulib-srcdir=/usr/share/gnulib/ --copy
#./configure
#make -j "$(nproc)"
#mv ./libltdl/.libs/libltdl.so* "$MSAN_LIBDIR"
#rm -rf -- *

# sqlite/odbc for CONNECT engine
apt-get source libsqliteodbc
mv sqliteodbc-*/* .
mk-build-deps -it 'apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes'
autoreconf --install .
./configure
make -j "$(nproc)"
mv ./.libs/libsqlite3odbc.so* "$MSAN_LIBDIR"
rm -rf -- *

# libfmt - used by server for SFORMAT function
Expand Down