From 52e16fbe81efddeaeda9fbd004a44dfd910d84db Mon Sep 17 00:00:00 2001 From: Susi Lehtola Date: Fri, 13 Nov 2015 18:27:05 +0100 Subject: [PATCH] Fix BZ #1280242, patch by Mamoru Tasaka. --- cppcheck-1.70-link.patch | 22 ++++++++++++++++++++++ cppcheck.spec | 8 +++++++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 cppcheck-1.70-link.patch diff --git a/cppcheck-1.70-link.patch b/cppcheck-1.70-link.patch new file mode 100644 index 0000000..c695dde --- /dev/null +++ b/cppcheck-1.70-link.patch @@ -0,0 +1,22 @@ +--- cppcheck-1.70/cli/CMakeLists.txt.stlink 2015-11-13 15:07:57.987502410 +0900 ++++ cppcheck-1.70/cli/CMakeLists.txt 2015-11-13 16:13:30.256811541 +0900 +@@ -5,7 +5,7 @@ + file(GLOB mainfile "main.cpp") + list(REMOVE_ITEM srcs ${mainfile}) + +-link_libraries(${PROJECT_NAME} -ltinyxml2) ++link_libraries(-Wl,--whole-archive ${PROJECT_NAME} -Wl,--no-whole-archive -ltinyxml2) + + add_library(cli_lib OBJECT ${hdrs} ${srcs}) + +--- cppcheck-1.70/gui/CMakeLists.txt.stlink 2015-11-13 15:07:57.989502413 +0900 ++++ cppcheck-1.70/gui/CMakeLists.txt 2015-11-13 16:13:47.930824027 +0900 +@@ -21,7 +21,7 @@ + QT4_ADD_RESOURCES(resources "gui.qrc") + QT4_ADD_TRANSLATION(qms ${tss}) + +- link_libraries(${PROJECT_NAME} -ltinyxml2 ${QT_LIBRARIES}) ++ link_libraries(-Wl,--whole-archive ${PROJECT_NAME} -Wl,--no-whole-archive -ltinyxml2 ${QT_LIBRARIES}) + + add_executable(cppcheck-gui ${hdrs} ${srcs} ${uis_hdrs} ${resources} ${qms}) + diff --git a/cppcheck.spec b/cppcheck.spec index f79bc72..7e263d8 100644 --- a/cppcheck.spec +++ b/cppcheck.spec @@ -1,6 +1,6 @@ Name: cppcheck Version: 1.70 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Tool for static C/C++ code analysis Group: Development/Languages License: GPLv3+ @@ -15,6 +15,8 @@ Patch0: cppcheck-1.70-tinyxml.patch Patch1: cppcheck-1.70-translations.patch # Fix library install suffix Patch2: cppcheck-1.70-libsuffix.patch +# Link whole library +Patch3: cppcheck-1.70-link.patch BuildRequires: pcre-devel BuildRequires: tinyxml2-devel >= 2.1.0 @@ -45,6 +47,7 @@ This package contains the graphical user interface for cppcheck. %patch0 -p1 -b .tinyxml %patch1 -p1 -b .translations %patch2 -p1 -b .libsuffix +%patch3 -p1 -b .link # Make sure bundled tinyxml is not used rm -r externals/tinyxml @@ -102,6 +105,9 @@ rm -rf %{buildroot} %changelog +* Fri Nov 13 2015 Susi Lehtola - 1.70-4 +- Link whole archive (BZ #1280242), patch by Mamoru Tasaka. + * Wed Nov 11 2015 Susi Lehtola - 1.70-3 - Enable HAVE_RULES.