package/wireshark: enable back static build
PATCH 1/1 package/wireshark: enable back static build
--- ...001-FindGLIB2.cmake-fix-static-build.patch | 39 +++++++++++++++++ ...ts.txt-disable-rpath-in-static-build.patch | 42 +++++++++++++++++++ package/wireshark/Config.in | 11 +++-- package/wireshark/wireshark.mk | 14 ++++++- 4 files changed, 98 insertions(+), 8 deletions(-) create mode 100644 package/wireshark/0001-FindGLIB2.cmake-fix-static-build.patch create mode 100644 package/wireshark/0002-CMakeLists.txt-disable-rpath-in-static-build.patch
package/wireshark/0001-FindGLIB2.cmake-fix-static-build.patch new file +39 -0
@@ -0,0 +1,39 @@ +From 388cd212f3f055600a37f550dd79b156193f3ce5 Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine <[email protected]> +Date: Tue, 16 Apr 2019 11:19:13 +0200 +Subject: [PATCH] FindGLIB2.cmake: fix static build + +captype, editcap and capinfos needs glib2 and its depedencies such as +pcre otherwise static build will fail on missing references + +Currenttly, FindGLIB2.cmake sets GLIB2_LIBRARIES to GLIB2_LIBRARY then +it checks for pcre library only when CMAKE_FIND_LIBRARIES_SUFFIXES is +equal to ".a". When it is equal to ".so;.a", pcre is not added even +if pkg-config has only found a static library. + +To fix this error, update FindGLIB2.cmake to append GLIB_LIBRARY to the +GLIB2_LIBRARIES. In the UNIX context, GLIB2_LIBRARIES will contain all +the needed dependencies returned by pkg-config + +Signed-off-by: Fabrice Fontaine <[email protected]> +[Upstream status: https://code.wireshark.org/review/#/c/32869/] +--- + cmake/modules/FindGLIB2.cmake | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/cmake/modules/FindGLIB2.cmake b/cmake/modules/FindGLIB2.cmake +index 2b55b742fe..46ad3c41a6 100644 +--- a/cmake/modules/FindGLIB2.cmake ++++ b/cmake/modules/FindGLIB2.cmake +@@ -92,7 +92,7 @@ find_package_handle_standard_args( GLIB2 + ) + + if( GLIB2_FOUND ) +- set( GLIB2_LIBRARIES ${GLIB2_LIBRARY} ) ++ list( APPEND GLIB2_LIBRARIES ${GLIB2_LIBRARY} ) + # Include transitive dependencies for static linking. + if(UNIX AND CMAKE_FIND_LIBRARY_SUFFIXES STREQUAL ".a") + find_library(PCRE_LIBRARY pcre) +-- +2.20.1 +
package/wireshark/0002-CMakeLists.txt-disable-rpath-in-static-build.patch new file +42 -0
42 lines not on this page · raw message
package/wireshark/Config.in +5 -6
@@ -4,7 +4,6 @@ config BR2_PACKAGE_WIRESHARK depends on BR2_USE_MMU # fork(), glib2 depends on BR2_USE_WCHAR # glib2 depends on BR2_TOOLCHAIN_HAS_THREADS # glib2 - depends on !BR2_STATIC_LIBS select BR2_PACKAGE_LIBPCAP select BR2_PACKAGE_LIBGCRYPT select BR2_PACKAGE_LIBGLIB2
@@ -20,6 +19,7 @@ config BR2_PACKAGE_WIRESHARK_GUI default y depends on BR2_INSTALL_LIBSTDCPP # qt5 depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL # qt5 + depends on !BR2_STATIC_LIBS # qt5 depends on BR2_PACKAGE_HAS_UDEV # qt5 input select BR2_PACKAGE_QT5 select BR2_PACKAGE_QT5BASE
@@ -33,14 +33,13 @@ config BR2_PACKAGE_WIRESHARK_GUI help Enable Qt5 GUI -comment "Qt5 GUI needs a udev /dev management and a toolchain w/ C++, NPTL" +comment "Qt5 GUI needs a udev /dev management and a toolchain w/ C++, NPTL, dynamic library" depends on !BR2_PACKAGE_HAS_UDEV || !BR2_INSTALL_LIBSTDCPP || \ - !BR2_TOOLCHAIN_HAS_THREADS_NPTL + !BR2_TOOLCHAIN_HAS_THREADS_NPTL || BR2_STATIC_LIBS endif # BR2_PACKAGE_WIRESHARK -comment "wireshark needs a toolchain w/ wchar, threads, dynamic library" +comment "wireshark needs a toolchain w/ wchar, threads" depends on BR2_PACKAGE_LIBGPG_ERROR_ARCH_SUPPORTS depends on BR2_USE_MMU - depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS || \ - BR2_STATIC_LIBS + depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS
package/wireshark/wireshark.mk +12 -2
@@ -17,8 +17,7 @@ WIRESHARK_MAKE_ENV = \ WIRESHARK_CONF_OPTS = \ -DENABLE_PCAP=ON \ - -DENABLE_SMI=OFF \ - -DENABLE_STATIC=OFF + -DENABLE_SMI=OFF # wireshark needs the host version of lemon during compilation. # This binrary is provided by sqlite-src (which is different from
@@ -147,6 +146,17 @@ else WIRESHARK_CONF_OPTS += -DBUILD_sdjournal=OFF endif +# Disable plugins as some of them (like l16mono) can't be built statically +ifeq ($(BR2_STATIC_LIBS),y) +WIRESHARK_CONF_OPTS += \ + -DENABLE_PLUGINS=OFF \ + -DENABLE_STATIC=ON +else +WIRESHARK_CONF_OPTS += \ + -DENABLE_PLUGINS=ON \ + -DENABLE_STATIC=OFF +endif + define WIRESHARK_REMOVE_DOCS find $(TARGET_DIR)/usr/share/wireshark -name '*.txt' -print0 \ -o -name '*.html' -print0 | xargs -0 rm -f
Signature · 1 line
2.20.1
PATCH 1/1 package/wireshark: enable back static build
package/wireshark/wireshark.mk else · line 157
Quoted 9 lines · Fabrice Fontaine
package/wireshark/wireshark.mk +9
-0+# Disable plugins as some of them (like l16mono) can't be built statically +ifeq ($(BR2_STATIC_LIBS),y) +WIRESHARK_CONF_OPTS += \ + -DENABLE_PLUGINS=OFF \ + -DENABLE_STATIC=ON +else +WIRESHARK_CONF_OPTS += \ + -DENABLE_PLUGINS=ON \ + -DENABLE_STATIC=OFF
I don't know what this option does, but is it the appropriate thing to do in
the STATIC_SHARED case?
Regards,
Arnout
Quoted 1 line
+endif
PATCH 1/1 package/wireshark: enable back static build
Le mar. 16 avr. 2019 ? 21:46, Arnout Vandecappelle <[email protected]> a ?crit :
Quoted 8 lines · Fabrice Fontaine
Quoted 4 lines
package/wireshark/wireshark.mk +4
-0+# Disable plugins as some of them (like l16mono) can't be built statically +ifeq ($(BR2_STATIC_LIBS),y) +WIRESHARK_CONF_OPTS += \ + -DENABLE_PLUGINS=OFF \
Quoted 8 lines
package/wireshark/wireshark.mk else · line 157
Quoted 5 lines
package/wireshark/wireshark.mk +5
-0+ -DENABLE_STATIC=ON +else +WIRESHARK_CONF_OPTS += \ + -DENABLE_PLUGINS=ON \ + -DENABLE_STATIC=OFFI don't know what this option does, but is it the appropriate thing to do in
theSTATIC_SHAREDcase?
ENABLE_STATIC is a wrapper to the standard BUILD_SHARED_LIBS variable:if(ENABLE_STATIC)
set(BUILD_SHARED_LIBS 0)else()
set(BUILD_SHARED_LIBS 1)endif()
I think that our policy is to set BUILD_SHARED_LIBS to ON in the STATIC_SHARED context.
Quoted 5 lines
Regards,
ArnoutQuoted 1 line
+endif
Best Regards,
Fabrice
PATCH 1/1 package/wireshark: enable back static build
In reply to Fabrice FontaineHello Fabrice,
Quoted 9 lines · On Tue, 16 Apr 2019 11:41:06 +0200 Fabrice Fontaine…
Signed-off-by Fabrice Fontaine <[email protected]>--- ...001-FindGLIB2.cmake-fix-static-build.patch | 39 +++++++++++++++++ ...ts.txt-disable-rpath-in-static-build.patch | 42 +++++++++++++++++++ package/wireshark/Config.in | 11 +++-- package/wireshark/wireshark.mk | 14 ++++++- 4 files changed, 98 insertions(+), 8 deletions(-) create mode 100644 package/wireshark/0001-FindGLIB2.cmake-fix-static-build.patch create mode 100644 package/wireshark/0002-CMakeLists.txt-disable-rpath-in-static-build.patch
Following the question from Arnout and your feedback, I have updated the .mk file with a comment to explain why ENABLE_STATIC=OFF is the right thing even for BR2_SHARED_STATIC_LIBS=y. And of course, I've applied to master. Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com