aboutsummaryrefslogtreecommitdiff
path: root/src/compiler.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-02-17 15:23:59 -0500
committerAndrew Kelley <andrew@ziglang.org>2020-02-17 15:23:59 -0500
commit2f9c5c0644dd516ec0d96f33333a35e6b4deea91 (patch)
tree852e7d7273da760a3a36ea551343f5e01bfe8f5a /src/compiler.cpp
parentc784c52819e505620fb1fcb48e59a48c6d8f487e (diff)
downloadzig-2f9c5c0644dd516ec0d96f33333a35e6b4deea91.tar.gz
zig-2f9c5c0644dd516ec0d96f33333a35e6b4deea91.zip
self-host dynamic linker detection
Diffstat (limited to 'src/compiler.cpp')
-rw-r--r--src/compiler.cpp34
1 files changed, 0 insertions, 34 deletions
diff --git a/src/compiler.cpp b/src/compiler.cpp
index 484a4ca089..31bac4ee24 100644
--- a/src/compiler.cpp
+++ b/src/compiler.cpp
@@ -4,20 +4,6 @@
#include <stdio.h>
-static Buf saved_dynamic_linker_path = BUF_INIT;
-static bool searched_for_dyn_linker = false;
-
-static void detect_dynamic_linker(Buf *lib_path) {
-#if defined(ZIG_OS_LINUX)
- for (size_t i = 0; possible_ld_names[i] != NULL; i += 1) {
- if (buf_ends_with_str(lib_path, possible_ld_names[i])) {
- buf_init_from_buf(&saved_dynamic_linker_path, lib_path);
- break;
- }
- }
-#endif
-}
-
Buf *get_self_libc_path(void) {
static Buf saved_libc_path = BUF_INIT;
static bool searched_for_libc = false;
@@ -43,25 +29,6 @@ Buf *get_self_libc_path(void) {
}
}
-Buf *get_self_dynamic_linker_path(void) {
- for (;;) {
- if (saved_dynamic_linker_path.list.length != 0) {
- return &saved_dynamic_linker_path;
- }
- if (searched_for_dyn_linker)
- return nullptr;
- ZigList<Buf *> lib_paths = {};
- Error err;
- if ((err = os_self_exe_shared_libs(lib_paths)))
- return nullptr;
- for (size_t i = 0; i < lib_paths.length; i += 1) {
- Buf *lib_path = lib_paths.at(i);
- detect_dynamic_linker(lib_path);
- }
- searched_for_dyn_linker = true;
- }
-}
-
Error get_compiler_id(Buf **result) {
static Buf saved_compiler_id = BUF_INIT;
@@ -98,7 +65,6 @@ Error get_compiler_id(Buf **result) {
return err;
for (size_t i = 0; i < lib_paths.length; i += 1) {
Buf *lib_path = lib_paths.at(i);
- detect_dynamic_linker(lib_path);
if ((err = cache_add_file(ch, lib_path)))
return err;
}