Fix ASAN build failure for relocation R_X86_64_PC32 against symbol 20/173020/1 accepted/tizen/unified/20180320.065903 submit/tizen/20180319.080210
authorDongsun Lee <ds73.lee@samsung.com>
Mon, 19 Mar 2018 07:57:10 +0000 (16:57 +0900)
committerDong Sun Lee <ds73.lee@samsung.com>
Mon, 19 Mar 2018 07:58:33 +0000 (07:58 +0000)
Change-Id: If948594b3c34659b417128e4bc7daadffe0f90d0
Signed-off-by: Dongsun Lee <ds73.lee@samsung.com>
CMakeLists.txt
initializer/CMakeLists.txt [new file with mode: 0644]
initializer/drm-tapps-initialize.cpp [new file with mode: 0644]
service/drm-tapps-initialize.cpp [deleted file]

index a9d327a7477751a2ca3be6c0611e3b5610f7d004..b5c545ef7b26ec9dd20150fd4a40195531f28777 100644 (file)
@@ -87,36 +87,6 @@ TARGET_LINK_LIBRARIES(${PROJECT_NAME}
 
 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR})
 
-#################################################################
-PKG_CHECK_MODULES(DRM_INITIALIZE_DEP
-    REQUIRED
-    db-util
-    dlog
-    openssl
-)
-
-INCLUDE_DIRECTORIES(${DRM_INITIALIZE_DEP_INCLUDE_DIRS})
-
-SET(DRMTAPPSINITIALIZE_SRCS
-    service/drm-tapps-initialize.cpp
-    tappsd/src/db/DTapps2SqlData.cpp
-    tappsd/src/db/DTapps2SqliteDB.cpp
-    tappsd/src/intf/drm_intf_tapps.cpp
-)
-
-SET_SOURCE_FILES_PROPERTIES(${DRMTAPPSINITIALIZE_SRCS}
-    PROPERTIES
-        COMPILE_FLAGS "-fPIE"
-)
-
-ADD_EXECUTABLE(${DRMTAPPSINITIALIZE} ${DRMTAPPSINITIALIZE_SRCS})
-
-TARGET_LINK_LIBRARIES(${DRMTAPPSINITIALIZE}
-    ${DRM_INITIALIZE_DEP_LIBRARIES}
-    -pie
-)
-
-INSTALL(TARGETS ${DRMTAPPSINITIALIZE} DESTINATION ${BIN_DIR})
 #################################################################
 
 CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
