Use relative symlink for AOTC accepted/tizen_9.0_unified accepted/tizen_unified accepted/tizen_unified_dev accepted/tizen_unified_toolchain accepted/tizen_unified_x accepted/tizen_unified_x_asan tizen tizen_9.0 accepted/tizen/9.0/unified/20241030.234312 accepted/tizen/unified/20240909.100119 accepted/tizen/unified/dev/20240910.111451 accepted/tizen/unified/toolchain/20241004.102137 accepted/tizen/unified/x/20240910.014311 accepted/tizen/unified/x/asan/20241014.000546 tizen_9.0_m2_release
authorWoongsuk Cho <ws77.cho@samsung.com>
Sun, 8 Sep 2024 23:23:53 +0000 (08:23 +0900)
committer조웅석/MDE Lab(SR)/삼성전자 <ws77.cho@samsung.com>
Mon, 9 Sep 2024 01:47:34 +0000 (10:47 +0900)
In VD cases, an app is temporarily installed in a temporal location
and then moved to its actual location during device booting.

When the app is installed at the temporary location, if AOTC runs,
it creates internal symlinks for ni.dll and pdb.
If these symlinks are created based on absolute paths,
they will point to incorrect locations when the app's position changes later.

To resolve this issue, modify the code so that symlinks are generated using relative paths.

NativeLauncher/tool/ni_common.cc

index b144185..f5a00da 100644 (file)
@@ -427,7 +427,7 @@ static ni_error_e makePdbSymlinkForNI(std::string dllPath, std::string niPath)
                if (exist(pdbPath)) {
                        std::string targetPDBPath = changeExtension(niPath, ".ni.dll", ".pdb");
                        if (!exist(targetPDBPath)) {
-                               bf::create_symlink(pdbPath, targetPDBPath);
+                               bf::create_symlink(concatPath("..", getFileName(pdbPath)), targetPDBPath);
                                copySmackAndOwnership(pdbPath, targetPDBPath, true);
                        }
                }
@@ -691,7 +691,7 @@ static void renameAppNITmpPath(NIOption* opt)
                                        std::string niFile = ni.path().string();
                                        if (isNativeImage(niFile)) {
                                                std::string dllFile = changeExtension(niFile, ".ni.dll", ".dll");
-                                               bf::create_symlink(niFile, dllFile);
+                                               bf::create_symlink(getFileName(niFile), dllFile);
                                                copySmackAndOwnership(niFile, dllFile, true);
                                        }
                                }