Architectural Support: x86_64 (#37)
[lunaix-os.git] / lunaix-os / usr / LBuild
diff --git a/lunaix-os/usr/LBuild b/lunaix-os/usr/LBuild
new file mode 100644 (file)
index 0000000..03a89ee
--- /dev/null
@@ -0,0 +1,38 @@
+sources([
+    "testp",
+    "ls",
+    "signal_demo",
+    "cat",
+    "stat",
+    "test_pthread"
+])
+
+compile_opts([
+    "-ffreestanding",
+    "-fno-pie"
+])
+
+linking_opts([
+    "-nostdlib", 
+    "-nolibc", 
+    "-z noexecstack", 
+    "-no-pie", 
+])
+
+linking_opts([
+    "-Wl,--build-id=none"
+])
+
+if config("arch") == "x86_64":
+    compile_opts([
+        "-m64", 
+        "-fno-unwind-tables", 
+        "-fno-asynchronous-unwind-tables",
+        "-mcmodel=large"
+    ])
+    linking_opts([
+        "-m64",
+    ])
+else:
+    compile_opts("-m32")
+    linking_opts("-m32")