Skip to content

Commit ce0e794

Browse files
committed
fix glibc builds on aarch64-linux-gnu
There was a missing include path in the compilation line, leading to incorrect fstat ABI. closes #3291
1 parent 579301c commit ce0e794

File tree

3 files changed

+4
-13
lines changed

3 files changed

+4
-13
lines changed

lib/std/io/test.zig

-9
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ const fs = std.fs;
1111
const File = std.fs.File;
1212

1313
test "write a file, read it, then delete it" {
14-
if (builtin.arch == .aarch64 and builtin.glibc_version != null) {
15-
// TODO https://github.com/ziglang/zig/issues/3288
16-
return error.SkipZigTest;
17-
}
1814
var raw_bytes: [200 * 1024]u8 = undefined;
1915
var allocator = &std.heap.FixedBufferAllocator.init(raw_bytes[0..]).allocator;
2016

@@ -611,11 +607,6 @@ test "c out stream" {
611607
}
612608

613609
test "File seek ops" {
614-
if (builtin.arch == .aarch64 and builtin.glibc_version != null) {
615-
// TODO https://github.com/ziglang/zig/issues/3288
616-
return error.SkipZigTest;
617-
}
618-
619610
const tmp_file_name = "temp_test_file.txt";
620611
var file = try File.openWrite(tmp_file_name);
621612
defer {

lib/std/os/test.zig

-4
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,6 @@ test "cpu count" {
9595
}
9696

9797
test "AtomicFile" {
98-
if (builtin.arch == .aarch64 and builtin.glibc_version != null) {
99-
// TODO https://github.com/ziglang/zig/issues/3288
100-
return error.SkipZigTest;
101-
}
10298
var buffer: [1024]u8 = undefined;
10399
const allocator = &std.heap.FixedBufferAllocator.init(buffer[0..]).allocator;
104100
const test_out_file = "tmp_atomic_file_test_dest.txt";

src/link.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -820,6 +820,10 @@ static void glibc_add_include_dirs(CodeGen *parent, CFile *c_file) {
820820
}
821821

822822
if (parent->zig_target->os == OsLinux) {
823+
c_file->args.append("-I");
824+
c_file->args.append(path_from_libc(parent, "glibc" OS_SEP "sysdeps" OS_SEP
825+
"unix" OS_SEP "sysv" OS_SEP "linux" OS_SEP "generic"));
826+
823827
c_file->args.append("-I");
824828
c_file->args.append(path_from_libc(parent, "glibc" OS_SEP "sysdeps" OS_SEP
825829
"unix" OS_SEP "sysv" OS_SEP "linux" OS_SEP "include"));

0 commit comments

Comments
 (0)