From a80e40a7985a35da1ae4bd23a2abfed83f8a31ea Mon Sep 17 00:00:00 2001 From: "g.denis" Date: Tue, 10 Feb 2026 23:12:04 +0100 Subject: [PATCH] fix fedora dyn lib (#2917) * also look into /usr/lib64 --- src/compiler/linker.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/compiler/linker.c b/src/compiler/linker.c index 41da2e58f..84f4bb1d0 100644 --- a/src/compiler/linker.c +++ b/src/compiler/linker.c @@ -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)