| author | |
| committer | |
| log | 6d73f89bf17e96349255b351ad0603644441947a |
| tree | 5cad7ae4e28e2cb10c4615b01a6344928e81aa61 |
| parent | b6203b89d6b41f17e44f7806f2244309fa3bd86c |
It's failing to compile std.os.dl_iterate_phdr correctly.3 files changed, 19 insertions(+), 2 deletions(-)
lib/std/builtin.zig+10-1| ... | ... | @@ -751,9 +751,18 @@ else |
| 751 | 751 | /// therefore must be kept in sync with the compiler implementation. |
| 752 | 752 | pub fn default_panic(msg: []const u8, error_return_trace: ?*StackTrace) noreturn { |
| 753 | 753 | @setCold(true); |
| 754 | ||
| 754 | 755 | // Until self-hosted catches up with stage1 language features, we have a simpler |
| 755 | 756 | // default panic function: |
| 756 | if (builtin.zig_backend != .stage1 and builtin.zig_backend != .stage2_llvm) { | |
| 757 | if ((builtin.zig_backend == .stage2_llvm and builtin.link_libc) or | |
| 758 | builtin.zig_backend == .stage2_c or | |
| 759 | builtin.zig_backend == .stage2_wasm or | |
| 760 | builtin.zig_backend == .stage2_arm or | |
| 761 | builtin.zig_backend == .stage2_aarch64 or | |
| 762 | builtin.zig_backend == .stage2_x86_64 or | |
| 763 | builtin.zig_backend == .stage2_x86 or | |
| 764 | builtin.zig_backend == .stage2_riscv64) | |
| 765 | { | |
| 757 | 766 | while (true) { |
| 758 | 767 | @breakpoint(); |
| 759 | 768 | } |
lib/std/c/linux.zig+5-1| ... | ... | @@ -263,7 +263,11 @@ pub extern "c" fn inotify_rm_watch(fd: fd_t, wd: c_int) c_int; |
| 263 | 263 | /// See std.elf for constants for this |
| 264 | 264 | pub extern "c" fn getauxval(__type: c_ulong) c_ulong; |
| 265 | 265 | |
| 266 | pub const dl_iterate_phdr_callback = fn (info: *dl_phdr_info, size: usize, data: ?*anyopaque) callconv(.C) c_int; | |
| 266 | pub const dl_iterate_phdr_callback = switch (builtin.zig_backend) { | |
| 267 | .stage1 => fn (info: *dl_phdr_info, size: usize, data: ?*anyopaque) callconv(.C) c_int, | |
| 268 | else => *const fn (info: *dl_phdr_info, size: usize, data: ?*anyopaque) callconv(.C) c_int, | |
| 269 | }; | |
| 270 | ||
| 267 | 271 | pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*anyopaque) c_int; |
| 268 | 272 | |
| 269 | 273 | pub extern "c" fn sigaltstack(ss: ?*stack_t, old_ss: ?*stack_t) c_int; |
src/Sema.zig+4| ... | ... | @@ -6231,6 +6231,10 @@ fn funcCommon( |
| 6231 | 6231 | comptime_params[i] = param.is_comptime or |
| 6232 | 6232 | try sema.typeRequiresComptime(block, param_src, param.ty); |
| 6233 | 6233 | is_generic = is_generic or comptime_params[i] or param.ty.tag() == .generic_poison; |
| 6234 | if (is_extern and is_generic) { | |
| 6235 | // TODO add note: function is generic because of this parameter | |
| 6236 | return sema.fail(block, param_src, "extern function cannot be generic", .{}); | |
| 6237 | } | |
| 6234 | 6238 | } |
| 6235 | 6239 | |
| 6236 | 6240 | is_generic = is_generic or |