mirror of
https://github.com/rdmsr/zag.git
synced 2026-10-27 13:58:20 +00:00
build: fix UM build
This commit is contained in:
@@ -225,6 +225,8 @@ fn addKernel(b: *std.Build, plat: config.Platform, optimize: std.builtin.Optimiz
|
||||
.optimize = optimize,
|
||||
});
|
||||
|
||||
translate_c.addIncludePath(.{ .cwd_relative = "/usr/include" });
|
||||
|
||||
kernel.root_module.addImport("c", translate_c.createModule());
|
||||
kernel.linker_script = b.path("build/linker-scripts/uml.lds");
|
||||
kernel.root_module.link_libc = true;
|
||||
|
||||
+1
-1
@@ -91,7 +91,7 @@ fn map_kernel(boot_info: *pl.BootInfo) void {
|
||||
|
||||
pub fn init(boot_info: *pl.BootInfo) linksection(r.init) void {
|
||||
mi.phys.init(boot_info);
|
||||
if (!@hasDecl(config, "CONFIG_ARCH_UM")) {
|
||||
if (config.arch != .um) {
|
||||
map_kernel(boot_info);
|
||||
}
|
||||
mi.kernel_pmap.activate();
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
#define _GNU_SOURCE 1
|
||||
#include <SDL.h>
|
||||
#include <SDL2/SDL.h>
|
||||
#include <pthread.h>
|
||||
#include <sched.h>
|
||||
#include <signal.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/time.h>
|
||||
#include <ucontext.h>
|
||||
#include <unistd.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@ pub const std_options = std.Options{
|
||||
|
||||
pub const panic = std.debug.FullPanic(ke.panic);
|
||||
|
||||
pub const main = if (@hasDecl(config, "CONFIG_ARCH_UM")) pl.impl.entry.main else undefined;
|
||||
pub const main = if (config.arch == .um) pl.impl.entry.main else undefined;
|
||||
|
||||
comptime {
|
||||
// Ensure the entry point is linked in.
|
||||
|
||||
Reference in New Issue
Block a user