Allow to use backtrace(3) external library for kdebug #103

Merged
MicheleC merged 2 commits from feat/add-libexecinfo-support into master 4 years ago
obache commented 4 years ago
Collaborator

tested with BSD licence libexecinfo

tested with BSD licence libexecinfo
MicheleC approved these changes 4 years ago
MicheleC left a comment
Owner

Looks good to me!

Looks good to me!
MicheleC reviewed 4 years ago
config.h.cmake Outdated
#cmakedefine HAVE_STRVERCMP_PROTO 1
/* Define to 1 if execinfo.h exists and defines backtrace (GLIBC >= 2.1) */
/* Define to 1 if backtrace information library */
Owner

Could you add "exists" to the comment?

/* Define to 1 if backtrace information library exists */
Could you add "exists" to the comment? ``` /* Define to 1 if backtrace information library exists */ ```
obache commented 4 years ago
Poster
Collaborator

It should be "... if you have backtrace ...", as my local patch... :-(

It should be "... if you have backtrace ...", as my local patch... :-(
MicheleC reviewed 4 years ago
CMakeLists.txt Outdated
set ( Backtrace_HEADER "execinfo.h" )
endif ()
else ()
find_package( Backtrace )
Owner

Maybe I am asking a stupid question, forgive my ignorance. Why are we using "Backtrace" with capital 'B'?

Maybe I am asking a stupid question, forgive my ignorance. Why are we using "Backtrace" with capital 'B'?
Owner

I assume that capital 'B' is because the file itself is called FindBacktrace.cmake.

I assume that capital 'B' is because the file itself is called `FindBacktrace.cmake`.
obache commented 4 years ago
Poster
Collaborator

Yes, from the spec of find_package(), find_package( Backtrace ) will find FindBacktrace.cmake or backtrace-config.cmake.

Yes, from the spec of find_package(), find_package( Backtrace ) will find `FindBacktrace.cmake` or `backtrace-config.cmake`.
Owner

ok, thanks for the explanation Obata-san.

ok, thanks for the explanation Obata-san.
Owner

Test on FreeBSD:

-- Looking for backtrace
-- Looking for backtrace - not found
-- Found Backtrace: /usr/lib/libexecinfo.so
-- Performing Test HAVE_ABI_CXA_DEMANGLE
-- Performing Test HAVE_ABI_CXA_DEMANGLE - Success
ld: error: undefined symbol: backtrace
>>> referenced by kdebug.cpp:813 (../tdecore/kdebug.cpp:813)
>>>               tdecore/CMakeFiles/tdecore-shared.dir/kdebug.cpp.o:(kdBacktrace(int))

ld: error: undefined symbol: backtrace
>>> referenced by kdebug.cpp:843 (../tdecore/kdebug.cpp:843)
>>>               tdecore/CMakeFiles/tdecore-shared.dir/kdebug.cpp.o:(kdBacktraceFD(int))

ld: error: undefined symbol: backtrace_symbols_fd
>>> referenced by kdebug.cpp:845 (../tdecore/kdebug.cpp:845)
>>>               tdecore/CMakeFiles/tdecore-shared.dir/kdebug.cpp.o:(kdBacktraceFD(int))
c++: error: linker command failed with exit code 1 (use -v to see invocation)

Test on FreeBSD: ``` -- Looking for backtrace -- Looking for backtrace - not found -- Found Backtrace: /usr/lib/libexecinfo.so -- Performing Test HAVE_ABI_CXA_DEMANGLE -- Performing Test HAVE_ABI_CXA_DEMANGLE - Success ``` ``` ld: error: undefined symbol: backtrace >>> referenced by kdebug.cpp:813 (../tdecore/kdebug.cpp:813) >>> tdecore/CMakeFiles/tdecore-shared.dir/kdebug.cpp.o:(kdBacktrace(int)) ld: error: undefined symbol: backtrace >>> referenced by kdebug.cpp:843 (../tdecore/kdebug.cpp:843) >>> tdecore/CMakeFiles/tdecore-shared.dir/kdebug.cpp.o:(kdBacktraceFD(int)) ld: error: undefined symbol: backtrace_symbols_fd >>> referenced by kdebug.cpp:845 (../tdecore/kdebug.cpp:845) >>> tdecore/CMakeFiles/tdecore-shared.dir/kdebug.cpp.o:(kdBacktraceFD(int)) c++: error: linker command failed with exit code 1 (use -v to see invocation) ```
SlavekB requested changes 4 years ago
SlavekB left a comment
Owner

The test on Wheezy (CMake 2.8.x) and Stretch (CMake 3.7.x) is fine, but the test on FreeBSD ends with FTBFS. See comment above.

The test on Wheezy (CMake 2.8.x) and Stretch (CMake 3.7.x) is fine, but the test on FreeBSD ends with FTBFS. See comment above.
Owner

FTBFS on FreeBSD (with external library for backtrace) resolved in commit 59debdf4f0.

FTBFS on FreeBSD (with external library for backtrace) resolved in commit 59debdf4f0.
SlavekB requested review from MicheleC 4 years ago
SlavekB approved these changes 4 years ago
SlavekB left a comment
Owner

Successfully tested on DEB distributions and on FreeBSD.

Successfully tested on DEB distributions and on FreeBSD.
MicheleC approved these changes 4 years ago
MicheleC left a comment
Owner

Looks good to me 👍

Looks good to me :+1:
MicheleC merged commit 59debdf4f0 into master 4 years ago
MicheleC deleted branch feat/add-libexecinfo-support 4 years ago
MicheleC added this to the R14.0.9 release milestone 4 years ago
Owner

Thanks Obata for the PR and Slavek for testing and fixing in FreeBSD.

Thanks Obata for the PR and Slavek for testing and fixing in FreeBSD.
obache commented 4 years ago
Poster
Collaborator

Sorry, I missed to add the diff for CMakeLists.txt in this PR.
It is because I don't have master branch test environment, just backported to master from patchset for release taball manually.

Sorry, I missed to add the diff for CMakeLists.txt in this PR. It is because I don't have master branch test environment, just backported to master from patchset for release taball manually.
Owner

Sorry, I missed to add the diff for CMakeLists.txt in this PR.
It is because I don't have master branch test environment, just backported to master from patchset for release taball manually.

No worries Obata-san, keep up the excellent work you are doing 😄 It is very much appreciated.

> Sorry, I missed to add the diff for CMakeLists.txt in this PR. > It is because I don't have master branch test environment, just backported to master from patchset for release taball manually. No worries Obata-san, keep up the excellent work you are doing :smile: It is very much appreciated.

Reviewers

SlavekB approved these changes 4 years ago
MicheleC approved these changes 4 years ago
The pull request has been merged as 59debdf4f0.
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: TDE/tdelibs#103
Loading…
There is no content yet.