Build with clang and --with-address-sanitizer requires c99 compatible libm

I want to build cpython 3.13 with clang and --with-address-sanitizer, because I want to do some fuzzing and catch some bugs.

my problem is that I get always the following error

22.05 checking for acosh... no
22.09 configure: error: Python requires C99 compatible libm

I try to build cpython in the following Dockerfile:

FROM ubuntu:latest

RUN apt-get update
RUN apt-get install -y clang
RUN apt-get install -y build-essential
RUN apt-get install -y git

RUN git clone https://github.com/python/cpython.git 

WORKDIR cpython

RUN git checkout 3.13

RUN mkdir -p install ; ./configure  CC=$(which clang) --with-cxx-main=$(which clang++) --with-pydebug --prefix=$PWD/install --with-address-sanitizer --disable-ipv6  && make -j install

Does anyone know what I’m missing?

I tried putting clang c99 compatible libm into a search engine. The first result I got was this thread; the second was a github issue. Does it help?

Thank you :slight_smile: it helped. my google search for the same question did not show this result.

This is my current Dockerfile if anyone has the same problem:

FROM ubuntu:latest

RUN echo deb-src http://archive.ubuntu.com/ubuntu/ jammy main >> /etc/apt/sources.list

RUN apt-get update
RUN apt-get install -y clang-14 libclang-rt-14-dev
RUN apt-get install -y build-essential
RUN apt-get install -y git
RUN apt-get install -y build-essential gdb lcov pkg-config \
      libbz2-dev libffi-dev libgdbm-dev libgdbm-compat-dev liblzma-dev \
      libncurses5-dev libreadline6-dev libsqlite3-dev libssl-dev \
      lzma lzma-dev tk-dev uuid-dev zlib1g-dev 

RUN git clone https://github.com/python/cpython.git 

WORKDIR cpython

RUN git checkout 3.13


run mkdir -p install ; \
     CC="$(which clang-14) -fno-sanitize=vptr" \
     CXX="$(which clang++-14) -fno-sanitize=vptr" \
     ./configure \
     --with-pydebug \
     --prefix=$PWD/install \
     --with-memory-sanitizer \
     --disable-ipv6  && make -j install

I have now sanitizer errors :slight_smile: