Fixed TAC related bugs caused by function integration patch
authorj-h.choi <j-h.choi@samsung.com>
Thu, 22 Feb 2024 01:00:32 +0000 (10:00 +0900)
committer조웅석/MDE Lab(SR)/삼성전자 <ws77.cho@samsung.com>
Wed, 28 Feb 2024 06:17:14 +0000 (15:17 +0900)
Change-Id: Ib274591f120e7d8ed89b568c67de042cba21e07a

NativeLauncher/tool/ni_common.cc

index bacf923..f7b69ad 100644 (file)
@@ -973,8 +973,11 @@ ni_error_e createNIUnderTAC(const std::string& targetPath, const std::string& re
 {
        ni_error_e ret;
 
+       // NI fils of TAC-related dlls under /opt/usr/dotnet should not be created under .native_image directory.
+       // So, unset NI_FLAGS_APPNI temporally and restore it after running AOT.
        bool isAppNI = false;
        if (opt->flags & NI_FLAGS_APPNI) {
+               opt->flags &= ~NI_FLAGS_APPNI;
                isAppNI = true;
        }
 
@@ -1006,19 +1009,14 @@ ni_error_e createNIUnderTAC(const std::string& targetPath, const std::string& re
        }
 
        if (!needNIList.empty()) {
-               // NI fils of TAC-related dlls under /opt/usr/dotnet should not be created under .native_image directory.
-               // So, unset NI_FLAGS_APPNI temporally and restore it after running AOT.
-               opt->flags &= ~NI_FLAGS_APPNI;
                ret = doAOTList(needNIList, refPaths, opt);
-               if (isAppNI) {
-                       opt->flags |= NI_FLAGS_APPNI;
-               }
                if (ret != NI_ERROR_NONE) {
                        return ret;
                }
        }
 
        if (isAppNI) {
+               opt->flags |= NI_FLAGS_APPNI;
                for (auto &niPath : niList) {
                        if (exist(niPath)) {
                                std::string symNIPath = concatPath(targetPath, getFileName(niPath));