@@ -130,6 +100,8 @@ INSTALL(FILES include/drm-tizen-apps.h include/drm-tizen-error.h
 
 #################################################################
 
+ADD_SUBDIRECTORY(initializer)
+
 IF(DEFINED BUILD_TEST_DRM_SERVICE_CORE_TIZEN)
     ADD_DEFINITIONS("-DTEST_DATA_DIR=\"${TEST_DATA_DIR}\"")
     ADD_SUBDIRECTORY(test)
diff --git a/initializer/CMakeLists.txt b/initializer/CMakeLists.txt
new file mode 100644 (file)
index 0000000..576ea75
--- /dev/null
@@ -0,0 +1,30 @@
+#################################################################
+PKG_CHECK_MODULES(DRM_INITIALIZE_DEP
+    REQUIRED
+    db-util
+    dlog
+    openssl
+)
+
+INCLUDE_DIRECTORIES(${DRM_INITIALIZE_DEP_INCLUDE_DIRS})
+
+SET(DRMTAPPSINITIALIZE_SRCS
+    ${PROJECT_SOURCE_DIR}/initializer/drm-tapps-initialize.cpp
+    ${PROJECT_SOURCE_DIR}/tappsd/src/db/DTapps2SqlData.cpp
+    ${PROJECT_SOURCE_DIR}/tappsd/src/db/DTapps2SqliteDB.cpp
+    ${PROJECT_SOURCE_DIR}/tappsd/src/intf/drm_intf_tapps.cpp
+)
+
+SET_SOURCE_FILES_PROPERTIES(${DRMTAPPSINITIALIZE_SRCS}
+    PROPERTIES
+        COMPILE_FLAGS "-fPIE"
+)
+
+ADD_EXECUTABLE(${DRMTAPPSINITIALIZE} ${DRMTAPPSINITIALIZE_SRCS})
+
+TARGET_LINK_LIBRARIES(${DRMTAPPSINITIALIZE}
+    ${DRM_INITIALIZE_DEP_LIBRARIES}
+    -pie
+)
+
+INSTALL(TARGETS ${DRMTAPPSINITIALIZE} DESTINATION ${BIN_DIR})
diff --git a/initializer/drm-tapps-initialize.cpp b/initializer/drm-tapps-initialize.cpp
new file mode 100644 (file)
index 0000000..dcba8b7
--- /dev/null
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2000-2015 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Flora License, Version 1.1 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <drm-tizen-mid.h>
+
+#include "DTapps2SqliteDB.h"
+
+static int __drm_tad_create_db(void)
+{
+       BOOL db_ret = FALSE;
+       int IsBeginSuccessful = 0;
+
+       char Table_Name[16] = "dtapps2rights";
+       char *sql_query_table = NULL;
+       void *pDb = NULL;
+
+       db_ret = DTappsDBOpen(pDb, __func__);
+
+       if (db_ret != TRUE) {
+               DRM_TAPPS_EXCEPTION("DTappsDBOpen FAILED");
+               return -1;
+       }
+
+       db_ret = DTappsDBBeginImmedTrans(__func__);
+
+       if (db_ret != TRUE) {
+               DRM_TAPPS_EXCEPTION("DTappsDBBeginImmedTrans FAILED");
+               goto ErrorExit;
+       }
+
+       IsBeginSuccessful = 1;
+
+       sql_query_table = DTappsGetSQLCreateTable(Table_Name);
+
+       if (sql_query_table == NULL) {
+               DRM_TAPPS_EXCEPTION("DTappsGetSQLCreateTable FAILED");
+               goto ErrorExit;
+       }
+
+       DRM_TAPPS_FRQ_LOG("sql_query_table = %s", sql_query_table);
+
+       db_ret = DTappsExecuteSQL(pDb, sql_query_table);
+
+       if (db_ret != TRUE) {
+               DRM_TAPPS_EXCEPTION("DTappsGetSQLCreateTable FAILED");
+               goto ErrorExit;
+       }
+
+       db_ret = DTappsDBCommit(__func__);
+
+       if (db_ret != TRUE) {
+               DRM_TAPPS_EXCEPTION("DTappsDBCommit FAILED");
+
+               goto ErrorExit;
+       }
+
+       db_ret = DTappsDBClose(__func__);
+
+       if (db_ret != TRUE) {
+               DRM_TAPPS_EXCEPTION("DTappsDBClose FAILED");
+               goto ErrorExit;
+       }
+
+       DRM_TAPPS_FRQ_LOG("TAD DB created successfully");
+
+       return 0;
+
+ErrorExit:
+
+       if (1 == IsBeginSuccessful)
+               DTappsDBRollback(__func__);
+
+       db_ret = DTappsDBClose(__func__);
+
+       if (db_ret != TRUE)
+               DRM_TAPPS_EXCEPTION("DTappsDBClose FAILED");
+
+       DRM_TAPPS_EXCEPTION("TAD DB creation FAILED");
+
+       return -1;
+}
+
+int main(int, char *[])
+{
+       DRM_TAPPS_FRQ_LOG("=========Start Create TAD DB file ============\n\n");
+
+       if (0 != __drm_tad_create_db()) {
+               DRM_TAPPS_EXCEPTION("=========Error Creating TAD DB file ============\n\n");
+               return 1;
+       }
+
+       DRM_TAPPS_FRQ_LOG("=========Success Created TAD DB file  ============\n\n");
+
+       return 0;
+}
diff --git a/service/drm-tapps-initialize.cpp b/service/drm-tapps-initialize.cpp
deleted file mode 100644 (file)
index dcba8b7..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (c) 2000-2015 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Flora License, Version 1.1 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://floralicense.org/license/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <drm-tizen-mid.h>
-
-#include "DTapps2SqliteDB.h"
-
-static int __drm_tad_create_db(void)
-{
-       BOOL db_ret = FALSE;
-       int IsBeginSuccessful = 0;
-
-       char Table_Name[16] = "dtapps2rights";
-       char *sql_query_table = NULL;
-       void *pDb = NULL;
-
-       db_ret = DTappsDBOpen(pDb, __func__);
-
-       if (db_ret != TRUE) {
-               DRM_TAPPS_EXCEPTION("DTappsDBOpen FAILED");
-               return -1;
-       }
-
-       db_ret = DTappsDBBeginImmedTrans(__func__);
-
-       if (db_ret != TRUE) {
-               DRM_TAPPS_EXCEPTION("DTappsDBBeginImmedTrans FAILED");
-               goto ErrorExit;
-       }
-
-       IsBeginSuccessful = 1;
-
-       sql_query_table = DTappsGetSQLCreateTable(Table_Name);
-
-       if (sql_query_table == NULL) {
-               DRM_TAPPS_EXCEPTION("DTappsGetSQLCreateTable FAILED");
-               goto ErrorExit;
-       }
-
-       DRM_TAPPS_FRQ_LOG("sql_query_table = %s", sql_query_table);
-
-       db_ret = DTappsExecuteSQL(pDb, sql_query_table);
-
-       if (db_ret != TRUE) {
-               DRM_TAPPS_EXCEPTION("DTappsGetSQLCreateTable FAILED");
-               goto ErrorExit;
-       }
-
-       db_ret = DTappsDBCommit(__func__);
-
-       if (db_ret != TRUE) {
-               DRM_TAPPS_EXCEPTION("DTappsDBCommit FAILED");
-
-               goto ErrorExit;
-       }
-
-       db_ret = DTappsDBClose(__func__);
-
-       if (db_ret != TRUE) {
-               DRM_TAPPS_EXCEPTION("DTappsDBClose FAILED");
-               goto ErrorExit;
-       }
-
-       DRM_TAPPS_FRQ_LOG("TAD DB created successfully");
-
-       return 0;
-
-ErrorExit:
-
-       if (1 == IsBeginSuccessful)
-               DTappsDBRollback(__func__);
-
-       db_ret = DTappsDBClose(__func__);
-
-       if (db_ret != TRUE)
-               DRM_TAPPS_EXCEPTION("DTappsDBClose FAILED");
-
-       DRM_TAPPS_EXCEPTION("TAD DB creation FAILED");
-
-       return -1;
-}
-
-int main(int, char *[])
-{
-       DRM_TAPPS_FRQ_LOG("=========Start Create TAD DB file ============\n\n");
-
-       if (0 != __drm_tad_create_db()) {
-               DRM_TAPPS_EXCEPTION("=========Error Creating TAD DB file ============\n\n");
-               return 1;
-       }
-
-       DRM_TAPPS_FRQ_LOG("=========Success Created TAD DB file  ============\n\n");
-
-       return 0;
-}