mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Fix crt detection for Arch Linux (#1705)
* Fix crt detection for arch linux On archlinux, the crt is located directly in /usr/lib. Thus, the globbing done in find_linux_crt fails since it expects the crt to be in a subdirectory of /usr/lib. This patch fixes this issue.
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
- `static-lib` and `dynamic-lib` options from the command line now produces headers.
|
||||
- Fix bug outputting exported functions without predefined extname.
|
||||
- Fix problem where crt1 was linked for dynamic libraries on Linux and BSD. #1710
|
||||
- Fix CRT detection on Arch Linux.
|
||||
|
||||
### Stdlib changes
|
||||
- Increase BitWriter.write_bits limit up to 32 bits.
|
||||
|
||||
@@ -308,6 +308,13 @@ static const char *find_arch_glob_path(const char *glob_path, int file_len)
|
||||
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";
|
||||
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;
|
||||
}
|
||||
const char *path = find_arch_glob_path("/usr/lib/*/crt1.o", 6);
|
||||
if (!path)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user