hal-api: common: Add support of __x86_64__ architecture 56/274056/1 submit/tizen/20220421.032339
authorChanwoo Choi <cw00.choi@samsung.com>
Wed, 20 Apr 2022 11:16:11 +0000 (20:16 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Wed, 20 Apr 2022 11:16:22 +0000 (20:16 +0900)
If architecture type is __x86_64__, use /hal/lib64 path.

Change-Id: Ifee4aebb8a86a4f3ecfe2053b027d20288008067
Reported-by: Sungguk Na <sungguk.na@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
src/common.h
src/hal-api-common.c
src/hal-api-conf.c
tests/unittest/test_hal.cc

index 4a89747..93f7090 100644 (file)
@@ -118,7 +118,7 @@ static inline const char* get_backend_library_name(struct __hal_module_info *inf
        if (!info)
                return NULL;
 
-#if defined(__aarch64__)
+#if defined(__aarch64__) || defined(__x86_64__)
        return info->library_name_64bit;
 #else
        return info->library_name;
index 22c50e8..db73891 100644 (file)
@@ -610,7 +610,7 @@ static int __get_backend_library_data(enum hal_module module,
        DIR *dir;
        char *backend_module_name = NULL;
        int count, i, ret, len;
-#if defined(__aarch64__)
+#if defined(__aarch64__) || defined(__x86_64__)
        const char hal_backend_path[] = "/hal/lib64";
 #else
        const char hal_backend_path[] = "/hal/lib";
index a3c6c25..9495d3b 100644 (file)
@@ -118,7 +118,7 @@ static struct __hal_module_info* _get_module_info_with_library_name(enum hal_mod
        new_info->module = info->module;
        new_info->license = info->license;
        new_info->module_name = g_strdup(info->module_name);
-#if defined(__aarch64__)
+#if defined(__aarch64__) || defined(__x86_64__)
        new_info->library_name_64bit = g_strdup_printf("/hal/lib64/%s", library_name);
 #else
        new_info->library_name = g_strdup_printf("/hal/lib/%s", library_name);
index 639ced4..7d2a583 100644 (file)
@@ -362,7 +362,7 @@ TEST_P(HalInfoMatchedTest, get_backend_library_name) {
 
   ret = hal_common_get_backend_library_name(info.module_, ret_library_name, MAX_BUFF);
   EXPECT_TRUE(ret == TIZEN_ERROR_NONE);
-#if defined(__aarch64__)
+#if defined(__aarch64__) || defined(__x86_64__)
   EXPECT_STREQ(info.library_name_64bit_, ret_library_name) << "module name is " << info.module_name_;
 #else
   EXPECT_STREQ(info.library_name_, ret_library_name) << "module name is " << info.module_name_;