Stop installing libelf + libdwarf to RISCV

This commit is contained in:
David Biancolin 2021-07-07 20:46:47 +00:00
parent 4c70d0d205
commit 20b09215df
7 changed files with 41 additions and 13 deletions

View File

@ -205,10 +205,13 @@ if wget -T 1 -t 3 -O /dev/null http://169.254.169.254/; then
bash -c "source ./hdk_setup.sh"
fi
# Per-repository dependencies are installed under this sysroot
firesim_local_sysroot=$RDIR/sim/lib-install
cd $RDIR
./scripts/build-libelf.sh
cd $RDIR
./scripts/build-libdwarf.sh
mkdir -p $firesim_local_sysroot
./scripts/build-libdwarf.sh $firesim_local_sysroot
./scripts/build-libelf.sh $firesim_local_sysroot
env_append "export LD_LIBRARY_PATH=$firesim_local_sysroot/lib\${LD_LIBRARY_PATH:+\":\${LD_LIBRARY_PATH}\"}"
cd $RDIR
set +e

View File

@ -335,8 +335,7 @@ class FireSimServerNode(FireSimNode):
all_paths.append([self.server_hardware_config.get_local_runtime_conf_path(), ''])
# shared libraries
all_paths.append(["$RISCV/lib/libdwarf.so", "libdwarf.so.1"])
all_paths.append(["$RISCV/lib/libelf.so", "libelf.so.1"])
all_paths += self.server_hardware_config.get_local_shared_libraries()
all_paths += self.get_job().get_siminputs()
return all_paths
@ -497,8 +496,7 @@ class FireSimSuperNodeServerNode(FireSimServerNode):
self.get_rootfs_name()])
# shared libraries
all_paths.append(["$RISCV/lib/libdwarf.so", "libdwarf.so.1"])
all_paths.append(["$RISCV/lib/libelf.so", "libelf.so.1"])
all_paths += self.server_hardware_config.get_local_shared_libraries()
num_siblings = self.supernode_get_num_siblings_plus_one()

View File

@ -19,6 +19,7 @@ import os
LOCAL_DRIVERS_BASE = "../sim/output/f1/"
LOCAL_DRIVERS_GENERATED_SRC = "../sim/generated-src/f1/"
LOCAL_SYSROOT_LIB = "../sim/lib-install/lib/"
CUSTOM_RUNTIMECONFS_BASE = "../sim/custom-runtime-configs/"
rootLogger = logging.getLogger()
@ -63,6 +64,14 @@ class RuntimeHWConfig:
fpga_driver_local = drivers_software_base + self.get_local_driver_binaryname()
return fpga_driver_local
def get_local_shared_libraries(self):
""" Returns a list of path tuples, (A, B), where:
A is the local file path on the manager instance to the library
B is the destination file path on the runfarm instance relative to the driver """
return [[LOCAL_SYSROOT_LIB + "/libdwarf.so", "libdwarf.so.1"],
[LOCAL_SYSROOT_LIB + "/libelf.so", "libelf.so.1"]]
def get_local_runtimeconf_binaryname(self):
""" Get the name of the runtimeconf file. """
return "runtime.conf" if self.customruntimeconfig is None else os.path.basename(self.customruntimeconfig)

View File

@ -6,8 +6,17 @@ if [ -z "$RISCV" ]; then
exit 1
fi
if [ $# -ne 1 ]; then
echo "$0 expects one argument, the installation prefix."
exit 1
fi
prefix=$1
cd sim/firesim-lib/src/main/cc/lib/libdwarf
sh scripts/FIX-CONFIGURE-TIMES
./configure --prefix="${RISCV}" --enable-shared --disable-static CFLAGS="-g -I${RISCV}/include" LDFLAGS="-L${RISCV}/lib"
mkdir build
cd build
../configure --prefix="${prefix}" --enable-shared --disable-static CFLAGS="-g -I${RISCV}/include" LDFLAGS="-L${RISCV}/lib"
make
make install

View File

@ -1,13 +1,17 @@
#!/bin/sh
set -e
if [ -z "$RISCV" ]; then
echo "You must set \$RISCV to run this script."
if [ $# -ne 1 ]; then
echo "$0 expects one argument, the installation prefix."
exit 1
fi
prefix=$1
cd sim/firesim-lib/src/main/cc/lib/elfutils
test -f configure || autoreconf -i -f
./configure --prefix="${RISCV}" --enable-maintainer-mode
./configure --prefix="${prefix}" --enable-maintainer-mode
make
make install
# The build process modifies tracked sources. This to clean up after ourselves.
git reset --hard

1
sim/.gitignore vendored
View File

@ -7,5 +7,6 @@ tags
AsyncResetReg.v
firrtl_black_box_resource_files.f
lib/firrtl.jar
lib-install/
*.swp
.bsp/

View File

@ -100,8 +100,12 @@ DRIVER_CC = $(wildcard $(addprefix $(driver_dir)/, $(addsuffix .cc, firesim/*)))
$(DROMAJO_LIB) \
$(TESTCHIPIP_CSRC_DIR)/testchip_tsi.cc
TARGET_CXX_FLAGS := -g -I$(TESTCHIPIP_CSRC_DIR) -I$(firesim_lib_dir) -I$(driver_dir)/firesim -I$(RISCV)/include -I$(DROMAJO_DIR) -I$(GENERATED_DIR)
TARGET_LD_FLAGS := -L$(RISCV)/lib -l:libdwarf.so -l:libelf.so -lz -L$(DROMAJO_DIR) -l$(DROMAJO_LIB_NAME)
# Per-repository dependencies (e.g., libdwarf) are installed under this sysroot
firesim_local_sysroot = $(firesim_base_dir)/lib-install
TARGET_CXX_FLAGS := -g -I$(TESTCHIPIP_CSRC_DIR) -I$(firesim_lib_dir) -I$(firesim_local_sysroot)/include -I$(driver_dir)/firesim -I$(RISCV)/include -I$(DROMAJO_DIR) -I$(GENERATED_DIR)
TARGET_LD_FLAGS := -L$(RISCV)/lib -L$(firesim_local_sysroot)/lib -l:libdwarf.so -l:libelf.so -lz -L$(DROMAJO_DIR) -l$(DROMAJO_LIB_NAME)
# DOC include end: Bridge Build System Changes
#######################################