From 5280ea5d22687bf4939dd1807c8a711937239307 Mon Sep 17 00:00:00 2001 From: Al Hoang <3811822-hoanga@users.noreply.gitlab.com> Date: Sat, 22 May 2021 01:06:41 -0500 Subject: update compilation and elf link for haiku case * for some reason part of the linkable bits for the crt libraries are split in different locations for haiku. this changeset accomodates this situation (crtbegin_dir lookup) --- src/Compilation.zig | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/Compilation.zig') diff --git a/src/Compilation.zig b/src/Compilation.zig index 023a54ca8d..b3a01b3c9d 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -3286,6 +3286,13 @@ pub fn get_libc_crt_file(comp: *Compilation, arena: *Allocator, basename: []cons return full_path; } +pub fn get_libc_crtbegin_file(comp: *Compilation, arena: *Allocator, basename: []const u8) ![]const u8 { + const lci = comp.bin_file.options.libc_installation orelse return error.LibCInstallationNotAvailable; + const crtbegin_dir_path = lci.crtbegin_dir orelse return error.LibCInstallationMissingCRTDir; + const full_path = try std.fs.path.join(arena, &[_][]const u8{ crtbegin_dir_path, basename }); + return full_path; +} + fn addBuildingGLibCJobs(comp: *Compilation) !void { try comp.work_queue.write(&[_]Job{ .{ .glibc_crt_file = .crti_o }, -- cgit v1.2.3