| ... | @@ -2009,6 +2009,75 @@ pub const DynamicLinker = struct { | ... | @@ -2009,6 +2009,75 @@ pub const DynamicLinker = struct { |
| 2009 | return std.mem.eql(u8, lhs.buffer[0..lhs.len], rhs.buffer[0..rhs.len]); | 2009 | return std.mem.eql(u8, lhs.buffer[0..lhs.len], rhs.buffer[0..rhs.len]); |
| 2010 | } | 2010 | } |
| 2011 | | 2011 | |
| | 2012 | pub const Kind = enum { |
| | 2013 | /// No dynamic linker. |
| | 2014 | none, |
| | 2015 | /// Dynamic linker path is determined by the arch/OS components. |
| | 2016 | arch_os, |
| | 2017 | /// Dynamic linker path is determined by the arch/OS/ABI components. |
| | 2018 | arch_os_abi, |
| | 2019 | }; |
| | 2020 | |
| | 2021 | pub fn kind(os: Os.Tag) Kind { |
| | 2022 | return switch (os) { |
| | 2023 | .fuchsia, |
| | 2024 | |
| | 2025 | .haiku, |
| | 2026 | .serenity, |
| | 2027 | |
| | 2028 | .dragonfly, |
| | 2029 | .freebsd, |
| | 2030 | .netbsd, |
| | 2031 | .openbsd, |
| | 2032 | |
| | 2033 | .bridgeos, |
| | 2034 | .driverkit, |
| | 2035 | .ios, |
| | 2036 | .macos, |
| | 2037 | .tvos, |
| | 2038 | .visionos, |
| | 2039 | .watchos, |
| | 2040 | |
| | 2041 | .illumos, |
| | 2042 | .solaris, |
| | 2043 | => .arch_os, |
| | 2044 | .hurd, |
| | 2045 | .linux, |
| | 2046 | => .arch_os_abi, |
| | 2047 | .freestanding, |
| | 2048 | .other, |
| | 2049 | |
| | 2050 | .contiki, |
| | 2051 | .elfiamcu, |
| | 2052 | .hermit, |
| | 2053 | |
| | 2054 | .aix, |
| | 2055 | .plan9, |
| | 2056 | .rtems, |
| | 2057 | .zos, |
| | 2058 | |
| | 2059 | .uefi, |
| | 2060 | .windows, |
| | 2061 | |
| | 2062 | .emscripten, |
| | 2063 | .wasi, |
| | 2064 | |
| | 2065 | .amdhsa, |
| | 2066 | .amdpal, |
| | 2067 | .cuda, |
| | 2068 | .mesa3d, |
| | 2069 | .nvcl, |
| | 2070 | .opencl, |
| | 2071 | .opengl, |
| | 2072 | .vulkan, |
| | 2073 | |
| | 2074 | .ps3, |
| | 2075 | .ps4, |
| | 2076 | .ps5, |
| | 2077 | => .none, |
| | 2078 | }; |
| | 2079 | } |
| | 2080 | |
| 2012 | pub fn standard(cpu: Cpu, os: Os, abi: Abi) DynamicLinker { | 2081 | pub fn standard(cpu: Cpu, os: Os, abi: Abi) DynamicLinker { |
| 2013 | return switch (os.tag) { | 2082 | return switch (os.tag) { |
| 2014 | .fuchsia => init("ld.so.1"), // Fuchsia is unusual in that `DT_INTERP` is just a basename. | 2083 | .fuchsia => init("ld.so.1"), // Fuchsia is unusual in that `DT_INTERP` is just a basename. |