You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to build dtrace.
I have installed libdwarf and elfutils-libs
make all is failing with below error -
Any idea what may be going wrong.
BUILD_DIR=build-4.4.5-0.1.fm.221.49.316.metal1.x86_64
tools/mkdriver.pl driver-kmem ;
tools/build.pl build-4.4.5-0.1.fm.221.49.316.metal1.x86_64 uname -m
Executing: /tmp/dtrace/dtrace-20160613/tools/make-me
make -C /lib/modules/4.4.5-0.1.fm.221.49.316.metal1.x86_64/build M=/tmp/dtrace/dtrace-20160613/build-4.4.5-0.1.fm.221.49.316.metal1.x86_64/driver-kmem
Building modules, stage 2.
MODPOST 1 modules
gcc -o build-4.4.5-0.1.fm.221.49.316.metal1.x86_64/kcore tools/kcore.c
tools/check_dep.pl
tools/mkport.pl
/tmp/ccXV3VX4.o: In function main': root.dwarf.c:(.text+0x1f): undefined reference to dwarf_loclist'
collect2: ld returned 1 exit status
Failed to find offset
Use of uninitialized value $old_rsp in concatenation (.) or string at tools/mkport.pl line 144.
old_rsp=
We cannot find old_rsp or per_cpu__old_rsp in your kernel.
Additionally, it looks like /proc/kcore is broken on your kernel,
meaning we cannot poke to find this variable, which helps identify
kernel thread offsets.
FATAL ERROR: cannot find old_rsp
FATAL ERROR: build.pl aborting
make: *** [all] Error 25
I just tried on the latest arch linux with libdwarf installed as well, and getting the same error
$ make all
BUILD_DIR=build-4.9.11-1-ARCH \
tools/mkdriver.pl driver-kmem ; \
tools/build.pl build-4.9.11-1-ARCH `uname -m`
Executing: /home/darth/projects/dtrace4linux/tools/make-me
ERROR: /lib/modules/4.9.11-1-ARCH/build does not exist.
gcc -o build-4.9.11-1-ARCH/kcore tools/kcore.c
tools/check_dep.pl
tools/mkport.pl
/tmp/darth.dwarf.c: In function ‘main’:
/tmp/darth.dwarf.c:5:2: warning: implicit declaration of function ‘dwarf_loclist’ [-Wimplicit-function-declaration]
dwarf_loclist();
^~~~~~~~~~~~~
/tmp/ccG4Rid1.o: In function `main':
darth.dwarf.c:(.text+0x1f): undefined reference to `dwarf_loclist'
collect2: error: ld returned 1 exit status
Failed to find stub_execve
Use of uninitialized value $old_rsp in concatenation (.) or string at tools/mkport.pl line 144.
old_rsp=
We cannot find old_rsp or per_cpu__old_rsp in your kernel.
Additionally, it looks like /proc/kcore is broken on your kernel,
meaning we cannot poke to find this variable, which helps identify
kernel thread offsets.
FATAL ERROR: cannot find old_rsp
FATAL ERROR: build.pl aborting
make: *** [makefile:67: all] Error 25
The script seems check if libdw OR libdwarf should be linked. But on current Arch Linux setups dwarf_begin and dwarf_loclist are not defined in the same SO:
juergen@samson:/usr/lib → nm -D libdw.so|egrep '(dwarf_begin|dwarf_loclist)$'
0000000000009f80 T dwarf_begin
juergen@samson:/usr/lib → nm -D libdwarf.so|egrep '(dwarf_begin|dwarf_loclist)$'
0000000000029f70 T dwarf_loclist
tools/mkport.pl
/tmp/ccfGMqi0.o: In function `main':
juergen.dwarf.c:(.text+0x1f): undefined reference to `dwarf_loclist'
collect2: error: ld returned 1 exit status
I have the same problem on Parrot OS Linux Kernel 5.9.0-2parrot1-amd64
$ nm -D /usr/lib/x86_64-linux-gnu/libdw.so | egrep '(dwarf_begin|dwarf_loclist)'
0000000000033eb0 T dwarf_begin@@ELFUTILS_0.122
0000000000034580 T dwarf_begin_elf@@ELFUTILS_0.122
$ nm -D /usr/lib/x86_64-linux-gnu/libdwarf.so | egrep '(dwarf_begin|dwarf_loclist)'
00000000000369f0 T dwarf_loclist
00000000000369d0 T dwarf_loclist_from_expr
0000000000036970 T dwarf_loclist_from_expr_a
0000000000036800 T dwarf_loclist_from_expr_b
0000000000038c30 T dwarf_loclist_from_expr_c
0000000000036d10 T dwarf_loclist_n
000000000003aac0 T _dwarf_loclists_fill_in_lle_head
000000000003b450 T _dwarf_loclists_head_destructor
Activity
darthdeus commentedon Mar 12, 2017
I just tried on the latest arch linux with
libdwarfinstalled as well, and getting the same errorp11o commentedon Apr 9, 2017
I'm having the same issue. Looks like the issue is the
undefined reference to dwarf_loclist. Any ideas?juergenhoetzel commentedon Feb 8, 2018
This seems to be related to Changes to support CentOS 7:
The script seems check if
libdwORlibdwarfshould be linked. But on current Arch Linux setupsdwarf_beginanddwarf_loclistare not defined in the sameSO:juergenhoetzel commentedon Feb 8, 2018
The same error occurs on a Centos7 system
but builds continues successfully
66Ton99 commentedon Nov 6, 2020
Have the same problem on Void Linux Kernel 5.8.16_1
KZYSAKYM commentedon Nov 22, 2020
I have the same problem on Parrot OS Linux Kernel 5.9.0-2parrot1-amd64