Skip to content

Commit 8f827b8

Browse files
committed
Merge branch 'lief_0_16_6' into 'main'
Update LIEF to 0.16.6 Closes #626 See merge request rewriting/ddisasm!1240
2 parents e7991ed + 1415660 commit 8f827b8

15 files changed

+301
-147
lines changed

.ci/Dockerfile.conan-ubuntu20

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ RUN python3 -m pip install --no-cache-dir --upgrade pip && \
6565
python3 -m pip install --no-cache-dir \
6666
pyyaml \
6767
psycopg2-binary \
68-
lief==0.13.2
68+
lief==0.16.6
6969

7070
COPY --from=UASM /usr/local/bin/uasm /usr/local/bin/uasm
7171
COPY etc/sstrip /usr/bin/sstrip

.ci/Dockerfile.manylinux2010

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
FROM quay.io/pypa/manylinux2010_x86_64
22

3-
RUN yum install ccache ninja-build -y
3+
RUN yum install -y \
4+
ccache \
5+
ninja-build \
6+
wget
47

58
ENV PATH="${PATH}:/opt/python/cp39-cp39/bin/"
9+
10+
ENV CMAKE_VERSION=3.24.0
11+
RUN wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz && \
12+
tar -xzf cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz && \
13+
mv cmake-${CMAKE_VERSION}-linux-x86_64 /opt/cmake && \
14+
rm /usr/local/bin/cmake && \
15+
ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake && \
16+
rm cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz

.ci/Dockerfile.static

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ RUN git clone -b 2.4 https://github.com/souffle-lang/souffle && \
2929
make -C build install -j4
3030

3131
# ------------------------------------------------------------------------------
32-
# Build LIEF
32+
# Install LIEF
3333
# ------------------------------------------------------------------------------
3434
FROM ubuntu:20.04 AS lief
3535

@@ -40,11 +40,43 @@ RUN apt-get -y update && \
4040
build-essential \
4141
cmake \
4242
git \
43-
python3
44-
45-
RUN git clone -b 0.13.2 --depth 1 https://github.com/lief-project/LIEF.git /usr/local/src/LIEF && \
46-
cmake -DLIEF_PYTHON_API=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF /usr/local/src/LIEF -B/usr/local/src/LIEF/build && \
47-
cmake --build /usr/local/src/LIEF/build -j --target install
43+
python3 \
44+
python3-pip \
45+
wget
46+
47+
# Install CMake 3.24.0 (needed by LIEF 0.16.6)
48+
ENV CMAKE_VERSION=3.24.0
49+
RUN wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz && \
50+
tar -xzf cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz && \
51+
mv cmake-${CMAKE_VERSION}-linux-x86_64 /opt/cmake && \
52+
rm /usr/bin/cmake && \
53+
ln -s /opt/cmake/bin/cmake /usr/bin/cmake && \
54+
rm cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz
55+
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+
60+
ENV LIEF_VERSION="0.16.6"
61+
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
4880

4981
# ------------------------------------------------------------------------------
5082
# Build libehp
@@ -140,13 +172,13 @@ RUN python3 -m pip install --no-cache-dir --upgrade pip && \
140172
python3 -m pip install --no-cache-dir \
141173
pyyaml \
142174
psycopg2-binary \
143-
lief==0.13.2
175+
lief==0.16.6
144176

145177
COPY --from=souffle /usr/local/bin/souffle* /usr/local/bin/
146178
COPY --from=souffle /usr/local/include/souffle/ /usr/include/souffle
147-
COPY --from=lief /usr/lib/libLIEF.a /usr/lib/libLIEF.a
148-
COPY --from=lief /usr/include/LIEF /usr/include/LIEF
149-
COPY --from=lief /usr/share/LIEF /usr/share/LIEF
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
150182
COPY --from=libehp /usr/local/lib /usr/local/lib
151183
COPY --from=libehp /usr/local/include /usr/local/include
152184
COPY --from=UASM /usr/local/bin/uasm /usr/local/bin/uasm

.ci/Dockerfile.ubuntu20

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ RUN git clone -b 2.4 https://github.com/souffle-lang/souffle && \
3030
make -C build install -j4
3131

3232
# ------------------------------------------------------------------------------
33-
# Build LIEF
33+
# Install LIEF
3434
# ------------------------------------------------------------------------------
3535
FROM ubuntu:20.04 AS lief
3636

