Skip to content

Commit

Permalink
cpp: Add libc with frame pointers
Browse files Browse the repository at this point in the history
Could not find a counterpart of `libc6-prof` for Debian, so using an
Ubuntu image now
  • Loading branch information
javierhonduco committed Jun 30, 2022
1 parent 3661452 commit 50fbe18
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
6 changes: 4 additions & 2 deletions cpp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ COPY main.cpp .

RUN g++ ${GCC_FLAGS} -o parca-demo main.cpp

FROM debian:stable-slim as runner
RUN apt-get update && apt-get install libc6-dbg libstdc++6-10-dbg -y
FROM ubuntu:focal as runner
RUN apt-get update && apt-get install libc6-prof libstdc++6-10-dbg -y

COPY --from=builder /app/parca-demo .

ARG LD_LIBRARY_PATH
ENV LD_LIBRARY_PATH ${LD_LIBRARY_PATH}
CMD ["./parca-demo"]
6 changes: 4 additions & 2 deletions cpp/Dockerfile.clang
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ COPY main.cpp .

RUN clang++ ${CLANG_FLAGS} -o parca-demo main.cpp

FROM debian:stable-slim as runner
RUN apt-get update && apt-get install libc6-dbg libstdc++6-10-dbg -y
FROM ubuntu:focal as runner
RUN apt-get update && apt-get install libc6-prof libstdc++6-10-dbg -y

COPY --from=builder /app/parca-demo .

ARG LD_LIBRARY_PATH
ENV LD_LIBRARY_PATH ${LD_LIBRARY_PATH}
CMD ["./parca-demo"]
6 changes: 3 additions & 3 deletions cpp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ pie:
docker build -t parca-demo:cpp-pie --build-arg GCC_FLAGS='-g' .

pie-with-fp:
docker build -t parca-demo:cpp-pie-with-fp --build-arg GCC_FLAGS='-g -fno-omit-frame-pointer' .
docker build -t parca-demo:cpp-pie-with-fp --build-arg GCC_FLAGS='-g -fno-omit-frame-pointer' --build-arg LD_LIBRARY_PATH='/usr/lib/libc6-prof/x86_64-linux-gnu' .


no-pie:
docker build -t parca-demo:cpp --build-arg GCC_FLAGS='-g -no-pie' .

no-pie-with-fp:
docker build -t parca-demo:cpp-with-fp --build-arg GCC_FLAGS='-g -no-pie -fno-omit-frame-pointer' .
docker build -t parca-demo:cpp-with-fp --build-arg GCC_FLAGS='-g -no-pie -fno-omit-frame-pointer' --build-arg LD_LIBRARY_PATH='/usr/lib/libc6-prof/x86_64-linux-gnu' .

clang:
docker build -f Dockerfile.clang -t parca-demo:cpp-clang --build-arg CLANG_FLAGS='-g' .

clang-with-fp:
docker build -f Dockerfile.clang -t parca-demo:cpp-clang-with-fp --build-arg CLANG_FLAGS='-g -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer' .
docker build -f Dockerfile.clang -t parca-demo:cpp-clang-with-fp --build-arg CLANG_FLAGS='-g -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer' --build-arg LD_LIBRARY_PATH='/usr/lib/libc6-prof/x86_64-linux-gnu' .

0 comments on commit 50fbe18

Please sign in to comment.