File tree Expand file tree Collapse file tree 1 file changed +17
-6
lines changed
Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,14 @@ OPENSSLDIR=/src/openssl
3232NGHTTPDIR=/src/nghttp2
3333GDBDIR=/src/gdb
3434
35+ # Check for GDB-specific behaviour by checking for the GDBMODE flag.
36+ # - Compile with -O0 so that DEBUGASSERTs can be debugged in gdb.
37+ if [[ -n ${GDBMODE:- } ]]
38+ then
39+ export CFLAGS=" $CFLAGS -O0"
40+ export CXXFLAGS=" $CXXFLAGS -O0"
41+ fi
42+
3543echo " BUILD_ROOT: $BUILD_ROOT "
3644echo " SRC: ${SRC:- undefined} "
3745echo " CC: $CC "
@@ -47,13 +55,16 @@ export MAKEFLAGS+="-j$(nproc)"
4755# Make an install directory
4856export INSTALLDIR=/src/curl_install
4957
50- # If necessary (i.e. this is inside the ossfuzz shell environment and
51- # you've set the environment variable) then download and install GDB.
52- # This installs to the default configure location.
53- if [[ ${INSTALLGDB:- } == " yes" ]]
58+ # Check for GDB-specific behaviour by checking for the GDBMODE flag.
59+ # - Compile and installing GDB if necessary.
60+ if [[ -n ${GDBMODE:- } ]]
5461then
55- # Install GDB
56- ${SCRIPTDIR} /handle_x.sh gdb ${GDBDIR} system || exit 1
62+ if ! type gdb 2> /dev/null
63+ then
64+ # If gdb isn't found, then download and install GDB.
65+ # This installs to the default configure location.
66+ ${SCRIPTDIR} /handle_x.sh gdb ${GDBDIR} system || exit 1
67+ fi
5768fi
5869
5970# Install zlib
You can’t perform that action at this time.
0 commit comments