[Spike] Improve diagnostics when loading extension libraries.

* vendor/riscv/riscv-isa-sim/riscv/extensions.cc (find_extension): Print
  the reason of dlopen() failure.
This commit is contained in:
Zbigniew Chamski 2023-04-28 10:39:04 +02:00
parent fd130ce3bc
commit e4bb8b95d6

View file

@ -27,8 +27,8 @@ std::function<extension_t*()> find_extension(const char* name)
if (!dlh) {
dlh = dlopen(libdefault.c_str(), RTLD_LAZY);
if (!dlh) {
fprintf(stderr, "couldn't find shared library either '%s' or '%s')\n",
libname.c_str(), libdefault.c_str());
fprintf(stderr, "couldn't load shared library (either '%s' or '%s'), reason: %s\n",
libname.c_str(), libdefault.c_str(), dlerror());
exit(-1);
}