Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linking issue during perf build #1

Open
RAttab opened this issue Sep 6, 2016 · 3 comments
Open

Linking issue during perf build #1

RAttab opened this issue Sep 6, 2016 · 3 comments

Comments

@RAttab
Copy link

RAttab commented Sep 6, 2016

From a clean build (meson got confused midway through the build) I go the following:

  CC       tests/llvm-src-kbuild.o
  CC       util/pmu-flex.o
  CC       tests/llvm-src-prologue.o
  CC       tests/llvm-src-relocation.o
  LD       tests/perf-in.o
  LD       perf-in.o
  LD       util/libperf-in.o
  LD       libperf-in.o
  AR       libperf.a
  LINK     perf
../../../../build/dist/erlang-sample@exe/src_dwarf_helpers.c.o: In function `find_elf':
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:14: undefined reference to `dwfl_build_id_find_elf'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:16: undefined reference to `dwfl_linux_kernel_find_elf'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:21: undefined reference to `dwfl_linux_proc_find_elf'
../../../../build/dist/erlang-sample@exe/src_dwarf_helpers.c.o: In function `dwarf_helpers_get_dwfl':
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:34: undefined reference to `dwfl_begin'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:36: undefined reference to `dwfl_errmsg'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:37: undefined reference to `dwfl_linux_proc_report'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:38: undefined reference to `dwfl_errmsg'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:39: undefined reference to `dwfl_linux_kernel_report_kernel'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:40: undefined reference to `dwfl_errmsg'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:41: undefined reference to `dwfl_linux_kernel_report_modules'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:42: undefined reference to `dwfl_errmsg'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:44: undefined reference to `dwfl_report_end'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:45: undefined reference to `dwfl_errmsg'
../../../../build/dist/erlang-sample@exe/src_dwarf_helpers.c.o: In function `dwarf_helpers_find_module_matching_substring':
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:70: undefined reference to `dwfl_getmodules'
../../../../build/dist/erlang-sample@exe/src_dwarf_helpers.c.o: In function `dwarf_helpers_info_address':
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:87: undefined reference to `dwfl_module_getsymtab'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:91: undefined reference to `dwfl_module_getsym'
../../../../build/dist/erlang-sample@exe/src_dwarf_helpers.c.o: In function `dwarf_helpers_dump_die':
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:214: undefined reference to `dwarf_diename'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:215: undefined reference to `dwarf_diename'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:215: undefined reference to `dwarf_tag'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:219: undefined reference to `dwarf_diename'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:219: undefined reference to `dwarf_tag'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:223: undefined reference to `dwarf_haschildren'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:223: undefined reference to `dwarf_child'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:226: undefined reference to `dwarf_siblingof'
../../../../build/dist/erlang-sample@exe/src_dwarf_helpers.c.o: In function `dwarf_helpers_find_toplevel_symbol':
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:240: undefined reference to `dwarf_haschildren'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:242: undefined reference to `dwarf_child'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:245: undefined reference to `dwarf_tag'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:246: undefined reference to `dwarf_diename'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:250: undefined reference to `dwarf_siblingof'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:239: undefined reference to `dwfl_module_nextcu'
../../../../build/dist/erlang-sample@exe/src_dwarf_helpers.c.o: In function `dwarf_helpers_find_peeled_type':
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:261: undefined reference to `dwarf_haschildren'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:263: undefined reference to `dwarf_child'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:266: undefined reference to `dwarf_tag'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:268: undefined reference to `dwarf_hasattr'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:270: undefined reference to `dwarf_diename'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:277: undefined reference to `dwarf_hasattr'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:278: undefined reference to `dwarf_attr'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:279: undefined reference to `dwarf_formref_die'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:280: undefined reference to `dwarf_errmsg'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:284: undefined reference to `dwarf_peel_type'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:285: undefined reference to `dwarf_errmsg'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:289: undefined reference to `dwarf_diename'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:290: undefined reference to `dwarf_tag'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:292: undefined reference to `dwarf_siblingof'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:260: undefined reference to `dwfl_module_nextcu'
../../../../build/dist/erlang-sample@exe/src_dwarf_helpers.c.o: In function `dwarf_helpers_offset_of':
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:301: undefined reference to `dwarf_haschildren'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:305: undefined reference to `dwarf_child'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:306: undefined reference to `dwarf_errmsg'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:310: undefined reference to `dwarf_diename'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:359: undefined reference to `dwarf_siblingof'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:313: undefined reference to `dwarf_hasattr'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:318: undefined reference to `dwarf_attr'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:319: undefined reference to `dwarf_errmsg'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:324: undefined reference to `dwarf_whatform'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:330: undefined reference to `dwarf_formudata'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:331: undefined reference to `dwarf_errmsg'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:339: undefined reference to `dwarf_formblock'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:340: undefined reference to `dwarf_errmsg'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:356: undefined reference to `dwarf_whatform'
../../../../build/dist/erlang-sample@exe/src_dwarf_helpers.c.o: In function `perf_reg_of_dwarf_reg':
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:532: undefined reference to `dwfl_module_register_names'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:533: undefined reference to `dwarf_errmsg'
../../../../build/dist/erlang-sample@exe/src_dwarf_helpers.c.o: In function `dwarf_helpers_find_register_for':
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:543: undefined reference to `dwarf_child'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:545: undefined reference to `dwarf_tag'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:547: undefined reference to `dwarf_diename'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:551: undefined reference to `dwarf_hasattr'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:555: undefined reference to `dwarf_attr'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:556: undefined reference to `dwarf_errmsg'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:558: undefined reference to `dwarf_whatform'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:562: undefined reference to `dwarf_formblock'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:562: undefined reference to `dwarf_errmsg'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:573: undefined reference to `dwarf_whatform'
/home/remi/code/extrospect-beam/build/../src/dwarf_helpers.c:577: undefined reference to `dwarf_siblingof'
../../../../build/dist/erlang-sample@exe/src_dwarf_helpers.c.o:(.rodata+0x8e8): undefined reference to `dwfl_standard_find_debuginfo'
../../../../build/dist/erlang-sample@exe/src_dwarf_helpers.c.o:(.rodata+0x8f0): undefined reference to `dwfl_linux_kernel_module_section_address'
collect2: error: ld returned 1 exit status
Makefile.perf:435: recipe for target 'perf' failed
make[1]: *** [perf] Error 1
Makefile:68: recipe for target 'all' failed
make: *** [all] Error 2

Still trying to track down the cause.

@tokenrove
Copy link
Owner

What was the config output at the top of the perf build? Should look something like

Auto-detecting system features:
...                         dwarf: [ on  ]
...            dwarf_getlocations: [ on  ]
...                         glibc: [ on  ]
...                          gtk2: [ on  ]
...                      libaudit: [ OFF ]
...                        libbfd: [ OFF ]
...                        libelf: [ on  ]
...                       libnuma: [ on  ]
...        numa_num_possible_cpus: [ on  ]
...                       libperl: [ OFF ]
...                     libpython: [ on  ]
...                      libslang: [ on  ]
...                     libcrypto: [ on  ]
...                     libunwind: [ on  ]
...            libdw-dwarf-unwind: [ on  ]
...                          zlib: [ on  ]
...                          lzma: [ on  ]
...                     get_cpuid: [ on  ]
...                           bpf: [ on  ]

Makefile.config:479: No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev
Makefile.config:547: Missing perl devel files. Disabling perl scripting support, please install perl-ExtUtils-Embed/libperl-dev
Makefile.config:651: No bfd.h/libbfd found, please install binutils-dev[el]/zlib-static/libiberty-dev to gain symbol demangling

@tokenrove
Copy link
Owner

(Those errors would be caused by not linking against libdw, which it should be doing since the build script sets NO_LIBUNWIND=1)

@RAttab
Copy link
Author

RAttab commented Sep 6, 2016

Auto-detecting system features:
...                         dwarf: [ OFF ]
...            dwarf_getlocations: [ OFF ]
...                         glibc: [ on  ]
...                          gtk2: [ OFF ]
...                      libaudit: [ OFF ]
...                        libbfd: [ OFF ]
...                        libelf: [ OFF ]
...                       libnuma: [ OFF ]
...        numa_num_possible_cpus: [ OFF ]
...                       libperl: [ OFF ]
...                     libpython: [ OFF ]
...                      libslang: [ OFF ]
...                     libcrypto: [ on  ]
...                     libunwind: [ OFF ]
...            libdw-dwarf-unwind: [ OFF ]
...                          zlib: [ on  ]
...                          lzma: [ on  ]
...                     get_cpuid: [ on  ]
...                           bpf: [ on  ]

Makefile.config:260: No libelf found, disables 'probe' tool and BPF support in 'perf record', please install libelf-dev, libelf-devel or elfutils-libelf-devel
Makefile.config:360: No sys/sdt.h found, no SDT events are defined, please install systemtap-sdt-devel or systemtap-sdt-dev
Makefile.config:433: Disabling post unwind, no support found.
Makefile.config:479: No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev
Makefile.config:505: slang not found, disables TUI support. Please install slang-devel, libslang-dev or libslang2-dev
Makefile.config:519: GTK2 not found, disables GTK2 support. Please install gtk2-devel or libgtk2.0-dev
Makefile.config:547: Missing perl devel files. Disabling perl scripting support, please install perl-ExtUtils-Embed/libperl-dev
Makefile.config:578: No 'python-config' tool was found: disables Python support - please install python-devel/python-dev
Makefile.config:693: No numa.h found, disables 'perf bench numa mem' benchmark, please install numactl-devel/libnuma-devel/libnuma-dev
make[2]: *** No rule to make target 'kernelversion'.  Stop.

I have a lot more things set to OFF then you do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants