Merge pull request #174 from birth-software/switch-to-fedora
Switch to Fedora as development machine
This commit is contained in:
commit
acfacb747a
@ -654,8 +654,8 @@ pub fn compileCSourceFile(context: *const Context, arguments: []const []const u8
|
|||||||
"/usr/include/x86_64-linux-gnu",
|
"/usr/include/x86_64-linux-gnu",
|
||||||
} else switch (@import("builtin").cpu.arch) {
|
} else switch (@import("builtin").cpu.arch) {
|
||||||
.x86_64 => &.{
|
.x86_64 => &.{
|
||||||
"/usr/include/c++/13.2.1",
|
"/usr/include/c++/14",
|
||||||
"/usr/include/c++/13.2.1/x86_64-pc-linux-gnu",
|
"/usr/include/c++/14/x86_64-redhat-linux",
|
||||||
"/usr/lib/clang/17/include",
|
"/usr/lib/clang/17/include",
|
||||||
"/usr/include",
|
"/usr/include",
|
||||||
"/usr/include/linux",
|
"/usr/include/linux",
|
||||||
|
@ -89,27 +89,18 @@ pub fn link(context: *const Compilation.Context, options: linker.Options) !void
|
|||||||
} else {
|
} else {
|
||||||
if (options.link_libcpp) {
|
if (options.link_libcpp) {
|
||||||
assert(options.link_libc);
|
assert(options.link_libc);
|
||||||
switch (@import("builtin").cpu.arch) {
|
_ = argv.append("/usr/lib64/libstdc++.so.6");
|
||||||
.x86_64 => _ = argv.append("/usr/lib/libstdc++.so"),
|
|
||||||
.aarch64 => _ = argv.append("/usr/lib64/libstdc++.so.6"),
|
|
||||||
else => unreachable,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.link_libc) {
|
if (options.link_libc) {
|
||||||
|
_ = argv.append("/usr/lib64/crt1.o");
|
||||||
|
_ = argv.append("/usr/lib64/crti.o");
|
||||||
|
argv.append_slice(&.{ "-L", "/usr/lib64" });
|
||||||
|
|
||||||
|
_ = argv.append("-dynamic-linker");
|
||||||
switch (@import("builtin").cpu.arch) {
|
switch (@import("builtin").cpu.arch) {
|
||||||
.x86_64 => {
|
.x86_64 => _ = argv.append("/lib64/ld-linux-x86-64.so.2"),
|
||||||
_ = argv.append("/usr/lib/crt1.o");
|
.aarch64 => _ = argv.append("/lib/ld-linux-aarch64.so.1"),
|
||||||
_ = argv.append("/usr/lib/crti.o");
|
|
||||||
argv.append_slice(&.{ "-L", "/usr/lib" });
|
|
||||||
argv.append_slice(&.{ "-dynamic-linker", "/lib64/ld-linux-x86-64.so.2" });
|
|
||||||
},
|
|
||||||
.aarch64 => {
|
|
||||||
_ = argv.append("/usr/lib64/crt1.o");
|
|
||||||
_ = argv.append("/usr/lib64/crti.o");
|
|
||||||
argv.append_slice(&.{ "-L", "/usr/lib64" });
|
|
||||||
argv.append_slice(&.{ "-dynamic-linker", "/lib/ld-linux-aarch64.so.1" });
|
|
||||||
},
|
|
||||||
else => unreachable,
|
else => unreachable,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,15 +112,7 @@ pub fn link(context: *const Compilation.Context, options: linker.Options) !void
|
|||||||
_ = argv.append("-lrt");
|
_ = argv.append("-lrt");
|
||||||
_ = argv.append("-lutil");
|
_ = argv.append("-lutil");
|
||||||
|
|
||||||
switch (@import("builtin").cpu.arch) {
|
_ = argv.append("/usr/lib64/crtn.o");
|
||||||
.x86_64 => {
|
|
||||||
_ = argv.append("/usr/lib/crtn.o");
|
|
||||||
},
|
|
||||||
.aarch64 => {
|
|
||||||
_ = argv.append("/usr/lib64/crtn.o");
|
|
||||||
},
|
|
||||||
else => unreachable,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
28
build.zig
28
build.zig
@ -462,35 +462,21 @@ pub fn build(b: *std.Build) !void {
|
|||||||
var tokenizer = std.mem.tokenize(u8, result.stdout, " ");
|
var tokenizer = std.mem.tokenize(u8, result.stdout, " ");
|
||||||
const cxx_version = while (tokenizer.next()) |chunk| {
|
const cxx_version = while (tokenizer.next()) |chunk| {
|
||||||
if (std.ascii.isDigit(chunk[0])) {
|
if (std.ascii.isDigit(chunk[0])) {
|
||||||
if (std.SemanticVersion.parse(chunk)) |_| {
|
if (std.SemanticVersion.parse(chunk)) |sema_version| {
|
||||||
break chunk;
|
break try std.fmt.allocPrint(b.allocator, "{}", .{sema_version.major});
|
||||||
} else |err| err catch {};
|
} else |err| err catch {};
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
unreachable;
|
unreachable;
|
||||||
};
|
};
|
||||||
|
|
||||||
const cxx_include_base = switch (@import("builtin").cpu.arch) {
|
const cxx_include_base = try std.mem.concat(b.allocator, u8, &.{ "/usr/include/c++/", cxx_version });
|
||||||
.x86_64 => try std.mem.concat(b.allocator, u8, &.{ "/usr/include/c++/", cxx_version }),
|
compiler.addObjectFile(.{ .cwd_relative = "/usr/lib64/libstdc++.so.6" });
|
||||||
.aarch64 => "/usr/include/c++/13",
|
compiler.addIncludePath(.{ .cwd_relative = "/usr/lib64/llvm17/include/" });
|
||||||
else => @compileError("Arch not supported"),
|
|
||||||
};
|
|
||||||
compiler.addObjectFile(.{
|
|
||||||
.cwd_relative = switch (@import("builtin").cpu.arch) {
|
|
||||||
.aarch64 => "/lib64/libstdc++.so.6",
|
|
||||||
.x86_64 => "/usr/lib/libstdc++.so",
|
|
||||||
else => @compileError("Arch not supported"),
|
|
||||||
},
|
|
||||||
});
|
|
||||||
compiler.addIncludePath(.{ .cwd_relative = "/usr/include" });
|
compiler.addIncludePath(.{ .cwd_relative = "/usr/include" });
|
||||||
compiler.addIncludePath(.{ .cwd_relative = cxx_include_base });
|
compiler.addIncludePath(.{ .cwd_relative = cxx_include_base });
|
||||||
compiler.addIncludePath(.{
|
compiler.addIncludePath(.{ .cwd_relative = try std.mem.concat(b.allocator, u8, &.{ cxx_include_base, "/" ++ @tagName(@import("builtin").cpu.arch) ++ "-redhat-linux"}) });
|
||||||
.cwd_relative = try std.mem.concat(b.allocator, u8, &.{ cxx_include_base, switch (@import("builtin").cpu.arch) {
|
compiler.addLibraryPath(.{ .cwd_relative = "/usr/lib64/llvm17/lib" });
|
||||||
.x86_64 => "/x86_64-pc-linux-gnu",
|
|
||||||
.aarch64 => "/aarch64-redhat-linux",
|
|
||||||
else => @compileError("Arch not supported"),
|
|
||||||
} }),
|
|
||||||
});
|
|
||||||
compiler.addLibraryPath(.{ .cwd_relative = "/usr/lib" });
|
compiler.addLibraryPath(.{ .cwd_relative = "/usr/lib" });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user