From a3a83598b3e0d8cb15777f1063ef556c38e09c49 Mon Sep 17 00:00:00 2001 From: Churkin Aleksey Date: Sun, 30 Nov 2025 21:22:25 +0300 Subject: [PATCH 1/3] wrap mat ctors in jit --- src/builtin/module_builtin_math.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/builtin/module_builtin_math.cpp b/src/builtin/module_builtin_math.cpp index 4e531f923a..fb8ee3c024 100644 --- a/src/builtin/module_builtin_math.cpp +++ b/src/builtin/module_builtin_math.cpp @@ -580,7 +580,10 @@ namespace das { memset(&res, 0, sizeof(RetT)); return res; } - virtual void * getBuiltinAddress() const override { return (void *) &ctorFn; } + virtual void * getBuiltinAddress() const override { + constexpr bool IS_CMRES = true; + return ImplWrapCall::value, RetT(*)(), &ctorFn>::get_builtin_address(); + } }; class Module_Math : public Module { From d735544b74f3c0f7a28567b50ecf871b4efddb8c Mon Sep 17 00:00:00 2001 From: Churkin Aleksey Date: Sun, 30 Nov 2025 21:22:45 +0300 Subject: [PATCH 2/3] make jit work on mac --- src/builtin/module_jit.cpp | 2 +- src/misc/sysos.cpp | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/builtin/module_jit.cpp b/src/builtin/module_jit.cpp index 9b9c69eb17..3ee6ae2d97 100644 --- a/src/builtin/module_jit.cpp +++ b/src/builtin/module_jit.cpp @@ -411,7 +411,7 @@ extern "C" { #if defined(_WIN32) || defined(_WIN64) auto result = fmt::format_to(cmd, FMT_STRING("clang-cl {} {} msvcrt.lib -link -DLL -OUT:{} 2>&1"), objFilePath, jitModuleObj, libraryName); #elif defined(__APPLE__) - auto result = fmt::format_to(cmd, FMT_STRING("clang -shared -o {} {} 2>&1"), libraryName, objFilePath); + auto result = fmt::format_to(cmd, FMT_STRING("clang -shared -o {} {} {} 2>&1"), libraryName, jitModuleObj, objFilePath); #else auto result = fmt::format_to(cmd, FMT_STRING("gcc -shared -o {} {} 2>&1"), libraryName, objFilePath); #endif diff --git a/src/misc/sysos.cpp b/src/misc/sysos.cpp index 8d45b99a94..b532cdb54c 100644 --- a/src/misc/sysos.cpp +++ b/src/misc/sysos.cpp @@ -444,8 +444,15 @@ return dlopen(lib,RTLD_LAZY); } string normalizeFileName ( const char * fileName ) { - // TODO: implement - return ""; + char buffer[PATH_MAX]; + + // Use realpath to resolve the absolute path and normalize it + if (realpath(fileName, buffer) != nullptr) { + return buffer; + } else { + // If realpath fails (e.g., file doesn't exist), fallback + return fileName ? fileName : ""; + } } bool closeLibrary ( void * module ) { return dlclose(module) == 0; From 8b8a0552b0fe3646f9bec5cf2a728cd7093fb272 Mon Sep 17 00:00:00 2001 From: Boris Batkin Date: Mon, 1 Dec 2025 08:08:23 -0800 Subject: [PATCH 3/3] up2date --- modules/dasLLVM | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/dasLLVM b/modules/dasLLVM index b1df7ab2e2..6e0c2f124d 160000 --- a/modules/dasLLVM +++ b/modules/dasLLVM @@ -1 +1 @@ -Subproject commit b1df7ab2e23884251773255cf8e26b702ac2eb5c +Subproject commit 6e0c2f124d6f632478726625e475a39d7f8950ad