From ce0e7940926ec4c4eeb95e2d5b67554de3863a56 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Fri, 27 Sep 2019 18:19:21 -0400 Subject: [PATCH] fix glibc builds on aarch64-linux-gnu There was a missing include path in the compilation line, leading to incorrect fstat ABI. closes #3291 --- lib/std/io/test.zig | 9 --------- lib/std/os/test.zig | 4 ---- src/link.cpp | 4 ++++ 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/lib/std/io/test.zig b/lib/std/io/test.zig index 537a0b9719..8b2dc9e894 100644 --- a/lib/std/io/test.zig +++ b/lib/std/io/test.zig @@ -11,10 +11,6 @@ const fs = std.fs; const File = std.fs.File; test "write a file, read it, then delete it" { - if (builtin.arch == .aarch64 and builtin.glibc_version != null) { - // TODO https://github.com/ziglang/zig/issues/3288 - return error.SkipZigTest; - } var raw_bytes: [200 * 1024]u8 = undefined; var allocator = &std.heap.FixedBufferAllocator.init(raw_bytes[0..]).allocator; @@ -611,11 +607,6 @@ test "c out stream" { } test "File seek ops" { - if (builtin.arch == .aarch64 and builtin.glibc_version != null) { - // TODO https://github.com/ziglang/zig/issues/3288 - return error.SkipZigTest; - } - const tmp_file_name = "temp_test_file.txt"; var file = try File.openWrite(tmp_file_name); defer { diff --git a/lib/std/os/test.zig b/lib/std/os/test.zig index 87d57b36c0..d886597a38 100644 --- a/lib/std/os/test.zig +++ b/lib/std/os/test.zig @@ -95,10 +95,6 @@ test "cpu count" { } test "AtomicFile" { - if (builtin.arch == .aarch64 and builtin.glibc_version != null) { - // TODO https://github.com/ziglang/zig/issues/3288 - return error.SkipZigTest; - } var buffer: [1024]u8 = undefined; const allocator = &std.heap.FixedBufferAllocator.init(buffer[0..]).allocator; const test_out_file = "tmp_atomic_file_test_dest.txt"; diff --git a/src/link.cpp b/src/link.cpp index 41fb2ca415..d33ab10ebf 100644 --- a/src/link.cpp +++ b/src/link.cpp @@ -820,6 +820,10 @@ static void glibc_add_include_dirs(CodeGen *parent, CFile *c_file) { } if (parent->zig_target->os == OsLinux) { + c_file->args.append("-I"); + c_file->args.append(path_from_libc(parent, "glibc" OS_SEP "sysdeps" OS_SEP + "unix" OS_SEP "sysv" OS_SEP "linux" OS_SEP "generic")); + c_file->args.append("-I"); c_file->args.append(path_from_libc(parent, "glibc" OS_SEP "sysdeps" OS_SEP "unix" OS_SEP "sysv" OS_SEP "linux" OS_SEP "include"));