Bug 377325

Summary: CMake check_library_exists for FindLibunwind fails (cross compiling)
Product: [Applications] Heaptrack Reporter: Zeno Endemann <zeno.endemann>
Component: generalAssignee: Milian Wolff <mail>
Status: RESOLVED NOT A BUG    
Severity: minor    
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: CMake cross compile file

Description Zeno Endemann 2017-03-07 08:35:00 UTC
Created attachment 104430 [details]
CMake cross compile file

I have a yocto cross compile setup, when trying to compile heaptrack it apparently doesn't find the symbols in the libunwind.so.

Not entirely sure this bug is valid as there might be something unusual with my setup. Anyway, some details:

Target hardware: i.MX6 Duo

Cmake command:
  cmake /path/to/heaptrack -G'Unix Makefiles' -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_TOOLCHAIN_FILE:STRING=toolchain.cmake -DHEAPTRACK_BUILD_GUI:BOOL=OFF -DQT_QMAKE_EXECUTABLE:STRING=/path/to/hosttools/usr/bin/qt5/qmake

toolchain.cmake attached

When commenting out the checks it compiles at least (though it seems to crash on the device - need to debug this further, might be unrelated)
Comment 1 Milian Wolff 2018-03-21 17:23:34 UTC
Hey Zeno,

long delay :) Do you still have access to that sysroot, or an equivalent one?

I assume that you are talking about these checks:

  check_library_exists(${LIBUNWIND_LIBRARY} unw_getcontext "" LIBUNWIND_HAS_UNW_GETCONTEXT)
  check_library_exists(${LIBUNWIND_LIBRARY} unw_init_local "" LIBUNWIND_HAS_UNW_INIT_LOCAL)
  check_library_exists(${LIBUNWIND_LIBRARY} unw_backtrace "" LIBUNWIND_HAS_UNW_BACKTRACE)
  check_library_exists (${LIBUNWIND_LIBRARY} unw_backtrace_skip "" LIBUNWIND_HAS_UNW_BACKTRACE_SKIP)

What do you get for `nm -a path/to/libunwind.so | grep unw_`? Most notably, only unw_backtrace should be required (and available).
Comment 2 Zeno Endemann 2018-03-25 17:30:04 UTC
Sorry, don't have it anymore. I just tried cross-compiling it with a buildroot toolchain for basically the same hardware with same settings and it works there.. well minus the ECM thing reported here: https://bugs.kde.org/show_bug.cgi?id=392320

I'll mark this as invalid, it was probably some bug in my old setup.