So after too many hours finally it's been solved. It goes like this:
- Download libdwarf-20130207.tar.gz
Extract the archive and in a new terminal type:
cd dwarf-2013-02-07/libdwarf ./configure --enable-shared make -j$(nproc)If you need a 32 bit library (as in my case), just open the
MakeFileand add-m32toCFLAGSCFLAGS = -m32 $(PREINCS) -g -O2 $(INCLUDES) $(dwfpic) $(POSTINCS)At the end, just copy the
libdwarf.sointo/usr/lib
Does not detect libdwarf
dwarf.h is not found: "dwarf.h: No such file or directory"
cmake - Could NOT find ZSTD (missing: ZSTD_LIBRARY ZSTD_INCLUDE_DIR) - Stack Overflow
c++ - CMake Error: Could not find include directory and library - Stack Overflow
So after too many hours finally it's been solved. It goes like this:
- Download libdwarf-20130207.tar.gz
Extract the archive and in a new terminal type:
cd dwarf-2013-02-07/libdwarf ./configure --enable-shared make -j$(nproc)If you need a 32 bit library (as in my case), just open the
MakeFileand add-m32toCFLAGSCFLAGS = -m32 $(PREINCS) -g -O2 $(INCLUDES) $(dwfpic) $(POSTINCS)At the end, just copy the
libdwarf.sointo/usr/lib
I suspect this wasn't true when the question was asked, but in 2018:
sudo apt-get install libelf-dev libdwarf-dev
You might also be interested in https://github.com/aclements/libelfin.
The solution is to install the zstd dev package instead of the regular, here is the command:
sudo apt install -y libzstd-dev
The solution with the dwarf dev package for the second error:
sudo apt install libdwarf-dev
On Windows, I had to download zstd from the zstd Github releases page and add these arguments to cmake (adjust your zstd location):
-D ZSTD_LIBRARY="C:/zstd-v1.5.6-win64/dll/libzstd.dll" -D ZSTD_INCLUDE_DIR="C:/zstd-v1.5.6-win64/include"
I tried to follow the rust for linux quick setup in order to learn some kernel programming in rust , but when I tried to compile the kernel using make LLVM=1 it showed this error :
scripts/gendwarfksyms/gendwarfksyms.h:6:10: fatal error: 'dwarf.h' file not found
6 | #include <dwarf.h>
| ^~~~~~~~~
1 error generated.
make[3]: *** [scripts/Makefile.host:131: scripts/gendwarfksyms/gendwarfksyms.o] Error 1
make[2]: *** [scripts/Makefile.build:556: scripts/gendwarfksyms] Error 2
make[1]: *** [/home/pc/os2-rs/linux/Makefile:1263: scripts] Error 2
make: *** [Makefile:248: __sub-make] Error 2
anyone can help me with please I'm stuck for hours