Bug 377325 - CMake check_library_exists for FindLibunwind fails (cross compiling)
Summary: CMake check_library_exists for FindLibunwind fails (cross compiling)
Status: RESOLVED NOT A BUG
Alias: None
Product: Heaptrack
Classification: Applications
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR minor
Target Milestone: ---
Assignee: Milian Wolff
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-07 08:35 UTC by Zeno Endemann
Modified: 2018-03-25 17:30 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
CMake cross compile file (780 bytes, text/plain)
2017-03-07 08:35 UTC, Zeno Endemann
Details

Note You need to log in before you can comment on or make changes to this bug.
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.