@@ -41,11 +41,43 @@ RUN apt-get -y update && \
4141
build-essential \
4242
cmake \
4343
git \
44-
python3
45-
46-
RUN git clone -b 0.13.2 --depth 1 https://github.com/lief-project/LIEF.git /usr/local/src/LIEF && \
47-
cmake -DLIEF_PYTHON_API=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF /usr/local/src/LIEF -B/usr/local/src/LIEF/build && \
48-
cmake --build /usr/local/src/LIEF/build -j4 --target install
44+
python3 \
45+
python3-pip \
46+
wget
47+
48+
# Install CMake 3.24.0 (needed by LIEF 0.16.6)
49+
ENV CMAKE_VERSION=3.24.0
50+
RUN wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz && \
51+
tar -xzf cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz && \
52+
mv cmake-${CMAKE_VERSION}-linux-x86_64 /opt/cmake && \
53+
rm /usr/bin/cmake && \
54+
ln -s /opt/cmake/bin/cmake /usr/bin/cmake && \
55+
rm cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz
56+
57+
RUN pip install conan==1.59 && \
58+
conan profile new default --detect && \
59+
conan remote add rewriting_remote https://git.grammatech.com/api/v4/packages/conan
60+
61+
ENV LIEF_VERSION="0.16.6"
62+
63+
RUN echo "[requires]\n\
64+
lief/${LIEF_VERSION}@rewriting+extra-packages/stable\n\
65+
\n\
66+
[generators]\n\
67+
CMakeDeps\n\
68+
CMakeToolchain" > /tmp/conanfile.txt
69+
70+
RUN conan install /tmp/conanfile.txt \
71+
--build=missing \
72+
--remote=rewriting_remote \
73+
-pr:b=default -pr:h=default
74+
75+
RUN PKG_DIR=$(find /root/.conan/data/lief/${LIEF_VERSION}/rewriting+extra-packages/stable/package -mindepth 1 -maxdepth 1 -type d) && \
76+
mkdir -p /opt/lief-pkg && \
77+
cp -a $PKG_DIR/include /opt/lief-pkg/ && \
78+
cp -a $PKG_DIR/lib /opt/lief-pkg/ && \
79+
cp -a $PKG_DIR/lib/cmake /opt/lief-pkg/ && \
80+
cp -a $PKG_DIR/lib/pkgconfig /opt/lief-pkg/ || true
4981

5082
# ------------------------------------------------------------------------------
5183
# Build libehp
@@ -182,7 +214,7 @@ RUN python3 -m pip install --no-cache-dir --upgrade pip && \
182214
pre-commit \
183215
pydot \
184216
sphinx \
185-
lief==0.13.2
217+
lief==0.16.6
186218

187219
# Setup pre-commit hooks.
188220
WORKDIR /ddisasm
@@ -192,9 +224,9 @@ RUN git init && \
192224

193225
COPY --from=souffle /usr/local/bin/souffle* /usr/local/bin/
194226
COPY --from=souffle /usr/local/include/souffle/ /usr/local/include/souffle
195-
COPY --from=lief /usr/lib/libLIEF.a /usr/lib/libLIEF.a
196-
COPY --from=lief /usr/include/LIEF /usr/include/LIEF
197-
COPY --from=lief /usr/share/LIEF /usr/share/LIEF
227+
COPY --from=lief /opt/lief-pkg/lib/libLIEF.a /usr/lib/libLIEF.a
228+
COPY --from=lief /opt/lief-pkg/lib/cmake/LIEF /usr/lib/cmake/LIEF
229+
COPY --from=lief /opt/lief-pkg/include/LIEF /usr/include/LIEF
198230
COPY --from=libehp /usr/local/lib /usr/local/lib
199231
COPY --from=libehp /usr/local/include /usr/local/include
200232
COPY --from=UASM /usr/local/bin/uasm /usr/local/bin/uasm

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
* Fix bug that could result in incorrect symbol references due to incorrect GOT entries when multiple symbols share the same name
3232
* Fix bug that could result in missing functions for ARM32
3333
* Fix bug that could result in incorrect targets in jump tables for ARM64
34+
* Update LIEF to 0.16.6 to resolve a bug that could cause relocations to be
35+
missing
3436

3537
# 1.9.0
3638

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ endif()
355355
if(ENABLE_CONAN)
356356
set(LIEF_LIBRARIES CONAN_PKG::lief)
357357
else()
358-
find_package(LIEF 0.13.2 REQUIRED COMPONENTS STATIC)
358+
find_package(LIEF 0.16.6 REQUIRED COMPONENTS STATIC)
359359
endif()
360360

361361
# ---------------------------------------------------------------------------

