Skip to contentSkip to conversation

package/wireshark: fix static build with snappy

PATCH New Fabrice Fontaine 4 participants 8 messages May 28, 2019 – Jan 10, 2020

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 package/wireshark: fix static build with snappy

Fixes:
- http://autobuild.buildroot.org/results/419468f0d7d3c2b64d420513aa9505c6de097ed2

---
Changes v1 -> v2 (after review of Arnout Vandecappelle):
- Set linker to CXX instead of adding -lstdc++ to LIBS

 ...s.txt-fix-static-linking-with-snappy.patch | 98 +++++++++++++++++++
 1 file changed, 98 insertions(+)
 create mode 100644 package/wireshark/0005-CMakeLists.txt-fix-static-linking-with-snappy.patch
package/wireshark/0005-CMakeLists.txt-fix-static-linking-with-snappy.patch new file +98 -0
new file mode 100644
index 0000000000..e9233aa90f
@@ -0,0 +1,98 @@
+From eb226af7ae998cda6b9747d9e77692fda85563bc Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <[email protected]>
+Date: Tue, 28 May 2019 21:26:19 +0200
+Subject: [PATCH] CMakeLists.txt: fix static linking with snappy
+
+snappy is a C++ library so cxx linker must be used to avoid errors
+when statically linking:
+
+/home/buildroot/autobuild/instance-1/output/host/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libsnappy.a(snappy.cc.o): In function `snappy::internal::WorkingMemory::GetHashTable(unsigned int, int*)':
+snappy.cc:(.text+0x358): undefined reference to `operator new[](unsigned int)'
+
+Fixes:
+ - http://autobuild.buildroot.org/results/faa65da84ace974426e220205f4665fc0a73bdfe
+
+Signed-off-by: Fabrice Fontaine <[email protected]>
+---
+ CMakeLists.txt | 30 ++++++++++++++++++++++++++++++
+ 1 file changed, 30 insertions(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index e2fdafc227..cf5b8dfd56 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -2191,6 +2191,11 @@ if(BUILD_wireshark AND QT_FOUND)
+ 	if(ENABLE_APPLICATION_BUNDLE OR WIN32)
+ 		set_target_properties(wireshark PROPERTIES OUTPUT_NAME Wireshark)
+ 	endif()
++	# epan links with snappy which is a C++ library so use cxx linker to
++	# avoid error when statically linking
++	if(SNAPPY_FOUND)
++		set_target_properties(wireshark PROPERTIES LINKER_LANGUAGE CXX)
++	endif(SNAPPY_FOUND)
+ 
+ 	if(ENABLE_APPLICATION_BUNDLE)
+ 		add_dependencies(wireshark manpages)
+@@ -2306,6 +2311,11 @@ if(BUILD_tshark)
+ 	add_executable(tshark ${tshark_FILES})
+ 	set_extra_executable_properties(tshark "Executables")
+ 	target_link_libraries(tshark ${tshark_LIBS})
++	# epan links with snappy which is a C++ library so use cxx linker to
++	# avoid error when statically linking
++	if(SNAPPY_FOUND)
++		set_target_properties(tshark PROPERTIES LINKER_LANGUAGE CXX)
++	endif(SNAPPY_FOUND)
+ 	install(TARGETS tshark RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+ endif()
+ 
+@@ -2329,6 +2339,11 @@ if(BUILD_tfshark)
+ 	add_executable(tfshark ${tfshark_FILES})
+ 	set_extra_executable_properties(tfshark "Executables")
+ 	target_link_libraries(tfshark ${tfshark_LIBS})
++	# epan links with snappy which is a C++ library so use cxx linker to
++	# avoid error when statically linking
++	if(SNAPPY_FOUND)
++		set_target_properties(tfshark PROPERTIES LINKER_LANGUAGE CXX)
++	endif(SNAPPY_FOUND)
+ 	install(TARGETS tfshark RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+ endif()
+ 
+@@ -2352,6 +2367,11 @@ if(BUILD_rawshark AND PCAP_FOUND)
+ 	add_executable(rawshark ${rawshark_FILES})
+ 	set_extra_executable_properties(rawshark "Executables")
+ 	target_link_libraries(rawshark ${rawshark_LIBS})
++	# epan links with snappy which is a C++ library so use cxx linker to
++	# avoid error when statically linking
++	if(SNAPPY_FOUND)
++		set_target_properties(rawshark PROPERTIES LINKER_LANGUAGE CXX)
++	endif(SNAPPY_FOUND)
+ 	install(TARGETS rawshark RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+ endif()
+ 
+@@ -2383,6 +2403,11 @@ if(BUILD_sharkd)
+ 	if(WIN32)
+ 		target_link_libraries(sharkd "ws2_32.lib")
+ 	endif(WIN32)
++	# epan links with snappy which is a C++ library so use cxx linker to
++	# avoid error when statically linking
++	if(SNAPPY_FOUND)
++		set_target_properties(sharkd PROPERTIES LINKER_LANGUAGE CXX)
++	endif(SNAPPY_FOUND)
+ 
+ 	install(TARGETS sharkd RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+ endif()
+@@ -2400,6 +2425,11 @@ if(BUILD_dftest)
+ 	add_executable(dftest ${dftest_FILES})
+ 	set_extra_executable_properties(dftest "Tests")
+ 	target_link_libraries(dftest ${dftest_LIBS})
++	# epan links with snappy which is a C++ library so use cxx linker to
++	# avoid error when statically linking
++	if(SNAPPY_FOUND)
++		set_target_properties(dftest PROPERTIES LINKER_LANGUAGE CXX)
++	endif(SNAPPY_FOUND)
+ endif()
+ 
+ if(BUILD_randpkt)
+-- 
+2.20.1
+
Signature · 1 line
2.20.1
#1 lore raw

PATCH v2 1/1 package/wireshark: fix static build with snappy

Hello,

Quoted 7 lines · On Tue, 28 May 2019 22:32:30 +0200 Fabrice Fontaine…

Fixes:
- http://autobuild.buildroot.org/results/419468f0d7d3c2b64d420513aa9505c6de097ed2

---
Changes v1 -> v2 (after review of Arnout Vandecappelle):
- Set linker to CXX instead of adding -lstdc++ to LIBS

Is this really the right thing to do? Ideally a program written in C should not have to know that a library it is using is written in C++.

We already had a similar situation in Buildroot, and so far we have added -lstdc++. For example:

ifeq ($(BR2_PACKAGE_DIRECTFB),y)
LINKS_CONF_ENV = ac_cv_path_DIRECTFB_CONFIG=$(STAGING_DIR)/usr/bin/directfb-config ifeq ($(BR2_STATIC_LIBS),y)
LINKS_CONF_ENV += LIBS=-lstdc++

and there's a few other examples in the tree. To be honest, I don't know what is the most correct solution, I'm just trying to make sure we solve a given problem in the same way everywhere.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw

PATCH v2 1/1 package/wireshark: fix static build with snappy

Dear Thomas and Arnout,

Le mar. 28 mai 2019 ? 22:42, Thomas Petazzoni
<[email protected]> a ?crit :

Quoted 20 lines

Hello,

Quoted 7 lines · On Tue, 28 May 2019 22:32:30 +0200 Fabrice Fontaine…

Fixes:
- http://autobuild.buildroot.org/results/419468f0d7d3c2b64d420513aa9505c6de097ed2

---
Changes v1 -> v2 (after review of Arnout Vandecappelle):
- Set linker to CXX instead of adding -lstdc++ to LIBS

Is this really the right thing to do? Ideally a program written in C should not have to know that a library it is using is written in C++.

We already had a similar situation in Buildroot, and so far we have added -lstdc++. For example:

Quoted 8 lines

ifeq ($(BR2_PACKAGE_DIRECTFB),y)
LINKS_CONF_ENV = ac_cv_path_DIRECTFB_CONFIG=$(STAGING_DIR)/usr/bin/directfb-config ifeq ($(BR2_STATIC_LIBS),y)
LINKS_CONF_ENV += LIBS=-lstdc++

and there's a few other examples in the tree. To be honest, I don't know what is the most correct solution, I'm just trying to make sure we solve a given problem in the same way everywhere.

I don't know either. You can apply the first or the second version of this patch.
Then, I'll send the chosen version upstream. If they don't like it, I'll have the second solution as a fallback.

Quoted 8 lines

Best regards,

Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

Best Regards,

Fabrice

#3 lore raw

PATCH v2 1/1 package/wireshark: fix static build with snappy

Quoted 20 lines · Fabrice Fontaine

Dear Thomas and Arnout,

Le mar. 28 mai 2019 ? 22:42, Thomas Petazzoni
<[email protected]> a ?crit :

Quoted 16 lines

Hello,

Quoted 7 lines · On Tue, 28 May 2019 22:32:30 +0200 Fabrice Fontaine…

Fixes:
- http://autobuild.buildroot.org/results/419468f0d7d3c2b64d420513aa9505c6de097ed2

---
Changes v1 -> v2 (after review of Arnout Vandecappelle):
- Set linker to CXX instead of adding -lstdc++ to LIBS

Is this really the right thing to do? Ideally a program written in C should not have to know that a library it is using is written in C++.

Hm, good point... Snappy provides a C wrapper, so there should indeed not be a
need for the client to use the C++ linker. Of course, there also shouldn't be a need for the client to link with libstdc++ :-). I guess ideally Snappy would somehow include the libstdc++ link in its EXPORT directive, but I have no idea how to achieve that...

Quoted 11 lines
Quoted 11 lines

We already had a similar situation in Buildroot, and so far we have added -lstdc++. For example:

ifeq ($(BR2_PACKAGE_DIRECTFB),y)
LINKS_CONF_ENV = ac_cv_path_DIRECTFB_CONFIG=$(STAGING_DIR)/usr/bin/directfb-config ifeq ($(BR2_STATIC_LIBS),y)
LINKS_CONF_ENV += LIBS=-lstdc++

and there's a few other examples in the tree. To be honest, I don't know what is the most correct solution, I'm just trying to make sure we solve a given problem in the same way everywhere.

In most other cases we don't do any patching but we pass it through LIBS or
similar. I don't think that that's possible with CMake.

For ICU, we patch the .pc file, which is the proper thing to do, but Snappy
doesn't have a .pc file.

The only one where we do it with patching is xvkbd, but there we create the
entire (generated) Makefile so it doesn't count.

But yeah, in keeping with the 'add -lstdc++' principle, and because the patch
is smaller, maybe v1 was better.

Quoted 2 lines

I don't know either. You can apply the first or the second version of this patch.

I reset its state to New. Now Thomas can decide :-)

Quoted 2 lines

Then, I'll send the chosen version upstream. If they don't like it, I'll have the second solution as a fallback.

Maybe just send both versions upstream, since you have them both now. Then they
can choose which one they like better.

Regards,
Arnout

#4 lore raw

PATCH v2 1/1 package/wireshark: fix static build with snappy

Hello,

Quoted 6 lines · On Tue, 28 May 2019 23:04:28 +0200 Arnout Vandecappelle <[email protected]> wrote:
Quoted 2 lines
Quoted 2 lines

Is this really the right thing to do? Ideally a program written in C should not have to know that a library it is using is written in C++.

Hm, good point... Snappy provides a C wrapper, so there should indeed not be a
need for the client to use the C++ linker. Of course, there also shouldn't be a need for the client to link with libstdc++ :-).

There is no need to link with libstdc++ when dynamic linking is used, which to me is another indication that using the C++ linker is not the right approach. Adding -lstdc++ is only necessary in static linking configuration, for the usual reason that libA -> libB -> libC in static linking scenarios requires passing -lC when linking libA.

Quoted 9 lines
Quoted 3 lines
Quoted 3 lines

and there's a few other examples in the tree. To be honest, I don't know what is the most correct solution, I'm just trying to make sure we solve a given problem in the same way everywhere.

In most other cases we don't do any patching but we pass it through
LIBS or similar. I don't think that that's possible with CMake.

For ICU, we patch the .pc file, which is the proper thing to do, but
Snappy doesn't have a .pc file.

Yes, but to me that's another indication that the right thing to do is to pass -lstdc++: if the packages were better, they would be using .pc files, and we would be able to specify -lstdc++ in their Libs.private. Once again, it shows that using the C++ linker is (to me) not the right approach.

Quoted 4 lines
Quoted 2 lines

I don't know either. You can apply the first or the second version of this patch.

I reset its state to New. Now Thomas can decide :-)

For the reasons stated above, I think I prefer v1.

Quoted 2 lines

Maybe just send both versions upstream, since you have them both
now. Then they can choose which one they like better.

The most correct solution for upstream would be for snappy to provide a .pc file, and for wireshark to use it.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#5 lore raw

PATCH v2 1/1 package/wireshark: fix static build with snappy

Quoted 25 lines · Thomas Petazzoni

Hello,

Quoted 6 lines · On Tue, 28 May 2019 23:04:28 +0200 Arnout Vandecappelle <[email protected]> wrote:
Quoted 2 lines
Quoted 2 lines

Is this really the right thing to do? Ideally a program written in C should not have to know that a library it is using is written in C++.

Hm, good point... Snappy provides a C wrapper, so there should indeed not be a
need for the client to use the C++ linker. Of course, there also shouldn't be a need for the client to link with libstdc++ :-).

There is no need to link with libstdc++ when dynamic linking is used, which to me is another indication that using the C++ linker is not the right approach. Adding -lstdc++ is only necessary in static linking configuration, for the usual reason that libA -> libB -> libC in static linking scenarios requires passing -lC when linking libA.

Quoted 7 lines
Quoted 3 lines
Quoted 3 lines

and there's a few other examples in the tree. To be honest, I don't know what is the most correct solution, I'm just trying to make sure we solve a given problem in the same way everywhere.

In most other cases we don't do any patching but we pass it through
LIBS or similar. I don't think that that's possible with CMake.

Quoted 8 lines
Quoted 2 lines

For ICU, we patch the .pc file, which is the proper thing to do, but
Snappy doesn't have a .pc file.

Yes, but to me that's another indication that the right thing to do is to pass -lstdc++: if the packages were better, they would be using .pc files, and we would be able to specify -lstdc++ in their Libs.private. Once again, it shows that using the C++ linker is (to me) not the right approach.

+1.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

I don't know either. You can apply the first or the second version of this patch.

I reset its state to New. Now Thomas can decide :-)

For the reasons stated above, I think I prefer v1.

+1

Quoted 5 lines
Quoted 2 lines

Maybe just send both versions upstream, since you have them both
now. Then they can choose which one they like better.

The most correct solution for upstream would be for snappy to provide a .pc file, and for wireshark to use it.

Not really. Both Snappy and wireshark are CMake packages, so even if Snappy
would install a .pc file, wireshark wouldn't use it because the CMake infra is preferred.

The real solution is that CMake has an equivalent of Libs.private, and that
Snappy populates it. But my CMake-fu is not up to this task I'm afraid. Well, I suppose I *could* find out, but I don't have the time for it :-)

Any CMake experts on the list?

Regards,
Arnout

#6 lore raw

PATCH v2 1/1 package/wireshark: fix static build with snappy

Dear all,

Le mer. 29 mai 2019 ? 10:49, Arnout Vandecappelle <[email protected]> a ?crit :

Quoted 26 lines · Thomas Petazzoni
Quoted 22 lines

Hello,

Quoted 6 lines · On Tue, 28 May 2019 23:04:28 +0200 Arnout Vandecappelle <[email protected]> wrote:
Quoted 2 lines
Quoted 2 lines

Is this really the right thing to do? Ideally a program written in C should not have to know that a library it is using is written in C++.

Hm, good point... Snappy provides a C wrapper, so there should indeed not be a
need for the client to use the C++ linker. Of course, there also shouldn't be a need for the client to link with libstdc++ :-).

There is no need to link with libstdc++ when dynamic linking is used, which to me is another indication that using the C++ linker is not the right approach. Adding -lstdc++ is only necessary in static linking configuration, for the usual reason that libA -> libB -> libC in static linking scenarios requires passing -lC when linking libA.

Quoted 4 lines
Quoted 3 lines
Quoted 3 lines

and there's a few other examples in the tree. To be honest, I don't know what is the most correct solution, I'm just trying to make sure we solve a given problem in the same way everywhere.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

In most other cases we don't do any patching but we pass it through
LIBS or similar. I don't think that that's possible with CMake.

For ICU, we patch the .pc file, which is the proper thing to do, but
Snappy doesn't have a .pc file.

Actually, former versions of snappy had a .pc file. A PR is opened since 2017 to readd it: https://github.com/google/snappy/pull/51.
It seems there was some activities on this PR in the last few days so I hope it will get merged.
I'll send a patch to add it to buildroot (with Libs.private).

Quoted 30 lines
Quoted 6 lines

Yes, but to me that's another indication that the right thing to do is to pass -lstdc++: if the packages were better, they would be using .pc files, and we would be able to specify -lstdc++ in their Libs.private. Once again, it shows that using the C++ linker is (to me) not the right approach.

+1.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

I don't know either. You can apply the first or the second version of this patch.

I reset its state to New. Now Thomas can decide :-)

