diff options
| author | Greg V <greg@unrelenting.technology> | 2018-10-17 22:21:16 +0300 |
|---|---|---|
| committer | Greg V <greg@unrelenting.technology> | 2018-10-20 15:21:35 +0300 |
| commit | 831bb668955fa9d332f7beb1ea11f1c8028e5235 (patch) | |
| tree | bab62d5c936214739e177dbac1d91603cdf2eac5 /src | |
| parent | a983a0a59b348a885f24656a8646707554170574 (diff) | |
| download | zig-831bb668955fa9d332f7beb1ea11f1c8028e5235.tar.gz zig-831bb668955fa9d332f7beb1ea11f1c8028e5235.zip | |
Set up libc/rtld paths for FreeBSD
Diffstat (limited to 'src')
| -rw-r--r-- | src/analyze.cpp | 6 | ||||
| -rw-r--r-- | src/link.cpp | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp index e71369eac9..4d7fe1a656 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -4606,7 +4606,7 @@ void find_libc_include_path(CodeGen *g) { } } else if (g->zig_target.os == OsLinux) { g->libc_include_dir = get_linux_libc_include_path(); - } else if (g->zig_target.os == OsMacOSX) { + } else if (g->zig_target.os == OsMacOSX || g->zig_target.os == OsFreeBSD) { g->libc_include_dir = buf_create_from_str("/usr/include"); } else { // TODO find libc at runtime for other operating systems @@ -4652,6 +4652,8 @@ void find_libc_lib_path(CodeGen *g) { } else if (g->zig_target.os == OsLinux) { g->libc_lib_dir = get_linux_libc_lib_path("crt1.o"); + } else if (g->zig_target.os == OsFreeBSD) { + g->libc_lib_dir = buf_create_from_str("/usr/lib"); } else { zig_panic("Unable to determine libc lib path."); } @@ -4664,6 +4666,8 @@ void find_libc_lib_path(CodeGen *g) { return; } else if (g->zig_target.os == OsLinux) { g->libc_static_lib_dir = get_linux_libc_lib_path("crtbegin.o"); + } else if (g->zig_target.os == OsFreeBSD) { + g->libc_static_lib_dir = buf_create_from_str("/usr/lib"); } else { zig_panic("Unable to determine libc static lib path."); } diff --git a/src/link.cpp b/src/link.cpp index 613768cec8..0913b96a01 100644 --- a/src/link.cpp +++ b/src/link.cpp @@ -195,6 +195,9 @@ static Buf *try_dynamic_linker_path(const char *ld_name) { } static Buf *get_dynamic_linker_path(CodeGen *g) { + if (g->zig_target.os == OsFreeBSD) { + return buf_create_from_str("/libexec/ld-elf.so.1"); + } if (g->is_native_target && g->zig_target.arch.arch == ZigLLVM_x86_64) { static const char *ld_names[] = { "ld-linux-x86-64.so.2", |
