Apply -fvisibility to decrease binary size 32/111732/1
authorJihoon Kim <jihoon48.kim@samsung.com>
Mon, 23 Jan 2017 22:57:33 +0000 (07:57 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Mon, 23 Jan 2017 23:00:36 +0000 (08:00 +0900)
The size of ise-engine-default.so is decreased from 22KB to 17KB

Change-Id: Iad03a9cd07c920284143b1dbe01febb123c411f8
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
packaging/ise-engine-default.spec
src/isf_default_imengine.cpp

index d72780b..5b39ef7 100644 (file)
@@ -15,8 +15,8 @@ it is based on Input Service Framework(ISF).
 %setup -q
 
 %build
-export CFLAGS+=" -Werror"
-export CXXFLAGS+=" -Werror"
+export CFLAGS+=" -Werror -fvisibility=hidden"
+export CXXFLAGS+=" -Werror -fvisibility=hidden -fvisibility-inlines-hidden"
 %autogen
 %configure --prefix=%{_prefix} --disable-static
 make %{?_smp_mflags}
index f0445ab..db60ea5 100644 (file)
@@ -29,6 +29,8 @@
 #include <config.h>
 #endif
 
+#define EXAPI __attribute__ ((visibility("default")))
+
 #include <scim.h>
 #include "kdb_resource.h"
 #include "isf_default_imengine.h"
@@ -65,21 +67,21 @@ static ConfigPointer _scim_config(0);
 static int m_keypad_layout;
 
 extern "C" {
-       void scim_module_init(void) {
+       EXAPI void scim_module_init(void) {
                bindtextdomain(GETTEXT_PACKAGE, ISF_DEFAULT_LOCALEDIR);
                bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
        }
 
-       void scim_module_exit(void) {
+       EXAPI void scim_module_exit(void) {
                _scim_config.reset();
        }
 
-       uint32 scim_imengine_module_init(const ConfigPointer & config) {
+       EXAPI uint32 scim_imengine_module_init(const ConfigPointer & config) {
                _scim_config = config;
                return 1;
        }
 
-       IMEngineFactoryPointer scim_imengine_module_create_factory(uint32
+       EXAPI IMEngineFactoryPointer scim_imengine_module_create_factory(uint32
                        engine) {
                DefaultFactory *factory = 0;