Compare commits

..

4 Commits

Author SHA1 Message Date
1cfc5ca71f spec: prerelease 0.4 for testing cross-compile
Change-Id: I26908b6b415483711f55338e45d7b2d862b5c028
2020-06-23 08:34:10 +00:00
7ee533d620 spec: remove unnecessary mcinspect*.debug file
Fixes: 612f364 "spec: include recently added debug tools"
Change-Id: I29779132567d18f9468e3cecf2c713ad1c51729b
2020-06-23 08:34:10 +00:00
28334c7a29 cmake: treat libdwarf as required library when cross-compiling
Change-Id: I23ffb46c867b05de0e732c96912d62c630ebb44c
2020-06-23 16:18:35 +09:00
697e9386b3 cmake: fix resovling dwarf.h
Fixes: 0e787b7 "cmake: fix resolving libdwarf"
Change-Id: Iccb491c8ad07db0f15f6b1798ee8a91edc808cf7
2020-06-22 13:33:50 +09:00
3 changed files with 11 additions and 9 deletions

View File

@ -10,7 +10,7 @@ project(mckernel C ASM)
set(MCKERNEL_VERSION "1.7.0")
# See "Fedora Packaging Guidlines -- Versioning"
set(MCKERNEL_RELEASE "0.3")
set(MCKERNEL_RELEASE "0.4")
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
# for rpmbuild
@ -136,17 +136,19 @@ if (NOT LIBIBERTY)
message(FATAL_ERROR "error: couldn't find libiberty")
endif()
# libdwarf-devel provides /usr/lib64/libdwarf.so
find_library(LIBDWARF dwarf)
# elfutils-devel provides /usr/include/dwarf.h
find_library(LIBEBL ebl)
if ((NOT LIBDWARF) OR (NOT LIBEBL))
if (NOT LIBDWARF)
if (CMAKE_CROSSCOMPILING)
message(FATAL_ERROR "Could not find libdwarf.so, install libdwarf-devel to ${CMAKE_FIND_ROOT_PATH}")
endif()
message("WARNING: libdwarf will be compiled locally")
set(LIBDWARF LIBDWARF-NOTFOUND)
set(LIBEBL LIBEBL-NOTFOUND)
enable_language(CXX)
else()
# Note that libdwarf-devel provides /usr/include/libdwarf/dwarf.h
# but elfutils-devel provides /usr/include/dwarf.h
# while mcinspect.c performs "#include <dwarf.h>"
find_path(DWARF_H dwarf.h PATH_SUFFIXES libdwarf)
endif()
if (ENABLE_QLMPI)

View File

@ -27,6 +27,7 @@ if (NOT LIBDWARF)
"${CMAKE_CURRENT_SOURCE_DIR}/lib/libdwarf/libdwarf/libdwarf/")
target_link_libraries(mcinspect dwarf z elf)
else()
target_include_directories(mcinspect PRIVATE ${DWARF_H})
target_link_libraries(mcinspect ${LIBDWARF})
endif()
target_link_libraries(mcinspect ${LIBBFD})

View File

@ -99,7 +99,6 @@ This package contains headers and libraries required for build apps using IHK/Mc
%{_bindir}/eclair-dump-backtrace.exp
%{_bindir}/mcinspect
%{_bindir}/mcps
/usr/lib/debug/usr/bin/mcinspect-%{version}-%{release}.%{_arch}.debug
%{_bindir}/vmcore2mckdump
%{_bindir}/mcstat
%{_libdir}/libihk.so