mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 03:51:18 +00:00
@@ -383,17 +383,24 @@ static const char *find_linux_crt(void)
|
||||
{
|
||||
if (compiler.build.linuxpaths.crt) return compiler.build.linuxpaths.crt;
|
||||
const char *arch_linux_crt1_path = "/usr/lib/crt1.o";
|
||||
const char *arch_linux_64_crt1_path = "/usr/lib64/crt1.o";
|
||||
if (file_exists(arch_linux_crt1_path))
|
||||
{
|
||||
const char *arch_linux_path = "/usr/lib";
|
||||
INFO_LOG("Found crt at %s", arch_linux_path);
|
||||
return arch_linux_path;
|
||||
}
|
||||
if (file_exists(arch_linux_64_crt1_path))
|
||||
{
|
||||
const char* arch_linux_path = "/usr/lib64";
|
||||
INFO_LOG("Found crt at %s", arch_linux_path);
|
||||
return arch_linux_path;
|
||||
}
|
||||
const char *arch_glob_path = get_linux_crt_arch_glob();
|
||||
const char *path = find_arch_glob_path(arch_glob_path, 6);
|
||||
if (!path)
|
||||
{
|
||||
INFO_LOG("No crt in /usr/lib/*/");
|
||||
INFO_LOG("No crt in /usr/{lib,lib64}/*/");
|
||||
return NULL;
|
||||
}
|
||||
INFO_LOG("Found crt at %s", path);
|
||||
@@ -964,10 +971,10 @@ static bool link_exe(const char *output_file, const char **files_to_link, unsign
|
||||
default:
|
||||
UNREACHABLE
|
||||
}
|
||||
#else
|
||||
#else
|
||||
success = false;
|
||||
error = "linking (.exe) is not implemented for C3C compiled without LLVM";
|
||||
#endif
|
||||
#endif
|
||||
if (!success)
|
||||
{
|
||||
error_exit("Failed to create an executable: %s", error);
|
||||
@@ -1221,10 +1228,10 @@ bool dynamic_lib_linker(const char *output_file, const char **files, unsigned fi
|
||||
default:
|
||||
UNREACHABLE
|
||||
}
|
||||
#else
|
||||
#else
|
||||
success = false;
|
||||
error = "linking not implemented for c3c compiled without llvm";
|
||||
#endif
|
||||
#endif
|
||||
if (!success)
|
||||
{
|
||||
error_exit("Failed to create a dynamic library: %s", error);
|
||||
@@ -1256,9 +1263,9 @@ bool static_lib_linker(const char *output_file, const char **files, unsigned fil
|
||||
break;
|
||||
}
|
||||
return llvm_ar(output_file, files, file_count, format);
|
||||
#else
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
bool linker(const char *output_file, const char **files, unsigned file_count)
|
||||
|
||||
Reference in New Issue
Block a user