summaryrefslogtreecommitdiff
path: root/.github/dockerfiles/Dockerfile.clang
blob: 92607dd6bb67d39f7ed8fb50fb8ca3d906a252ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
ARG BASE=docker.pkg.github.com/erlang/otp/ubuntu-base
FROM $BASE
## We do a SSA lint check here
ENV ERL_COMPILER_OPTIONS=ssalint

ARG MAKEFLAGS=-j4
ENV MAKEFLAGS=$MAKEFLAGS \
    ERLC_USE_SERVER=yes \
    ERL_TOP=/buildroot/otp \
    PATH=/otp/bin:/buildroot/otp/bin:$PATH

RUN sudo apt-get install -y clang

ARG ARCHIVE=./otp.tar.gz
COPY $ARCHIVE /buildroot/otp.tar.gz
RUN cd /buildroot && tar -xzf ./otp.tar.gz

WORKDIR /buildroot/otp/

ENV CC=clang CXX=clang++ \
        CFLAGS="-O2 -g -Werror"

## Configure, check that no application are disabled and then make
# We need --with-ssl-lib-subdir=lib/x86_64-linux-gnu since clang does not
# give us this information such as gcc does...
RUN  ./configure --with-ssl --with-ssl-lib-subdir=lib/x86_64-linux-gnu --prefix=/otp && \
        if cat lib/*/CONF_INFO || cat lib/*/SKIP || cat lib/SKIP-APPLICATIONS; then exit 1; fi && \
    make && sudo make install && \
    make FLAVOR=emu && sudo make install FLAVOR=emu

## Disable -Werror as testcases do not compile with it on
ENV CFLAGS="-O2 -g"