Open ahresse opened 2 months ago
Hi,
thanks for the report. I will try to reproduce the issue myself and come back here if I have an idea how we can solve this issue.
The libasan
can be ignored or removed by disabling the address sanitizer.
The undefined reference looks interesting:
/usr/bin/ld: /tmp/ccWYvPTh.ltrans0.ltrans.o: in function `function':
/home/ahresse/Developments/elektrobit/cmocka_extensions/examples/test/utest/mocks/selfref/mock_selfref.c:11: undefined reference to `__real_function'
collect2: error: ld returned 1 exit status
Hi Alexandre,
we won't be able to get the mocking framework for LTO in the foreseeable future, if that is possible at all. My suggestion is to disable it here. Currently the examples are failing to compile and I think we do not need to package the examples. So we need a CMake option to disable the examples and build a header only package .
In general in all depended packages the LTO feature shall only be turned on for building the actual result like a executable or a shared library. For the unit tests this option should be skipped.
BR
Wolfgang
While packaging cmocka_extensions for debian, I enabled LTO. However, I encountered some issues while doing so.
Here is how I enable LTO for cmake:
Here is the error I get: