Remove visibility flag to export all classes 48/206248/2
authorSangyoon Jang <jeremy.jang@samsung.com>
Wed, 15 May 2019 11:14:57 +0000 (20:14 +0900)
committerSangyoon Jang <jeremy.jang@samsung.com>
Wed, 22 May 2019 05:45:23 +0000 (05:45 +0000)
This flag was added to reduce binary size, but it doesn't meaningful at
this time. And we need to export all classes for custom backends.

- Binary size comparison
 Before this patch: 1599404 Bytes
  After this patch: 1616560 Bytes

Change-Id: I12b6680671c220488494df130f5245c97c3d57c3
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
CMakeLists.txt
src/lib/tpk_pkgmgr.cc
src/tpk/step/filesystem/step_create_symbolic_link.h
src/tpk/step/filesystem/step_tpk_patch_icons.h
src/tpk/step/filesystem/step_tpk_prepare_package_directory.h
src/tpk/step/filesystem/step_tpk_update_package_directory.h
src/tpk/step/pkgmgr/step_manifest_adjustment.h
src/tpk/step/security/step_tpk_recover_signature.h
src/tpk/tpk_app_query_interface.h
src/tpk/tpk_installer.h

index 55aafb76239674a1e5e2a9828d47157ea521f003..41bda08ae5c10081ea4c3e7503be47842d012eb0 100644 (file)
@@ -11,7 +11,7 @@ IF(NOT CMAKE_BUILD_TYPE)
 ENDIF(NOT CMAKE_BUILD_TYPE)
 
 # Compiler flags
-SET(EXTRA_FLAGS "-fvisibility=hidden -Wall -Wextra")
+SET(EXTRA_FLAGS "-Wall -Wextra")
 SET(CMAKE_C_FLAGS_PROFILING    "-O2 -flto ${EXTRA_FLAGS}")
 SET(CMAKE_CXX_FLAGS_PROFILING  "-O2 -flto -std=c++11 ${EXTRA_FLAGS}")
 SET(CMAKE_C_FLAGS_DEBUG        "-O0 -g ${EXTRA_FLAGS}")
@@ -35,7 +35,6 @@ SET(TARGET_SMOKE_TEST_HELPER "smoke-test-helper")
 SET(TARGET_MANIFEST_TEST "manifest-test")
 
 ADD_DEFINITIONS("-DPROJECT_TAG=\"TPK_BACKEND\"")
-ADD_DEFINITIONS("-DTPK_BACKEND_EXPORT_API=__attribute__((visibility(\"default\")))")
 
 SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/")
 INCLUDE(FindPkgConfig)
index 798123b7ad5d4b0fe19c8ac0f2f9922af0ce59a3..44a673f5b83f3f3e5be725184500070b0639f6f5 100644 (file)
@@ -20,7 +20,7 @@ void PluginOnUnload() {
 
 }  // namespace
 
