@@ -41,7 +41,6 @@ RUN apt-get -y update && \
4141 cmake \
4242 git \
4343 python3 \
44- python3-pip \
4544 wget
4645
4746# Install CMake 3.24.0 (needed by LIEF 0.16.6)
@@ -53,30 +52,23 @@ RUN wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cm
5352 ln -s /opt/cmake/bin/cmake /usr/bin/cmake && \
5453 rm cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz
5554
56- RUN pip install conan==1.59 && \
57- conan profile new default --detect && \
58- conan remote add rewriting_remote https://git.grammatech.com/api/v4/packages/conan
59-
6055ENV LIEF_VERSION="0.16.6"
6156
62- RUN echo "[requires]\n\
63- lief/${LIEF_VERSION}@rewriting+extra-packages/stable\n\
64- \n\
65- [generators]\n\
66- CMakeDeps\n\
67- CMakeToolchain" > /tmp/conanfile.txt
68-
69- RUN conan install /tmp/conanfile.txt \
70- --build=missing \
71- --remote=rewriting_remote \
72- -pr:b=default -pr:h=default
73-
74- RUN PKG_DIR=$(find /root/.conan/data/lief/${LIEF_VERSION}/rewriting+extra-packages/stable/package -mindepth 1 -maxdepth 1 -type d) && \
75- mkdir -p /opt/lief-pkg && \
76- cp -a $PKG_DIR/include /opt/lief-pkg/ && \
77- cp -a $PKG_DIR/lib /opt/lief-pkg/ && \
78- cp -a $PKG_DIR/lib/cmake /opt/lief-pkg/ && \
79- cp -a $PKG_DIR/lib/pkgconfig /opt/lief-pkg/ || true
57+ RUN git clone -b ${LIEF_VERSION} --depth 1 https://github.com/lief-project/LIEF.git /usr/local/src/LIEF
58+
59+ WORKDIR /usr/local/src/LIEF
60+
61+ # Apply a fix from the main branch to resolve a build error related to `noexcept`.
62+ # The commit 6877ce7aba037074954bc63102c9d45b73d63b0b cherry-picked from upstream.
63+ # TODO: Remove this workaround once LIEF includes the fix in an official release.
64+ RUN git config --global user.email "build@example.com" && \
65+ git config --global user.name "Automated Build" && \
66+ git remote add upstream https://github.com/lief-project/LIEF.git && \
67+ git fetch upstream 6877ce7aba037074954bc63102c9d45b73d63b0b && \
68+ git cherry-pick 6877ce7aba037074954bc63102c9d45b73d63b0b
69+
70+ RUN cmake -DLIEF_PYTHON_API=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF /usr/local/src/LIEF -B/usr/local/src/LIEF/build && \
71+ cmake --build /usr/local/src/LIEF/build -j4 --target install
8072
8173# ------------------------------------------------------------------------------
8274# Build libehp
@@ -176,9 +168,9 @@ RUN python3 -m pip install --no-cache-dir --upgrade pip && \
176168
177169COPY --from=souffle /usr/local/bin/souffle* /usr/local/bin/
178170COPY --from=souffle /usr/local/include/souffle/ /usr/include/souffle
179- COPY --from=lief /opt/lief-pkg /lib/libLIEF.a /usr/lib/libLIEF.a
180- COPY --from=lief /opt/lief-pkg /lib/cmake/LIEF /usr/lib/cmake/LIEF
181- COPY --from=lief /opt/lief-pkg /include/LIEF /usr/include/LIEF
171+ COPY --from=lief /usr /lib/libLIEF.a /usr/lib/libLIEF.a
172+ COPY --from=lief /usr /lib/cmake/LIEF /usr/lib/cmake/LIEF
173+ COPY --from=lief /usr /include/LIEF /usr/include/LIEF
182174COPY --from=libehp /usr/local/lib /usr/local/lib
183175COPY --from=libehp /usr/local/include /usr/local/include
184176COPY --from=UASM /usr/local/bin/uasm /usr/local/bin/uasm
0 commit comments