Skip to content

Commit

Permalink
update pahole and elfutils (#899)
Browse files Browse the repository at this point in the history
* update pahole and elfutils nightly
  • Loading branch information
madhur4127 authored Dec 16, 2022
1 parent 782a479 commit 8b74dfc
Showing 1 changed file with 34 additions and 41 deletions.
75 changes: 34 additions & 41 deletions update_compilers/install_binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,47 +8,40 @@ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

#########################
# pahole

TARGET_PAHOLE_VERSION=v1.19
CURRENT_PAHOLE_VERSION=""
if [[ -f "${OPT}/pahole/bin/pahole" ]]; then
CURRENT_PAHOLE_VERSION=$("${OPT}/pahole/bin/pahole" --version)
fi

if [[ "$TARGET_PAHOLE_VERSION" != "$CURRENT_PAHOLE_VERSION" ]]; then
rm -Rf "${OPT}/pahole"
mkdir -p "${OPT}/pahole"

mkdir -p /tmp/build
pushd /tmp/build

# Install elfutils for libelf and libdwarf
fetch https://sourceware.org/elfutils/ftp/0.182/elfutils-0.182.tar.bz2 | tar jxf -
pushd elfutils-0.182
./configure --prefix=/opt/compiler-explorer/pahole --program-prefix="eu-" --enable-deterministic-archives --disable-debuginfod --disable-libdebuginfod
make "-j$(nproc)"
make install
popd

rm -Rf /tmp/build/pahole

git clone -q https://git.kernel.org/pub/scm/devel/pahole/pahole.git pahole
git -C pahole checkout v1.19
git -C pahole submodule sync
git -C pahole submodule update --init
pushd pahole
"${OPT}/cmake/bin/cmake" \
-D CMAKE_INSTALL_PREFIX:PATH="${OPT}/pahole" \
-D__LIB=lib \
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE \
.
make "-j$(nproc)"
make install
popd

popd
rm -rf /tmp/build
fi
PAHOLE_INSTALL_DIR=$OPT/pahole

## install elfutils for libelf and libdwarf
ELFUTILS_VERSION=0.188
rm -Rf /tmp/elfutils-$ELFUTILS_VERSION
fetch https://sourceware.org/elfutils/ftp/$ELFUTILS_VERSION/elfutils-$ELFUTILS_VERSION.tar.bz2 | tar jxf - -C /tmp/
pushd /tmp/elfutils-$ELFUTILS_VERSION
./configure --prefix=$PAHOLE_INSTALL_DIR --program-prefix="eu-" --enable-deterministic-archives --disable-debuginfod --disable-libdebuginfod
make "-j$(nproc)"
make install
popd
rm -Rf /tmp/elfutils-$ELFUTILS_VERSION

## cleanup before build
PAHOLE_BUILD_DIR=/tmp/build/pahole
rm -rf $PAHOLE_BUILD_DIR
mkdir -p $PAHOLE_BUILD_DIR
pushd $PAHOLE_BUILD_DIR

## download and install
git clone --branch master --single-branch -q https://git.kernel.org/pub/scm/devel/pahole/pahole.git pahole
pushd pahole
git submodule sync
git submodule update --init
"${OPT}/cmake/bin/cmake" \
-D CMAKE_INSTALL_PREFIX:PATH="$PAHOLE_INSTALL_DIR" \
-D__LIB=lib \
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE \
.
make "-j$(nproc)"
make install
popd
popd
rm -rf $PAHOLE_BUILD_DIR

#########################
# x86-to-6502 old version
Expand Down

0 comments on commit 8b74dfc

Please sign in to comment.