| author | |
| committer | |
| log | 5fd579a51c44c31b99cf34d9e8ada3b7692b4c43 |
| tree | 635d1974a3e7f3de08c9ff20298a2d954adaad08 |
| parent | ff2c7946128fac8488e393655e1a3371983b7620 |
see #2738 files changed, 20 insertions(+), 5 deletions(-)
ci/travis_osx_script+1-4| ... | @@ -12,7 +12,4 @@ cd build | ... | @@ -12,7 +12,4 @@ cd build |
| 12 | cmake .. -DCMAKE_PREFIX_PATH=$PREFIX_DIR -DCMAKE_INSTALL_PREFIX=$(pwd) -DZIG_LIBC_LIB_DIR=$(dirname $($CC -print-file-name=crt1.o)) -DZIG_LIBC_INCLUDE_DIR=$(echo -n | $CC -E -x c - -v 2>&1 | grep -B1 "End of search list." | head -n1 | cut -c 2- | sed "s/ .*//") -DZIG_LIBC_STATIC_LIB_DIR=$(dirname $($CC -print-file-name=crtbegin.o)) | 12 | cmake .. -DCMAKE_PREFIX_PATH=$PREFIX_DIR -DCMAKE_INSTALL_PREFIX=$(pwd) -DZIG_LIBC_LIB_DIR=$(dirname $($CC -print-file-name=crt1.o)) -DZIG_LIBC_INCLUDE_DIR=$(echo -n | $CC -E -x c - -v 2>&1 | grep -B1 "End of search list." | head -n1 | cut -c 2- | sed "s/ .*//") -DZIG_LIBC_STATIC_LIB_DIR=$(dirname $($CC -print-file-name=crtbegin.o)) |
| 13 | make VERBOSE=1 | 13 | make VERBOSE=1 |
| 14 | make install | 14 | make install |
| 15 | # TODO get full test suite passing on macos | 15 | ./zig build --build-file ../build.zig test-behavior test-std test-compiler-rt test-compare-output test-compile-errors test-asm-link test-debug-safety test-parseh |
| 16 | ./zig test ../test/behavior.zig | ||
| 17 | ./zig test ../test/behavior.zig --release-fast | ||
| 18 | # ./zig build --build-file ../build.zig test |
src/analyze.cpp+1-1| ... | @@ -1968,7 +1968,7 @@ static void resolve_decl_fn(CodeGen *g, TldFn *tld_fn) { | ... | @@ -1968,7 +1968,7 @@ static void resolve_decl_fn(CodeGen *g, TldFn *tld_fn) { |
| 1968 | if (buf_eql_str(&fn_table_entry->symbol_name, "main")) { | 1968 | if (buf_eql_str(&fn_table_entry->symbol_name, "main")) { |
| 1969 | g->main_fn = fn_table_entry; | 1969 | g->main_fn = fn_table_entry; |
| 1970 | 1970 | ||
| 1971 | if (g->libc_link_lib == nullptr && tld_fn->base.visib_mod != VisibModExport) { | 1971 | if (tld_fn->base.visib_mod != VisibModExport) { |
| 1972 | TypeTableEntry *err_void = get_error_type(g, g->builtin_types.entry_void); | 1972 | TypeTableEntry *err_void = get_error_type(g, g->builtin_types.entry_void); |
| 1973 | TypeTableEntry *actual_return_type = fn_table_entry->type_entry->data.fn.fn_type_id.return_type; | 1973 | TypeTableEntry *actual_return_type = fn_table_entry->type_entry->data.fn.fn_type_id.return_type; |
| 1974 | if (actual_return_type != err_void) { | 1974 | if (actual_return_type != err_void) { |
std/c/index.zig+1| ... | @@ -36,3 +36,4 @@ pub extern "c" fn execve(path: &const u8, argv: &const ?&const u8, | ... | @@ -36,3 +36,4 @@ pub extern "c" fn execve(path: &const u8, argv: &const ?&const u8, |
| 36 | envp: &const ?&const u8) -> c_int; | 36 | envp: &const ?&const u8) -> c_int; |
| 37 | pub extern "c" fn dup(fd: c_int) -> c_int; | 37 | pub extern "c" fn dup(fd: c_int) -> c_int; |
| 38 | pub extern "c" fn dup2(old_fd: c_int, new_fd: c_int) -> c_int; | 38 | pub extern "c" fn dup2(old_fd: c_int, new_fd: c_int) -> c_int; |
| 39 | pub extern "c" fn readlink(noalias path: &const u8, noalias buf: &u8, bufsize: usize) -> isize; |
std/os/darwin.zig+5| ... | @@ -23,6 +23,7 @@ pub const MAP_NORESERVE = 0x0040; /// don't reserve needed swap area | ... | @@ -23,6 +23,7 @@ pub const MAP_NORESERVE = 0x0040; /// don't reserve needed swap area |
| 23 | pub const MAP_FAILED = @maxValue(usize); | 23 | pub const MAP_FAILED = @maxValue(usize); |
| 24 | 24 | ||
| 25 | pub const O_LARGEFILE = 0x0000; | 25 | pub const O_LARGEFILE = 0x0000; |
| 26 | pub const O_PATH = 0x0000; | ||
| 26 | 27 | ||
| 27 | pub const O_RDONLY = 0x0000; /// open for reading only | 28 | pub const O_RDONLY = 0x0000; /// open for reading only |
| 28 | pub const O_WRONLY = 0x0001; /// open for writing only | 29 | pub const O_WRONLY = 0x0001; /// open for writing only |
| ... | @@ -198,6 +199,10 @@ pub fn dup2(old: i32, new: i32) -> usize { | ... | @@ -198,6 +199,10 @@ pub fn dup2(old: i32, new: i32) -> usize { |
| 198 | errnoWrap(c.dup2(old, new)) | 199 | errnoWrap(c.dup2(old, new)) |
| 199 | } | 200 | } |
| 200 | 201 | ||
| 202 | pub fn readlink(noalias path: &const u8, noalias buf_ptr: &u8, buf_len: usize) -> usize { | ||
| 203 | errnoWrap(c.readlink(path, buf_ptr, buf_len)) | ||
| 204 | } | ||
| 205 | |||
| 201 | /// Takes the return value from a syscall and formats it back in the way | 206 | /// Takes the return value from a syscall and formats it back in the way |
| 202 | /// that the kernel represents it to libc. Errno was a mistake, let's make | 207 | /// that the kernel represents it to libc. Errno was a mistake, let's make |
| 203 | /// it go away forever. | 208 | /// it go away forever. |
std/special/compiler_rt/udivmoddi4.zig+3| ... | @@ -1,6 +1,9 @@ | ... | @@ -1,6 +1,9 @@ |
| 1 | const udivmod = @import("udivmod.zig").udivmod; | 1 | const udivmod = @import("udivmod.zig").udivmod; |
| 2 | const builtin = @import("builtin"); | ||
| 2 | 3 | ||
| 3 | export fn __udivmoddi4(a: u64, b: u64, maybe_rem: ?&u64) -> u64 { | 4 | export fn __udivmoddi4(a: u64, b: u64, maybe_rem: ?&u64) -> u64 { |
| 5 | @setDebugSafety(this, builtin.is_test); | ||
| 6 | @setGlobalLinkage(__udivmoddi4, builtin.GlobalLinkage.LinkOnce); | ||
| 4 | return udivmod(u64, a, b, maybe_rem); | 7 | return udivmod(u64, a, b, maybe_rem); |
| 5 | } | 8 | } |
| 6 | 9 |
std/special/compiler_rt/udivmodti4.zig+3| ... | @@ -1,6 +1,9 @@ | ... | @@ -1,6 +1,9 @@ |
| 1 | const udivmod = @import("udivmod.zig").udivmod; | 1 | const udivmod = @import("udivmod.zig").udivmod; |
| 2 | const builtin = @import("builtin"); | ||
| 2 | 3 | ||
| 3 | export fn __udivmodti4(a: u128, b: u128, maybe_rem: ?&u128) -> u128 { | 4 | export fn __udivmodti4(a: u128, b: u128, maybe_rem: ?&u128) -> u128 { |
| 5 | @setDebugSafety(this, builtin.is_test); | ||
| 6 | @setGlobalLinkage(__udivmodti4, builtin.GlobalLinkage.LinkOnce); | ||
| 4 | return udivmod(u128, a, b, maybe_rem); | 7 | return udivmod(u128, a, b, maybe_rem); |
| 5 | } | 8 | } |
| 6 | 9 |
std/special/compiler_rt/udivti3.zig+3| ... | @@ -1,5 +1,8 @@ | ... | @@ -1,5 +1,8 @@ |
| 1 | const __udivmodti4 = @import("udivmodti4.zig").__udivmodti4; | 1 | const __udivmodti4 = @import("udivmodti4.zig").__udivmodti4; |
| 2 | const builtin = @import("builtin"); | ||
| 2 | 3 | ||
| 3 | export fn __udivti3(a: u128, b: u128) -> u128 { | 4 | export fn __udivti3(a: u128, b: u128) -> u128 { |
| 5 | @setDebugSafety(this, builtin.is_test); | ||
| 6 | @setGlobalLinkage(__udivti3, builtin.GlobalLinkage.LinkOnce); | ||
| 4 | return __udivmodti4(a, b, null); | 7 | return __udivmodti4(a, b, null); |
| 5 | } | 8 | } |
std/special/compiler_rt/umodti3.zig+3| ... | @@ -1,6 +1,9 @@ | ... | @@ -1,6 +1,9 @@ |
| 1 | const __udivmodti4 = @import("udivmodti4.zig").__udivmodti4; | 1 | const __udivmodti4 = @import("udivmodti4.zig").__udivmodti4; |
| 2 | const builtin = @import("builtin"); | ||
| 2 | 3 | ||
| 3 | export fn __umodti3(a: u128, b: u128) -> u128 { | 4 | export fn __umodti3(a: u128, b: u128) -> u128 { |
| 5 | @setDebugSafety(this, builtin.is_test); | ||
| 6 | @setGlobalLinkage(__umodti3, builtin.GlobalLinkage.LinkOnce); | ||
| 4 | var r: u128 = undefined; | 7 | var r: u128 = undefined; |
| 5 | _ = __udivmodti4(a, b, &r); | 8 | _ = __udivmodti4(a, b, &r); |
| 6 | return r; | 9 | return r; |