For the reasons stated above, I think I prefer v1.

+1

Quoted 5 lines
Quoted 2 lines

Maybe just send both versions upstream, since you have them both
now. Then they can choose which one they like better.

The most correct solution for upstream would be for snappy to provide a .pc file, and for wireshark to use it.

Not really. Both Snappy and wireshark are CMake packages, so even if Snappy
would install a .pc file, wireshark wouldn't use it because the CMake infra is preferred.

Quoted 5 lines

The real solution is that CMake has an equivalent of Libs.private, and that
Snappy populates it. But my CMake-fu is not up to this task I'm afraid. Well, I suppose I *could* find out, but I don't have the time for it :-)

Any CMake experts on the list?

Actually, wireshark is already using pkg-config inside cmake to find most of his libraries, including snappy:
if( NOT WIN32)
find_package(PkgConfig)
pkg_search_module(SNAPPY libsnappy)
endif()

However, as usual, they don't forward those dependencies and override SNAPPY_LIBRARIES by SNAPPY_LIBRARY.
I'll fix it and a send a patch upstream to wireshark.

Quoted 3 lines

Regards,
Arnout

Best Regards,

Fabrice

#7 lore raw

PATCH v2 1/1 package/wireshark: fix static build with snappy

In reply to Fabrice Fontaine

