Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gdb: Make it easier to install a correct version of GDB inside the ossfuzz container #77

Merged
merged 1 commit into from
Jul 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions ossfuzz.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ SCRIPTDIR=${BUILD_ROOT}/scripts
ZLIBDIR=/src/zlib
OPENSSLDIR=/src/openssl
NGHTTPDIR=/src/nghttp2
GDBDIR=/src/gdb

echo "BUILD_ROOT: $BUILD_ROOT"
echo "SRC: ${SRC:-undefined}"
Expand All @@ -46,6 +47,15 @@ export MAKEFLAGS+="-j$(nproc)"
# Make an install directory
export INSTALLDIR=/src/curl_install

# If necessary (i.e. this is inside the ossfuzz shell environment and
# you've set the environment variable) then download and install GDB.
# This installs to the default configure location.
if [[ ${INSTALLGDB:-} == "yes" ]]
then
# Install GDB
${SCRIPTDIR}/handle_x.sh gdb ${GDBDIR} system || exit 1
fi

# Install zlib
${SCRIPTDIR}/handle_x.sh zlib ${ZLIBDIR} ${INSTALLDIR} || exit 1

Expand Down
10 changes: 10 additions & 0 deletions scripts/download_gdb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

# If any commands fail, fail the script immediately.
set -ex

wget https://ftp.gnu.org/gnu/gdb/gdb-13.2.tar.xz -O /tmp/gdb.tar.gz
tar -xvf /tmp/gdb.tar.gz --directory /tmp

# Move the directory into the correct place
mv -v /tmp/gdb-* "$1"
16 changes: 16 additions & 0 deletions scripts/install_gdb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
# If any commands fail, fail the script immediately.
set -ex

export CFLAGS=
export CXXFLAGS=

SRCDIR=$1

pushd ${SRCDIR}

./configure
make
make install

popd
1 change: 1 addition & 0 deletions scripts/ossfuzzdeps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ apt-get install -y make \
autoconf \
automake \
libtool \
libgmp-dev \
libssl-dev \
zlib1g-dev \
pkg-config \
Expand Down