Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/dasLLVM
5 changes: 4 additions & 1 deletion src/builtin/module_builtin_math.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<IS_CMRES, NeedVectorWrap<RetT(*)()>::value, RetT(*)(), &ctorFn>::get_builtin_address();
}
};

class Module_Math : public Module {
Expand Down
2 changes: 1 addition & 1 deletion src/builtin/module_jit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 9 additions & 2 deletions src/misc/sysos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down