Fix BZ #1280242, patch by Mamoru Tasaka.

This commit is contained in:
Susi Lehtola 2015-11-13 18:27:05 +01:00
parent 0994c5b3e5
commit 52e16fbe81
2 changed files with 29 additions and 1 deletions

22
cppcheck-1.70-link.patch Normal file
View File

@ -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})

View File

@ -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 <jussilehtola@fedoraproject.org> - 1.70-4
- Link whole archive (BZ #1280242), patch by Mamoru Tasaka.
* Wed Nov 11 2015 Susi Lehtola <jussilehtola@fedoraproject.org> - 1.70-3
- Enable HAVE_RULES.