Fabrice, All,

On 2019-05-28 22:32 +0200, Fabrice Fontaine spake thusly:

Quoted 4 lines

Fixes:
- http://autobuild.buildroot.org/results/419468f0d7d3c2b64d420513aa9505c6de097ed2

I had been contemplating that patch for quite some time now, and was really undecided what we were to be doing about it...

But now, we've accepted your patch to make woreshark depend on shared libraries, so this build failure should no longer occur any more, or so I hope.

Marked as "not applicable" in Patchwork.

Thank you!

Regards,
Yann E. MORIN.

Quoted 119 lines

---
Changes v1 -> v2 (after review of Arnout Vandecappelle):
- Set linker to CXX instead of adding -lstdc++ to LIBS

 ...s.txt-fix-static-linking-with-snappy.patch | 98 +++++++++++++++++++
 1 file changed, 98 insertions(+)
 create mode 100644 package/wireshark/0005-CMakeLists.txt-fix-static-linking-with-snappy.patch
package/wireshark/0005-CMakeLists.txt-fix-static-linking-with-snappy.patch new file +98 -0
new file mode 100644
index 0000000000..e9233aa90f
@@ -0,0 +1,98 @@
+From eb226af7ae998cda6b9747d9e77692fda85563bc Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <[email protected]>
+Date: Tue, 28 May 2019 21:26:19 +0200
+Subject: [PATCH] CMakeLists.txt: fix static linking with snappy
+
+snappy is a C++ library so cxx linker must be used to avoid errors
+when statically linking:
+
+/home/buildroot/autobuild/instance-1/output/host/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libsnappy.a(snappy.cc.o): In function `snappy::internal::WorkingMemory::GetHashTable(unsigned int, int*)':
+snappy.cc:(.text+0x358): undefined reference to `operator new[](unsigned int)'
+
+Fixes:
+ - http://autobuild.buildroot.org/results/faa65da84ace974426e220205f4665fc0a73bdfe
+
+Signed-off-by: Fabrice Fontaine <[email protected]>
+---
+ CMakeLists.txt | 30 ++++++++++++++++++++++++++++++
+ 1 file changed, 30 insertions(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index e2fdafc227..cf5b8dfd56 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -2191,6 +2191,11 @@ if(BUILD_wireshark AND QT_FOUND)
+ 	if(ENABLE_APPLICATION_BUNDLE OR WIN32)
+ 		set_target_properties(wireshark PROPERTIES OUTPUT_NAME Wireshark)
+ 	endif()
++	# epan links with snappy which is a C++ library so use cxx linker to
++	# avoid error when statically linking
++	if(SNAPPY_FOUND)
++		set_target_properties(wireshark PROPERTIES LINKER_LANGUAGE CXX)
++	endif(SNAPPY_FOUND)
+ 
+ 	if(ENABLE_APPLICATION_BUNDLE)
+ 		add_dependencies(wireshark manpages)
+@@ -2306,6 +2311,11 @@ if(BUILD_tshark)
+ 	add_executable(tshark ${tshark_FILES})
+ 	set_extra_executable_properties(tshark "Executables")
+ 	target_link_libraries(tshark ${tshark_LIBS})
++	# epan links with snappy which is a C++ library so use cxx linker to
++	# avoid error when statically linking
++	if(SNAPPY_FOUND)
++		set_target_properties(tshark PROPERTIES LINKER_LANGUAGE CXX)
++	endif(SNAPPY_FOUND)
+ 	install(TARGETS tshark RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+ endif()
+ 
+@@ -2329,6 +2339,11 @@ if(BUILD_tfshark)
+ 	add_executable(tfshark ${tfshark_FILES})
+ 	set_extra_executable_properties(tfshark "Executables")
+ 	target_link_libraries(tfshark ${tfshark_LIBS})
++	# epan links with snappy which is a C++ library so use cxx linker to
++	# avoid error when statically linking
++	if(SNAPPY_FOUND)
++		set_target_properties(tfshark PROPERTIES LINKER_LANGUAGE CXX)
++	endif(SNAPPY_FOUND)
+ 	install(TARGETS tfshark RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+ endif()
+ 
+@@ -2352,6 +2367,11 @@ if(BUILD_rawshark AND PCAP_FOUND)
+ 	add_executable(rawshark ${rawshark_FILES})
+ 	set_extra_executable_properties(rawshark "Executables")
+ 	target_link_libraries(rawshark ${rawshark_LIBS})
++	# epan links with snappy which is a C++ library so use cxx linker to
++	# avoid error when statically linking
++	if(SNAPPY_FOUND)
++		set_target_properties(rawshark PROPERTIES LINKER_LANGUAGE CXX)
++	endif(SNAPPY_FOUND)
+ 	install(TARGETS rawshark RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+ endif()
+ 
+@@ -2383,6 +2403,11 @@ if(BUILD_sharkd)
+ 	if(WIN32)
+ 		target_link_libraries(sharkd "ws2_32.lib")
+ 	endif(WIN32)
++	# epan links with snappy which is a C++ library so use cxx linker to
++	# avoid error when statically linking
++	if(SNAPPY_FOUND)
++		set_target_properties(sharkd PROPERTIES LINKER_LANGUAGE CXX)
++	endif(SNAPPY_FOUND)
+ 
+ 	install(TARGETS sharkd RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+ endif()
+@@ -2400,6 +2425,11 @@ if(BUILD_dftest)
+ 	add_executable(dftest ${dftest_FILES})
+ 	set_extra_executable_properties(dftest "Tests")
+ 	target_link_libraries(dftest ${dftest_LIBS})
++	# epan links with snappy which is a C++ library so use cxx linker to
++	# avoid error when statically linking
++	if(SNAPPY_FOUND)
++		set_target_properties(dftest PROPERTIES LINKER_LANGUAGE CXX)
++	endif(SNAPPY_FOUND)
+ endif()
+ 
+ if(BUILD_randpkt)
+-- 
+2.20.1
+
Signature · 6 lines
2.20.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'