Dockerfile

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,52 @@ RUN git clone -b 2.4 https://github.com/souffle-lang/souffle && \
3030
# ------------------------------------------------------------------------------
3131
# Install LIEF
3232
# ------------------------------------------------------------------------------
33-
FROM ubuntu:20.04 AS LIEF
34-
RUN export DEBIAN_FRONTEND=noninteractive
33+
FROM ubuntu:20.04 AS lief
34+
3535
RUN ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime
36-
RUN apt-get -y update \
37-
&& apt-get -y install \
36+
37+
RUN apt-get -y update && \
38+
apt-get -y install \
3839
build-essential \
3940
cmake \
4041
git \
41-
python3
42+
python3 \
43+
python3-pip \
44+
wget
4245

43-
RUN git clone -b 0.13.2 --depth 1 https://github.com/lief-project/LIEF.git /usr/local/src/LIEF
44-
RUN cmake -DLIEF_PYTHON_API=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF /usr/local/src/LIEF -B/usr/local/src/LIEF/build
45-
RUN cmake --build /usr/local/src/LIEF/build -j4 --target all install
46+
# Install CMake 3.24.0 (needed by LIEF 0.16.6)
47+
ENV CMAKE_VERSION=3.24.0
48+
RUN wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz && \
49+
tar -xzf cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz && \
50+
mv cmake-${CMAKE_VERSION}-linux-x86_64 /opt/cmake && \
51+
rm /usr/bin/cmake && \
52+
ln -s /opt/cmake/bin/cmake /usr/bin/cmake && \
53+
rm cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz
54+
55+
RUN pip install conan==1.59 && \
56+
conan profile new default --detect && \
57+
conan remote add rewriting_remote https://git.grammatech.com/api/v4/packages/conan
58+
59+
ENV LIEF_VERSION="0.16.6"
60+
61+
RUN echo "[requires]\n\
62+
lief/${LIEF_VERSION}@rewriting+extra-packages/stable\n\
63+
\n\
64+
[generators]\n\
65+
CMakeDeps\n\
66+
CMakeToolchain" > /tmp/conanfile.txt
67+
68+
RUN conan install /tmp/conanfile.txt \
69+
--build=missing \
70+
--remote=rewriting_remote \
71+
-pr:b=default -pr:h=default
72+
73+
RUN PKG_DIR=$(find /root/.conan/data/lief/${LIEF_VERSION}/rewriting+extra-packages/stable/package -mindepth 1 -maxdepth 1 -type d) && \
74+
mkdir -p /opt/lief-pkg && \
75+
cp -a $PKG_DIR/include /opt/lief-pkg/ && \
76+
cp -a $PKG_DIR/lib /opt/lief-pkg/ && \
77+
cp -a $PKG_DIR/lib/cmake /opt/lief-pkg/ && \
78+
cp -a $PKG_DIR/lib/pkgconfig /opt/lief-pkg/ || true
4679

4780
# ------------------------------------------------------------------------------
4881
# Install libehp
@@ -151,9 +184,9 @@ RUN wget https://download.grammatech.com/gtirb/files/apt-repo/pool/unstable/libc
151184

152185
COPY --from=souffle /usr/local/bin/souffle* /usr/local/bin/
153186
COPY --from=souffle /usr/local/include /usr/local/include
154-
COPY --from=LIEF /usr/lib/libLIEF.a /usr/lib/libLIEF.a
155-
COPY --from=LIEF /usr/include/LIEF /usr/include/LIEF
156-
COPY --from=LIEF /usr/share/LIEF /usr/share/LIEF
187+
COPY --from=lief /opt/lief-pkg/lib/libLIEF.a /usr/lib/libLIEF.a
188+
COPY --from=lief /opt/lief-pkg/lib/cmake/LIEF /usr/lib/cmake/LIEF
189+
COPY --from=lief /opt/lief-pkg/include/LIEF /usr/include/LIEF
157190
COPY --from=libehp /usr/local/lib /usr/local/lib
158191
COPY --from=libehp /usr/local/include /usr/local/include
159192
COPY --from=gtirb /usr/local/lib /usr/local/lib

conanfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class DdisasmConan(Properties, ConanFile):
7575
settings = ("os", "compiler", "build_type", "arch")
7676
options = {"run_tests": [True, False, None]}
7777

78-
lief_version = "0.13.2"
78+
lief_version = "0.16.6"
7979
libehp_version = "0.1.1-gt5"
8080
souffle_version = "2.4"
8181
build_requires = (

requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
capstone-gt
22
gtirb
33
gtirb-capstone
4-
lief==0.13.2
4+
lief==0.16.6

0 commit comments

Comments
 (0)