From b188faa0b811585eb85771fe19819acabd785299 Mon Sep 17 00:00:00 2001 From: David Biancolin Date: Wed, 14 Jul 2021 20:27:56 +0000 Subject: [PATCH] Use libelf installed at local sysroot when building libdwarf --- build-setup-nolog.sh | 2 +- scripts/build-libdwarf.sh | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/build-setup-nolog.sh b/build-setup-nolog.sh index 4f6118f9..a46b2984 100644 --- a/build-setup-nolog.sh +++ b/build-setup-nolog.sh @@ -209,8 +209,8 @@ fi firesim_local_sysroot=$RDIR/sim/lib-install cd $RDIR mkdir -p $firesim_local_sysroot -./scripts/build-libdwarf.sh $firesim_local_sysroot ./scripts/build-libelf.sh $firesim_local_sysroot +./scripts/build-libdwarf.sh $firesim_local_sysroot env_append "export LD_LIBRARY_PATH=$firesim_local_sysroot/lib\${LD_LIBRARY_PATH:+\":\${LD_LIBRARY_PATH}\"}" cd $RDIR diff --git a/scripts/build-libdwarf.sh b/scripts/build-libdwarf.sh index eddc4aec..0ace7fc5 100755 --- a/scripts/build-libdwarf.sh +++ b/scripts/build-libdwarf.sh @@ -1,10 +1,6 @@ #!/bin/sh set -e -if [ -z "$RISCV" ]; then - echo "You must set \$RISCV to run this script." - exit 1 -fi if [ $# -ne 1 ]; then echo "$0 expects one argument, the installation prefix." @@ -15,8 +11,9 @@ prefix=$1 cd sim/firesim-lib/src/main/cc/lib/libdwarf sh scripts/FIX-CONFIGURE-TIMES -mkdir build +mkdir -p build cd build -../configure --prefix="${prefix}" --enable-shared --disable-static CFLAGS="-g -I${RISCV}/include" LDFLAGS="-L${RISCV}/lib" +# Get libelf from our local sysroot ($prefix) +../configure --prefix="${prefix}" --enable-shared --disable-static CFLAGS="-g -I${prefix}/include" LDFLAGS="-L${prefix}/lib" make make install