-extern "C" TPK_BACKEND_EXPORT_API int pkg_plugin_on_load(pkg_plugin_set* set) {
+int pkg_plugin_on_load(pkg_plugin_set* set) {
   if (set == nullptr)
     return -1;
   set->plugin_on_unload = PluginOnUnload;
index 81d8b60db3da63d6d6874b4e94e9c72b3653b053..5a7f57cc6fc3d2c24d485e6eea142157c5320387 100644 (file)
@@ -3,10 +3,6 @@
 #ifndef TPK_STEP_FILESYSTEM_STEP_CREATE_SYMBOLIC_LINK_H_
 #define TPK_STEP_FILESYSTEM_STEP_CREATE_SYMBOLIC_LINK_H_
 
-#ifndef TPK_BACKEND_EXPORT_API
-#define TPK_BACKEND_EXPORT_API
-#endif
-
 #include <manifest_parser/utils/logging.h>
 
 #include <common/app_installer.h>
@@ -14,8 +10,7 @@
 namespace tpk {
 namespace filesystem {
 
-class TPK_BACKEND_EXPORT_API StepCreateSymbolicLink
-    : public common_installer::Step {
+class StepCreateSymbolicLink : public common_installer::Step {
  public:
   using Step::Step;
   Status process() override;
index 2d7d96d8bc4acf2d087a8859965dea7250ad8531..1458cbfe6a6b7738f08447e18491af76421aaddd 100644 (file)
@@ -5,10 +5,6 @@
 #ifndef TPK_STEP_FILESYSTEM_STEP_TPK_PATCH_ICONS_H_
 #define TPK_STEP_FILESYSTEM_STEP_TPK_PATCH_ICONS_H_
 
-#ifndef TPK_BACKEND_EXPORT_API
-#define TPK_BACKEND_EXPORT_API
-#endif
-
 #include <boost/filesystem/path.hpp>
 
 #include <common/step/step.h>
@@ -22,7 +18,7 @@ namespace filesystem {
  *        Fixes location of icons for tpk apps if icons are not located in
  *        "shared/res/" directory.
  */
-class TPK_BACKEND_EXPORT_API StepTpkPatchIcons : public common_installer::Step {
+class StepTpkPatchIcons : public common_installer::Step {
  public:
   using Step::Step;
 
index b27cf7f157da06f41a9d267df6ddef793df67a68..ed15094876653a0a9434e280e15625caff199b16 100644 (file)
@@ -5,10 +5,6 @@
 #ifndef TPK_STEP_FILESYSTEM_STEP_TPK_PREPARE_PACKAGE_DIRECTORY_H_
 #define TPK_STEP_FILESYSTEM_STEP_TPK_PREPARE_PACKAGE_DIRECTORY_H_
 
-#ifndef TPK_BACKEND_EXPORT_API
-#define TPK_BACKEND_EXPORT_API
-#endif
-
 #include <manifest_parser/utils/logging.h>
 
 #include <boost/filesystem/path.hpp>
@@ -42,8 +38,7 @@ namespace filesystem {
  *    - signature*.xml
  *    - res/
  */
-class TPK_BACKEND_EXPORT_API StepTpkPreparePackageDirectory
-    : public common_installer::Step {
+class StepTpkPreparePackageDirectory : public common_installer::Step {
  public:
   using Step::Step;
 
index 9f0fea6a82e55d73980dbd51acd7abe628ecb927..f647c006a4a157b96dd5f2979e8471e2b0d3b99e 100644 (file)
@@ -5,10 +5,6 @@
 #ifndef TPK_STEP_FILESYSTEM_STEP_TPK_UPDATE_PACKAGE_DIRECTORY_H_
 #define TPK_STEP_FILESYSTEM_STEP_TPK_UPDATE_PACKAGE_DIRECTORY_H_
 
-#ifndef TPK_BACKEND_EXPORT_API
-#define TPK_BACKEND_EXPORT_API
-#endif
-
 #include <boost/filesystem/path.hpp>
 #include <manifest_parser/utils/logging.h>
 
@@ -26,8 +22,7 @@ namespace filesystem {
  * This step will, additionally to base step actions, ,aintain backup
  * of directories from point 1) for operation rollback scenario.
  */
-class TPK_BACKEND_EXPORT_API StepTpkUpdatePackageDirectory
-    : public StepTpkPreparePackageDirectory {
+class StepTpkUpdatePackageDirectory : public StepTpkPreparePackageDirectory {
  public:
   using StepTpkPreparePackageDirectory::StepTpkPreparePackageDirectory;
 
index 7b38639261fff133fbdc8db2a5cb2850029fb985..6d3986a27dc726fd9ffa37802437d0b22fc0e928 100644 (file)
@@ -5,10 +5,6 @@
 #ifndef TPK_STEP_PKGMGR_STEP_MANIFEST_ADJUSTMENT_H_
 #define TPK_STEP_PKGMGR_STEP_MANIFEST_ADJUSTMENT_H_
 
-#ifndef TPK_BACKEND_EXPORT_API
-#define TPK_BACKEND_EXPORT_API
-#endif
-
 #include <manifest_parser/utils/logging.h>
 
 #include <boost/filesystem/path.hpp>
@@ -18,8 +14,7 @@
 namespace tpk {
 namespace pkgmgr {
 
-class TPK_BACKEND_EXPORT_API StepManifestAdjustment
-    : public common_installer::Step {
+class StepManifestAdjustment : public common_installer::Step {
  public:
   using Step::Step;
 
index bf97c172c138b721cb3c34cc4c5887b42e099a62..420f999c79d2cec8bac50f15089a0818b812afc9 100644 (file)
@@ -5,10 +5,6 @@
 #ifndef TPK_STEP_SECURITY_STEP_TPK_RECOVER_SIGNATURE_H_
 #define TPK_STEP_SECURITY_STEP_TPK_RECOVER_SIGNATURE_H_
 
-#ifndef TPK_BACKEND_EXPORT_API
-#define TPK_BACKEND_EXPORT_API
-#endif
-
 #include <common/step/security/step_recover_signature.h>
 
 #include <boost/filesystem/path.hpp>
@@ -16,7 +12,7 @@
 namespace tpk {
 namespace security {
 
-class TPK_BACKEND_EXPORT_API StepTpkRecoverSignature
+class StepTpkRecoverSignature
     : public common_installer::security::StepRecoverSignature {
  public:
   using StepRecoverSignature::StepRecoverSignature;
index a34c95215dfe6209fe7a69378fff84a8c8570c6d..9246b6a9f19ad46a2a4104eda1af3b206438ed71 100644 (file)
@@ -5,10 +5,6 @@
 #ifndef TPK_TPK_APP_QUERY_INTERFACE_H_
 #define TPK_TPK_APP_QUERY_INTERFACE_H_
 
-#ifndef TPK_BACKEND_EXPORT_API
-#define TPK_BACKEND_EXPORT_API
-#endif
-
 #include <common/app_query_interface.h>
 
 #include <sys/types.h>
@@ -17,8 +13,7 @@
 
 namespace tpk {
 
-class TPK_BACKEND_EXPORT_API TpkAppQueryInterface
-    : public common_installer::AppQueryInterface {
+class TpkAppQueryInterface : public common_installer::AppQueryInterface {
  private:
   std::string GetPkgIdFromPath(const std::string& path) const override;
   std::string GetManifestFileName() const override;
index bc078693abe1d87d6f43bcf2fc129d34d9cb36d8..e80e5dd0274d72466f98c701a24b11d718a9251c 100644 (file)
@@ -3,10 +3,6 @@
 #ifndef TPK_TPK_INSTALLER_H_
 #define TPK_TPK_INSTALLER_H_
 
-#ifndef TPK_BACKEND_EXPORT_API
-#define TPK_BACKEND_EXPORT_API
-#endif
-
 #include <common/app_installer.h>
 #include <common/pkgmgr_interface.h>
 #include <manifest_parser/utils/logging.h>
@@ -21,8 +17,7 @@ namespace tpk {
  * packages. Pkgmgr request is parsed within and sequence of steps is built to
  * be run.
  */
-class TPK_BACKEND_EXPORT_API TpkInstaller
-    : public common_installer::AppInstaller {
+class TpkInstaller : public common_installer::AppInstaller {
  public:
   explicit TpkInstaller(common_installer::PkgMgrPtr pkgmgr);
   ~TpkInstaller();