[PATCH spice-streaming-agent 6/8 v2] Export symbols in the binary to use by the plugins

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This commits adds the -export-dynamic linker flag to export dynamic
symbols to be used by the streaming agent's plugins. It also adds the
-fvisibility=hidden compiler flag to hide all symbols by default (along
with -fvisibility-inline-hidden for C++ inline functions).

Then it adds the visibility("default") attribute to the namespace
containing the Error class, as that one needs to be exported and have
its typeinfo defined for exception catching to work.

Signed-off-by: Lukáš Hrázký <lhrazky@xxxxxxxxxx>
Acked-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
---
 include/spice-streaming-agent/error.hpp | 2 +-
 src/Makefile.am                         | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/include/spice-streaming-agent/error.hpp b/include/spice-streaming-agent/error.hpp
index 3202d78..c0d4755 100644
--- a/include/spice-streaming-agent/error.hpp
+++ b/include/spice-streaming-agent/error.hpp
@@ -11,7 +11,7 @@
 #include <string>
 
 
-namespace spice {
+namespace spice __attribute__ ((visibility ("default"))) {
 namespace streaming_agent {
 
 class Error : public std::runtime_error
diff --git a/src/Makefile.am b/src/Makefile.am
index dc64c29..bae3f9d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -22,10 +22,13 @@ AM_CPPFLAGS = \
 	$(NULL)
 
 AM_CFLAGS = \
+	-fvisibility=hidden \
 	$(WARN_CFLAGS) \
 	$(NULL)
 
 AM_CXXFLAGS = \
+	-fvisibility=hidden \
+	-fvisibility-inlines-hidden \
 	$(WARN_CXXFLAGS) \
 	$(NULL)
 
@@ -38,6 +41,7 @@ libstreaming_utils_a_SOURCES = \
 	$(NULL)
 
 spice_streaming_agent_LDFLAGS = \
+	-export-dynamic \
 	$(RELRO_LDFLAGS) \
 	$(NO_INDIRECT_LDFLAGS) \
 	$(NULL)
-- 
2.20.1

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]