Compare commits
138
Commits
main
..
bba9ced348
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bba9ced348
|
||
|
|
a8aa0bbb07
|
||
|
|
1257534a64
|
||
|
|
5aab319424
|
||
|
|
348aac20ae
|
||
|
|
5da8fffed0
|
||
|
|
2b554a22ad
|
||
|
|
c76b0b8a8e
|
||
|
|
5f42323ccb
|
||
|
|
551335bf53
|
||
|
|
7bd3d205c9
|
||
|
|
59e36f6a7f
|
||
|
|
693378d059
|
||
|
|
1773e1d55a
|
||
|
|
99c32e1ac0
|
||
|
|
5ff6f6d0d8
|
||
|
|
6c7351b3d1
|
||
|
|
e36cfdc07d
|
||
|
|
7067c015bc
|
||
|
|
94ec38fa84
|
||
|
|
42817bab52
|
||
|
|
aec774c633
|
||
|
|
41ffcaeb08
|
||
|
|
41e079b977
|
||
|
|
371b323980
|
||
|
|
d1d6e4de34
|
||
|
|
a7e2c14529
|
||
|
|
7bbd30a6f8
|
||
|
|
8ea5aed355
|
||
|
|
264795bf71
|
||
|
|
ea56079c09
|
||
|
|
f45ce702d2
|
||
|
|
545b581659
|
||
|
|
353f971408
|
||
|
|
77d0cd7814
|
||
|
|
ed0a3b67de
|
||
|
|
51fb2ef4d4
|
||
|
|
0dbcaf68cd
|
||
|
|
19048ed4bf
|
||
|
|
495f74ade7
|
||
|
|
6125a3b9fc
|
||
|
|
7b31507403
|
||
|
|
aacc895800
|
||
|
|
116aa5f303
|
||
|
|
2d9837219c
|
||
|
|
fabf7745ee
|
||
|
|
5b316bbd64
|
||
|
|
9c7933e912
|
||
|
|
d925b19135
|
||
|
|
31d2b422cb
|
||
|
|
10bffc0fbc
|
||
|
|
f6989084ff
|
||
|
|
d345745962
|
||
|
|
f729cfbcd2
|
||
|
|
8a381d71cf
|
||
|
|
c092295520
|
||
|
|
7efa945977
|
||
|
|
40d40bc57b
|
||
|
|
5dd763fd8a
|
||
|
|
4d714a4442
|
||
|
|
540596c33d
|
||
|
|
cf319c5a72
|
||
|
|
e7cfc59096
|
||
|
|
d9e0d8d70d
|
||
|
|
b141ba1e38
|
||
|
|
959c9a8bee
|
||
|
|
86e3814fb2
|
||
|
|
a287df261c | ||
|
|
eebb596773
|
||
|
|
d45d367d89
|
||
|
|
038660c969
|
||
|
|
ca405f953b
|
||
|
|
c3ada55395
|
||
|
|
52e766e1c2
|
||
|
|
a10f04c83e
|
||
|
|
0d168bf759
|
||
|
|
94f3fc7611
|
||
|
|
5538e19c82
|
||
|
|
980025e5a1
|
||
|
|
18c3f13a71
|
||
|
|
3563a810a1
|
||
|
|
329014aada
|
||
|
|
e73ab0a788
|
||
|
|
bd7f09251e
|
||
|
|
187ad521cb
|
||
|
|
550ce0b079
|
||
|
|
fe6c2f5b99
|
||
|
|
89db76e555
|
||
|
|
28a3c37d41
|
||
|
|
39d2e1c51f
|
||
|
|
353dfae39c
|
||
|
|
e3b97ba865
|
||
|
|
fc1d3feadb
|
||
|
|
63231f8b48
|
||
|
|
07830e1976
|
||
|
|
f170ded33b
|
||
|
|
23f1d55feb
|
||
|
|
a10dc97616
|
||
|
|
d797e9f71c
|
||
|
|
ea6a009c0d
|
||
|
|
bc2eefface
|
||
|
|
a0ea3a3bbf
|
||
|
|
92ac5ec7d8
|
||
|
|
07ac6f6fc3
|
||
|
|
7b47a70448
|
||
|
|
96082f33aa
|
||
|
|
945c1fe0bc
|
||
|
|
5efff7c84e
|
||
|
|
83ae53768c
|
||
|
|
c8fb5d537d | ||
|
|
a6a335aaf4 | ||
|
|
5d4d84de39 | ||
|
|
8afdee2fd2 | ||
|
|
0d871c4e56 | ||
|
|
5e0b71a818 | ||
|
|
af70aebcff | ||
|
|
cacd2d8883 | ||
|
|
35dec73236 | ||
|
|
e23a3d5033 | ||
|
|
b500d56c8e | ||
|
|
8a0193408f | ||
|
|
129ba0e0b6 | ||
|
|
0f847d7d2d | ||
|
|
28d1db3b79 | ||
|
|
c1eb861bfb | ||
|
|
4b8a4ad0f1 | ||
|
|
a79219d39e | ||
|
|
593b88c3fd | ||
|
|
b1a8fe0c53 | ||
|
|
99608cc645 | ||
|
|
50c6e9adea | ||
|
|
66eb0b3814 | ||
|
|
078fdca44b | ||
|
|
744af52f76 | ||
|
|
43414edd0a | ||
|
|
679aeb24d4 | ||
|
|
facf04df7f | ||
|
|
86baf67fac |
+1
-4
@@ -1,11 +1,8 @@
|
|||||||
/**/__pycache__
|
|
||||||
/build-*
|
/build-*
|
||||||
/builds
|
/builds
|
||||||
/ghidra/projects/**/*.lock*
|
/ghidra/projects/**/*.lock*
|
||||||
/mars-db.conf
|
/mars-db.conf
|
||||||
/.direnv
|
/.direnv
|
||||||
/db.conf
|
/db.conf
|
||||||
|
/fail/bin/resultbrowser/app/__pycache__
|
||||||
/fail/bin/VisualFAIL/CONFIGURATION.php
|
/fail/bin/VisualFAIL/CONFIGURATION.php
|
||||||
/qemu.log
|
|
||||||
/dumps
|
|
||||||
/charts
|
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
[submodule "fail/src"]
|
|
||||||
path = fail/src
|
|
||||||
url = git@gitos.rrze.fau.de:wasm-hardening/fail.git
|
|
||||||
[submodule "wamr"]
|
|
||||||
path = wamr
|
|
||||||
url = ssh://git@git.cs.tu-dortmund.de:2222/christoph.urlacher/wamr.git
|
|
||||||
[submodule "tacle-converter"]
|
|
||||||
path = tacle-converter
|
|
||||||
url = https://gitos.rrze.fau.de/i4/openaccess/tacle-bench-wasm-converter
|
|
||||||
Vendored
-72
@@ -1,72 +0,0 @@
|
|||||||
{
|
|
||||||
"version": "0.2.0",
|
|
||||||
"configurations": [
|
|
||||||
{
|
|
||||||
"name": "AOT Linux sum0_base",
|
|
||||||
"type": "lldb",
|
|
||||||
"request": "launch",
|
|
||||||
"program": "/home/christoph/Notes/TU/MastersThesis/FailNix/injections/2026-05-11T19:19:39_sum0_base-linux-aot/system.elf",
|
|
||||||
"args": [],
|
|
||||||
"cwd": "/home/christoph/Notes/TU/MastersThesis/FailNix/injections/2026-05-11T19:19:39_sum0_base-linux-aot",
|
|
||||||
"initCommands": [
|
|
||||||
"settings set target.x86-disassembly-flavor intel",
|
|
||||||
"breakpoint set -b main",
|
|
||||||
"breakpoint set -b fail_start_trace",
|
|
||||||
"breakpoint set -b fail_stop_trace",
|
|
||||||
"breakpoint set -b fail_marker_positive",
|
|
||||||
"breakpoint set -b fail_marker_negative",
|
|
||||||
"breakpoint set -b invokeNative_Void",
|
|
||||||
],
|
|
||||||
"sourceMap": {
|
|
||||||
"/build/source/core": "/home/christoph/Notes/TU/MastersThesis/05 WAMR/core",
|
|
||||||
"/home/christoph/Notes/TU/MastersThesis/FailNix/build-sum0_base": "/home/christoph/Notes/TU/MastersThesis/FailNix/injections/2026-05-11T19:19:39_sum0_base-linux-aot",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "AOT Fail sum0_base (QEMU)",
|
|
||||||
"type": "lldb",
|
|
||||||
"request": "launch",
|
|
||||||
"preLaunchTask": "Launch QEMU (sum0_base fail-aot)",
|
|
||||||
"initCommands": ["settings set target.x86-disassembly-flavor intel"],
|
|
||||||
"processCreateCommands": ["gdb-remote localhost:9000", "continue"],
|
|
||||||
"targetCreateCommands": [
|
|
||||||
"target create /home/christoph/Notes/TU/MastersThesis/FailNix/injections/2026-04-27T21-42-42_sum0_base-fail-aot/system.elf",
|
|
||||||
],
|
|
||||||
"preRunCommands": [
|
|
||||||
"breakpoint set -b os_main",
|
|
||||||
"breakpoint set -b fail_start_trace",
|
|
||||||
"breakpoint set -b fail_stop_trace",
|
|
||||||
"breakpoint set -b fail_marker_positive",
|
|
||||||
"breakpoint set -b fail_marker_negative",
|
|
||||||
"breakpoint set -b invokeNative_Void",
|
|
||||||
],
|
|
||||||
"sourceMap": {
|
|
||||||
"/build/source/core": "/home/christoph/Notes/TU/MastersThesis/05 WAMR/core",
|
|
||||||
"/home/christoph/Notes/TU/MastersThesis/FailNix/build-sum0_base": "/home/christoph/Notes/TU/MastersThesis/FailNix/injections/2026-04-27T21-42-42_sum0_base-fail-aot",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "fail-x86-tracing-dbg",
|
|
||||||
"type": "lldb",
|
|
||||||
"request": "launch",
|
|
||||||
"program": "/nix/store/z3cyzvdz8pbxccp9jyxgp57ccjjppi1j-fail-1.0.0/bin/fail-x86-tracing",
|
|
||||||
"args": [
|
|
||||||
"-q", "-f", "./bochs.rc",
|
|
||||||
"-Wf,--start-symbol=fail_start_trace",
|
|
||||||
"-Wf,--save-symbol=fail_start_trace",
|
|
||||||
"-Wf,--end-symbol=fail_stop_trace",
|
|
||||||
"-Wf,--state-file=./state",
|
|
||||||
"-Wf,--trace-file=./trace.pb",
|
|
||||||
"-Wf,--elf-file=./system.elf",
|
|
||||||
],
|
|
||||||
"cwd": "/home/christoph/Notes/TU/MastersThesis/FailNix/injections/2026-05-17T23-00-56_sum0_base-fail-aot",
|
|
||||||
"initCommands": [
|
|
||||||
"settings set target.x86-disassembly-flavor intel",
|
|
||||||
"breakpoint set -n GenericTracing::run()",
|
|
||||||
],
|
|
||||||
"sourceMap": {
|
|
||||||
"/home/fail/work": "/home/christoph/Notes/TU/MastersThesis/FailNix/fail/src",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
],
|
|
||||||
}
|
|
||||||
Vendored
-25
@@ -1,25 +0,0 @@
|
|||||||
{
|
|
||||||
"version": "2.0.0",
|
|
||||||
"tasks": [
|
|
||||||
{
|
|
||||||
"label": "Launch QEMU (sum0_base fail-aot)",
|
|
||||||
"type": "shell",
|
|
||||||
"command": "qemu-system-i386 -drive file=system.iso,media=cdrom -boot d -m 32 -S -gdb tcp::9000",
|
|
||||||
"options": {
|
|
||||||
"cwd": "/home/christoph/Notes/TU/MastersThesis/FailNix/injections/2026-04-27T21-42-42_sum0_base-fail-aot",
|
|
||||||
},
|
|
||||||
"isBackground": true,
|
|
||||||
"problemMatcher": {
|
|
||||||
"pattern": {
|
|
||||||
"regexp": "^(.*)$",
|
|
||||||
"message": 1,
|
|
||||||
},
|
|
||||||
"background": {
|
|
||||||
"activeOnStart": true,
|
|
||||||
"beginsPattern": ".",
|
|
||||||
"endsPattern": "^NEVER_MATCH$",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
}
|
|
||||||
@@ -1,28 +1,18 @@
|
|||||||
library(ggplot2)
|
library(ggplot2)
|
||||||
library(ggalluvial)
|
library(ggalluvial)
|
||||||
|
|
||||||
# Usage: Rscript combined_sankey.r exp1 exp2 queries_dir charts_dir [faults_file]
|
# Usage: Rscript combined_comparion.r exp_abspath1 exp_abspath2 ...
|
||||||
|
|
||||||
args <- commandArgs(trailingOnly = TRUE)
|
args <- commandArgs(trailingOnly = TRUE)
|
||||||
argc <- length(args)
|
argc <- length(args)
|
||||||
|
|
||||||
if (argc < 4 || argc > 5) {
|
if (argc != 2) {
|
||||||
print(paste(
|
print("Expecting two input files")
|
||||||
"Expecting four or five arguments:",
|
|
||||||
"exp1 exp2 queries_dir charts_dir [faults_file]"
|
|
||||||
))
|
|
||||||
stop()
|
stop()
|
||||||
}
|
}
|
||||||
|
|
||||||
faults_file <- if (argc == 5) args[5] else "faults.csv"
|
for (experiment in args) {
|
||||||
suffix <- gsub("^faults|\\.csv$", "", faults_file)
|
datafile <- paste(experiment, "/faults.csv", sep = "")
|
||||||
|
|
||||||
experiments <- args[1:2]
|
|
||||||
queries_dir <- args[3]
|
|
||||||
charts_dir <- args[4]
|
|
||||||
|
|
||||||
for (experiment in experiments) {
|
|
||||||
datafile <- file.path(queries_dir, paste0(experiment, "_", faults_file))
|
|
||||||
if (!file.exists(datafile)) {
|
if (!file.exists(datafile)) {
|
||||||
print(paste("Input file", datafile, "is missing"))
|
print(paste("Input file", datafile, "is missing"))
|
||||||
stop()
|
stop()
|
||||||
@@ -40,13 +30,13 @@ resulttype_labels <- c(
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Read data
|
# Read data
|
||||||
datafile1 <- file.path(queries_dir, paste0(experiments[1], "_", faults_file))
|
datafile1 <- paste(args[1], "/faults.csv", sep = "")
|
||||||
data1 <- readr::read_csv(datafile1)
|
data1 <- readr::read_csv(datafile1)
|
||||||
data1$fault_address <- strtoi(data1$fault_address)
|
data1$fault_address <- strtoi(data1$fault_address)
|
||||||
data1$resulttype <- resulttype_labels[data1$resulttype]
|
data1$resulttype <- resulttype_labels[data1$resulttype]
|
||||||
# tibble::glimpse(data1)
|
# tibble::glimpse(data1)
|
||||||
|
|
||||||
datafile2 <- file.path(queries_dir, paste0(experiments[2], "_", faults_file))
|
datafile2 <- paste(args[2], "/faults.csv", sep = "")
|
||||||
data2 <- readr::read_csv(datafile2)
|
data2 <- readr::read_csv(datafile2)
|
||||||
data2$fault_address <- strtoi(data2$fault_address)
|
data2$fault_address <- strtoi(data2$fault_address)
|
||||||
data2$resulttype <- resulttype_labels[data2$resulttype]
|
data2$resulttype <- resulttype_labels[data2$resulttype]
|
||||||
@@ -84,8 +74,7 @@ plot <- ggplot(
|
|||||||
theme(legend.position = "none")
|
theme(legend.position = "none")
|
||||||
|
|
||||||
# TODO: Name the file according to the benchmarks
|
# TODO: Name the file according to the benchmarks
|
||||||
dir.create(charts_dir, showWarnings = FALSE, recursive = TRUE)
|
|
||||||
ggsave(
|
ggsave(
|
||||||
file.path(charts_dir, paste0("sankey", suffix, ".svg")),
|
paste(args[2], "/../sankey.svg", sep = ""),
|
||||||
plot = plot,
|
plot = plot,
|
||||||
)
|
)
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
library(ggplot2)
|
||||||
|
|
||||||
|
# Usage: Rscript single_result.r exp_abspath
|
||||||
|
|
||||||
|
args <- commandArgs(trailingOnly = TRUE)
|
||||||
|
experiment <- args[1]
|
||||||
|
datafile <- paste(experiment, "/resultsdata.csv", sep = "")
|
||||||
|
|
||||||
|
if (!file.exists(datafile)) {
|
||||||
|
print(paste("Input file", datafile, "is missing"))
|
||||||
|
stop()
|
||||||
|
}
|
||||||
|
|
||||||
|
data <- readr::read_csv(datafile)
|
||||||
|
tibble::glimpse(data)
|
||||||
|
|
||||||
|
plot <- ggplot(data, aes(x = benchmark, y = faults, fill = resulttype)) +
|
||||||
|
geom_col(position = "dodge") +
|
||||||
|
scale_y_log10() +
|
||||||
|
labs(x = "Benchmark", y = "Faults", fill = "Result Type") +
|
||||||
|
theme_minimal()
|
||||||
|
|
||||||
|
ggsave(
|
||||||
|
paste(experiment, "/single_result.svg", sep = ""),
|
||||||
|
plot = plot,
|
||||||
|
)
|
||||||
@@ -1,16 +1,12 @@
|
|||||||
library(ggplot2)
|
library(ggplot2)
|
||||||
|
|
||||||
# Usage: Rscript single_scatter.r exp_name queries_dir charts_dir [faults_file]
|
# Usage: Rscript single_scatter.r exp_abspath
|
||||||
|
|
||||||
# TODO: Allow filtering resulttypes (or at least exclude OK_MARKER)
|
# TODO: Allow filtering resulttypes (or at least exclude OK_MARKER)
|
||||||
|
|
||||||
args <- commandArgs(trailingOnly = TRUE)
|
args <- commandArgs(trailingOnly = TRUE)
|
||||||
experiment <- args[1]
|
experiment <- args[1]
|
||||||
queries_dir <- args[2]
|
datafile <- paste(experiment, "/faults.csv", sep = "")
|
||||||
charts_dir <- args[3]
|
|
||||||
faults_file <- if (length(args) >= 4) args[4] else "faults.csv"
|
|
||||||
suffix <- gsub("^faults|\\.csv$", "", faults_file)
|
|
||||||
datafile <- file.path(queries_dir, paste0(experiment, "_", faults_file))
|
|
||||||
|
|
||||||
if (!file.exists(datafile)) {
|
if (!file.exists(datafile)) {
|
||||||
print(paste("Input file", datafile, "is missing"))
|
print(paste("Input file", datafile, "is missing"))
|
||||||
@@ -30,8 +26,7 @@ plot <- ggplot(data, aes(x = fault_address, y = faults)) +
|
|||||||
labs(x = "Address", y = "Faults", color = "Type") +
|
labs(x = "Address", y = "Faults", color = "Type") +
|
||||||
theme_minimal()
|
theme_minimal()
|
||||||
|
|
||||||
dir.create(charts_dir, showWarnings = FALSE, recursive = TRUE)
|
|
||||||
ggsave(
|
ggsave(
|
||||||
file.path(charts_dir, paste0(experiment, "_scatter", suffix, ".svg")),
|
paste(experiment, "/scatter.svg", sep = ""),
|
||||||
plot = plot,
|
plot = plot,
|
||||||
)
|
)
|
||||||
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
-1
Submodule fail/src deleted from dda6da2a50
@@ -12,388 +12,516 @@ rec {
|
|||||||
flake-utils,
|
flake-utils,
|
||||||
}:
|
}:
|
||||||
# Create a shell (and possibly package) for each possible system, not only x86_64-linux
|
# Create a shell (and possibly package) for each possible system, not only x86_64-linux
|
||||||
flake-utils.lib.eachDefaultSystem (
|
flake-utils.lib.eachDefaultSystem (system: let
|
||||||
system: let
|
# =========================================================================================
|
||||||
# =========================================================================================
|
# Define pkgs/stdenvs
|
||||||
# Define pkgs/stdenvs
|
# =========================================================================================
|
||||||
# =========================================================================================
|
pkgs = import nixpkgs {
|
||||||
pkgs = import nixpkgs {
|
inherit system;
|
||||||
|
config.allowUnfree = true;
|
||||||
|
overlays = [];
|
||||||
|
};
|
||||||
|
|
||||||
|
i386_pkgs = import nixpkgs {
|
||||||
|
inherit system;
|
||||||
|
config.allowUnfree = true;
|
||||||
|
overlays = [];
|
||||||
|
|
||||||
|
# Build crosscompiler
|
||||||
|
crossSystem = {
|
||||||
|
config = "i386-elf";
|
||||||
|
libc = "newlib";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
boost_pkgs =
|
||||||
|
import (builtins.fetchTarball {
|
||||||
|
url = "https://github.com/NixOS/nixpkgs/archive/824421b1796332ad1bcb35bc7855da832c43305f.tar.gz";
|
||||||
|
sha256 = "sha256:1w6cjnakz1yi66rs8c6nmhymsr7bj82vs2hz200ipi1sfiq8dy4y";
|
||||||
|
}) {
|
||||||
inherit system;
|
inherit system;
|
||||||
config.allowUnfree = true;
|
|
||||||
overlays = [];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
i386_pkgs = import nixpkgs {
|
libdwarf_pkgs =
|
||||||
|
import (builtins.fetchTarball {
|
||||||
|
url = "https://github.com/NixOS/nixpkgs/archive/f597e7e9fcf37d8ed14a12835ede0a7d362314bd.tar.gz";
|
||||||
|
sha256 = "sha256:1l79hh7jh7m8yc5mvc8dbg6s8rf30bgm994kf07xriqbzwfn158r";
|
||||||
|
}) {
|
||||||
inherit system;
|
inherit system;
|
||||||
config.allowUnfree = true;
|
|
||||||
overlays = [];
|
|
||||||
|
|
||||||
# Build crosscompiler
|
|
||||||
crossSystem = {
|
|
||||||
config = "i386-elf";
|
|
||||||
libc = "newlib";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
boost_pkgs =
|
inherit (pkgs) lib stdenv;
|
||||||
import
|
|
||||||
(builtins.fetchTarball {
|
|
||||||
url = "https://github.com/NixOS/nixpkgs/archive/824421b1796332ad1bcb35bc7855da832c43305f.tar.gz";
|
|
||||||
sha256 = "sha256:1w6cjnakz1yi66rs8c6nmhymsr7bj82vs2hz200ipi1sfiq8dy4y";
|
|
||||||
})
|
|
||||||
{
|
|
||||||
inherit system;
|
|
||||||
};
|
|
||||||
|
|
||||||
libdwarf_pkgs =
|
# =========================================================================================
|
||||||
import
|
# Define shell environment
|
||||||
(builtins.fetchTarball {
|
# =========================================================================================
|
||||||
url = "https://github.com/NixOS/nixpkgs/archive/f597e7e9fcf37d8ed14a12835ede0a7d362314bd.tar.gz";
|
|
||||||
sha256 = "sha256:1l79hh7jh7m8yc5mvc8dbg6s8rf30bgm994kf07xriqbzwfn158r";
|
|
||||||
})
|
|
||||||
{
|
|
||||||
inherit system;
|
|
||||||
};
|
|
||||||
|
|
||||||
inherit (pkgs) lib stdenv;
|
# Setup the shell when entering the "nix develop" environment (bash script).
|
||||||
|
shellHook = let
|
||||||
# =========================================================================================
|
mkCmakeScript = type: let
|
||||||
# Define shell environment
|
typeLower = lib.toLower type;
|
||||||
# =========================================================================================
|
|
||||||
|
|
||||||
# Setup the shell when entering the "nix develop" environment (bash script).
|
|
||||||
shellHook = let
|
|
||||||
# Add project-local fish abbrs here
|
|
||||||
abbrs = {
|
|
||||||
fail = "perl ./scripts/menu.pl";
|
|
||||||
|
|
||||||
# C/C++:
|
|
||||||
# cmake-debug = "${cmakeDebug}";
|
|
||||||
# cmake-release = "${cmakeRelease}";
|
|
||||||
# build-debug = "${buildDebug}";
|
|
||||||
# build-release = "${buildRelease}";
|
|
||||||
};
|
|
||||||
|
|
||||||
eraseAbbr = name: value: "abbr --erase ${name} 2>/dev/null";
|
|
||||||
createAbbr = name: value: ''abbr -a ${name} "${value}"'';
|
|
||||||
|
|
||||||
# This will be sourced by the global fish config if INIT_PROJECT_SHELL gets unset
|
|
||||||
unloadProjectShell = pkgs.writers.writeFish "unload-shell.fish" ''
|
|
||||||
echo "Unloading \"${description}\" environment..."
|
|
||||||
|
|
||||||
${builtins.concatStringsSep "\n" (lib.mapAttrsToList eraseAbbr abbrs)}
|
|
||||||
'';
|
|
||||||
|
|
||||||
# This will be sourced by the global fish config if INIT_PROJECT_SHELL gets set
|
|
||||||
initProjectShell = pkgs.writers.writeFish "init-shell.fish" ''
|
|
||||||
# Unload just in case, to not have redefinition errors
|
|
||||||
source ${unloadProjectShell}
|
|
||||||
|
|
||||||
echo "Sourcing \"${description}\" environment..."
|
|
||||||
|
|
||||||
${builtins.concatStringsSep "\n" (lib.mapAttrsToList createAbbr abbrs)}
|
|
||||||
'';
|
|
||||||
in
|
in
|
||||||
builtins.concatStringsSep "\n" [
|
pkgs.writers.writeFish "cmake-${typeLower}.fish" ''
|
||||||
# Launch into pure fish shell
|
cd $FLAKE_PROJECT_ROOT
|
||||||
''
|
|
||||||
# Can't do the "exec" with nix-direnv
|
|
||||||
# - The "exec fish" would call direnv again => Infinite loop
|
|
||||||
# - The shellHook is Bash/POSIX, so fish syntax doesn't work
|
|
||||||
# exec "$(type -p fish)" -C "source ${initProjectShell} && abbr -a menu '${pkgs.bat}/bin/bat "${initProjectShell}"'"
|
|
||||||
|
|
||||||
# Determine the project root, used e.g. in cmake scripts
|
echo "Removing build directory ./cmake-build-${typeLower}/"
|
||||||
export FLAKE_PROJECT_ROOT="$(git rev-parse --show-toplevel)"
|
rm -rf ./cmake-build-${typeLower}
|
||||||
export INIT_PROJECT_SHELL="${initProjectShell}"
|
|
||||||
export UNLOAD_PROJECT_SHELL="${unloadProjectShell}"
|
|
||||||
''
|
|
||||||
];
|
|
||||||
|
|
||||||
# ===========================================================================================
|
echo "Creating build directory"
|
||||||
# Define custom dependencies
|
mkdir cmake-build-${typeLower}
|
||||||
# ===========================================================================================
|
cd cmake-build-${typeLower}
|
||||||
|
|
||||||
python = pkgs.python314.withPackages (
|
echo "Running cmake"
|
||||||
p:
|
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="${type}" -DCMAKE_EXPORT_COMPILE_COMMANDS="On" ..
|
||||||
with p; [
|
|
||||||
setuptools
|
|
||||||
flask
|
|
||||||
flask-mysqldb
|
|
||||||
pyyaml
|
|
||||||
tabulate
|
|
||||||
]
|
|
||||||
);
|
|
||||||
|
|
||||||
# perl = pkgs.perl.withPackages (p:
|
echo "Linking compile_commands.json"
|
||||||
# with p; [
|
cd ..
|
||||||
# # Those are already installed system-wide
|
ln -sf ./cmake-build-${typeLower}/compile_commands.json ./compile_commands.json
|
||||||
# # PLS
|
|
||||||
# # PerlTidy
|
|
||||||
#
|
|
||||||
# NetOpenSSH
|
|
||||||
# ]);
|
|
||||||
|
|
||||||
libpcl = stdenv.mkDerivation rec {
|
|
||||||
pname = "libpcl1";
|
|
||||||
version = "1.12-2";
|
|
||||||
|
|
||||||
src = pkgs.fetchurl {
|
|
||||||
url = "http://launchpadlibrarian.net/521269537/${pname}_${version}_amd64.deb";
|
|
||||||
hash = "sha256-GL3mjPAccAtRMAJPnDMCHiDf6xNvGi4oUWylOIqBjP0=";
|
|
||||||
};
|
|
||||||
|
|
||||||
dontBuild = true;
|
|
||||||
nativeBuildInputs = with pkgs; [
|
|
||||||
dpkg
|
|
||||||
autoPatchelfHook
|
|
||||||
];
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
runHook preInstall
|
|
||||||
|
|
||||||
mkdir -p $out/lib
|
|
||||||
cp -rv usr/lib/x86_64-linux-gnu/* $out/lib/
|
|
||||||
|
|
||||||
runHook postInstall
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
cmakeDebug = mkCmakeScript "Debug";
|
||||||
|
cmakeRelease = mkCmakeScript "Release";
|
||||||
|
|
||||||
|
mkBuildScript = type: let
|
||||||
|
typeLower = lib.toLower type;
|
||||||
|
in
|
||||||
|
pkgs.writers.writeFish "cmake-build.fish" ''
|
||||||
|
cd $FLAKE_PROJECT_ROOT/cmake-build-${typeLower}
|
||||||
|
|
||||||
|
echo "Running cmake"
|
||||||
|
cmake --build .
|
||||||
|
'';
|
||||||
|
|
||||||
|
buildDebug = mkBuildScript "Debug";
|
||||||
|
buildRelease = mkBuildScript "Release";
|
||||||
|
|
||||||
|
# Add project-local fish abbrs here
|
||||||
|
abbrs = {
|
||||||
|
fail = "perl ./scripts/menu.pl";
|
||||||
|
|
||||||
|
# C/C++:
|
||||||
|
# cmake-debug = "${cmakeDebug}";
|
||||||
|
# cmake-release = "${cmakeRelease}";
|
||||||
|
# build-debug = "${buildDebug}";
|
||||||
|
# build-release = "${buildRelease}";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Provides clang to compile C++ to Wasm
|
eraseAbbr = name: value: ''abbr --erase ${name} 2>/dev/null'';
|
||||||
wasi-sdk = stdenv.mkDerivation rec {
|
createAbbr = name: value: ''abbr -a ${name} "${value}"'';
|
||||||
pname = "wasi-sdk";
|
|
||||||
version = "29";
|
|
||||||
|
|
||||||
src = let
|
# This will be sourced by the global fish config if INIT_PROJECT_SHELL gets unset
|
||||||
baseurl = "https://github.com/WebAssembly/wasi-sdk/releases/download";
|
unloadProjectShell = pkgs.writers.writeFish "unload-shell.fish" ''
|
||||||
in
|
echo "Unloading \"${description}\" environment..."
|
||||||
builtins.fetchTarball {
|
|
||||||
url = "${baseurl}/${pname}-${version}/${pname}-${version}.0-x86_64-linux.tar.gz";
|
|
||||||
sha256 = "sha256:16afis71iqfvwiny4dz0lk9f7wbary0wa67ybwyhywr8g57ss6hq";
|
|
||||||
};
|
|
||||||
|
|
||||||
nativeBuildInputs = with pkgs; [
|
${builtins.concatStringsSep "\n" (lib.mapAttrsToList eraseAbbr abbrs)}
|
||||||
autoPatchelfHook
|
'';
|
||||||
];
|
|
||||||
|
|
||||||
buildInputs = with pkgs; [
|
# This will be sourced by the global fish config if INIT_PROJECT_SHELL gets set
|
||||||
libgcc.lib
|
initProjectShell = pkgs.writers.writeFish "init-shell.fish" ''
|
||||||
];
|
# Unload just in case, to not have redefinition errors
|
||||||
|
source ${unloadProjectShell}
|
||||||
|
|
||||||
dontBuild = true;
|
echo "Sourcing \"${description}\" environment..."
|
||||||
installPhase = ''
|
|
||||||
runHook preInstall
|
|
||||||
|
|
||||||
mkdir -p $out
|
${builtins.concatStringsSep "\n" (lib.mapAttrsToList createAbbr abbrs)}
|
||||||
cp -rv ./* $out/
|
'';
|
||||||
|
in
|
||||||
|
builtins.concatStringsSep "\n" [
|
||||||
|
# Launch into pure fish shell
|
||||||
|
''
|
||||||
|
# Can't do the "exec" with nix-direnv
|
||||||
|
# - The "exec fish" would call direnv again => Infinite loop
|
||||||
|
# - The shellHook is Bash/POSIX, so fish syntax doesn't work
|
||||||
|
# exec "$(type -p fish)" -C "source ${initProjectShell} && abbr -a menu '${pkgs.bat}/bin/bat "${initProjectShell}"'"
|
||||||
|
|
||||||
runHook postInstall
|
# Determine the project root, used e.g. in cmake scripts
|
||||||
'';
|
export FLAKE_PROJECT_ROOT="$(git rev-parse --show-toplevel)"
|
||||||
};
|
export INIT_PROJECT_SHELL="${initProjectShell}"
|
||||||
|
export UNLOAD_PROJECT_SHELL="${unloadProjectShell}"
|
||||||
# Provides the iwasm interpreter
|
''
|
||||||
iwasm = stdenv.mkDerivation rec {
|
|
||||||
pname = "iwasm";
|
|
||||||
version = "2.4.4";
|
|
||||||
|
|
||||||
src = let
|
|
||||||
baseurl = "https://github.com/bytecodealliance/wasm-micro-runtime/releases/download";
|
|
||||||
in
|
|
||||||
builtins.fetchTarball {
|
|
||||||
url = "${baseurl}/WAMR-${version}/${pname}-${version}-x86_64-ubuntu-22.04.tar.gz";
|
|
||||||
sha256 = "sha256:05irihz3yf7hpc0a59qz9i62imhrsni9xy9nxwsn6b8s92c1yzrp";
|
|
||||||
};
|
|
||||||
|
|
||||||
nativeBuildInputs = with pkgs; [
|
|
||||||
autoPatchelfHook
|
|
||||||
];
|
|
||||||
|
|
||||||
buildInputs = with pkgs; [
|
|
||||||
libz
|
|
||||||
zstd
|
|
||||||
libgcc.lib
|
|
||||||
];
|
|
||||||
|
|
||||||
dontBuild = true;
|
|
||||||
installPhase = ''
|
|
||||||
runHook preInstall
|
|
||||||
|
|
||||||
mkdir -p $out/bin
|
|
||||||
cp -rv ./* $out/bin/
|
|
||||||
|
|
||||||
runHook postInstall
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
# Provides the wamrc compiler
|
|
||||||
wamrc = stdenv.mkDerivation rec {
|
|
||||||
pname = "wamrc";
|
|
||||||
version = "2.4.4";
|
|
||||||
|
|
||||||
src = let
|
|
||||||
baseurl = "https://github.com/bytecodealliance/wasm-micro-runtime/releases/download";
|
|
||||||
in
|
|
||||||
builtins.fetchTarball {
|
|
||||||
url = "${baseurl}/WAMR-${version}/${pname}-${version}-x86_64-ubuntu-22.04.tar.gz";
|
|
||||||
sha256 = "sha256:0264arh03gc35z0zdvw07qdvqgfvsxr3qgl1aszghwicmdmh4sqj";
|
|
||||||
};
|
|
||||||
|
|
||||||
nativeBuildInputs = with pkgs; [
|
|
||||||
autoPatchelfHook
|
|
||||||
];
|
|
||||||
|
|
||||||
buildInputs = with pkgs; [
|
|
||||||
libz
|
|
||||||
zstd
|
|
||||||
libgcc.lib
|
|
||||||
];
|
|
||||||
|
|
||||||
dontBuild = true;
|
|
||||||
installPhase = ''
|
|
||||||
runHook preInstall
|
|
||||||
|
|
||||||
mkdir -p $out/bin
|
|
||||||
cp -rv ./* $out/bin/
|
|
||||||
|
|
||||||
runHook postInstall
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
# ===========================================================================================
|
|
||||||
# Specify dependencies
|
|
||||||
# https://nixos.org/manual/nixpkgs/stable/#ssec-stdenv-dependencies-overview
|
|
||||||
# Just for a "nix develop" shell, buildInputs can be used for everything.
|
|
||||||
# ===========================================================================================
|
|
||||||
|
|
||||||
# Add dependencies to nativeBuildInputs if they are executed during the build:
|
|
||||||
# - Those which are needed on $PATH during the build, for example cmake and pkg-config
|
|
||||||
# - Setup hooks, for example makeWrapper/autoPatchelfHook
|
|
||||||
# - Interpreters needed by patchShebangs for build scripts (with the --build flag), which can be the case for e.g. perl
|
|
||||||
nativeBuildInputs = with pkgs; [
|
|
||||||
cmake
|
|
||||||
gdb
|
|
||||||
xxd
|
|
||||||
wabt
|
|
||||||
grub2
|
|
||||||
xorriso
|
|
||||||
mariadb.client
|
|
||||||
# dbeaver-bin
|
|
||||||
# beekeeper-studio
|
|
||||||
# tableplus
|
|
||||||
lazysql
|
|
||||||
iwasm
|
|
||||||
wamrc
|
|
||||||
fail-bin
|
|
||||||
php
|
|
||||||
qemu_kvm
|
|
||||||
|
|
||||||
# perl
|
|
||||||
|
|
||||||
# Don't install to not pollute our PATH. Just export as environment variable.
|
|
||||||
# wasi-sdk
|
|
||||||
# libiwasm_debug
|
|
||||||
# libiwasm_release
|
|
||||||
];
|
];
|
||||||
|
|
||||||
# Add dependencies to buildInputs if they will end up copied or linked into the final output or otherwise used at runtime:
|
# ===========================================================================================
|
||||||
# - Libraries used by compilers, for example zlib
|
# Define custom dependencies
|
||||||
# - Interpreters needed by patchShebangs for scripts which are installed, which can be the case for e.g. perl
|
# ===========================================================================================
|
||||||
buildInputs = with pkgs; [];
|
|
||||||
|
|
||||||
# ===========================================================================================
|
python = pkgs.python314.withPackages (p:
|
||||||
# Define buildable + installable packages
|
with p; [
|
||||||
# ===========================================================================================
|
setuptools
|
||||||
|
flask
|
||||||
|
flask-mysqldb
|
||||||
|
pyyaml
|
||||||
|
]);
|
||||||
|
|
||||||
fail-bin = stdenv.mkDerivation {
|
# perl = pkgs.perl.withPackages (p:
|
||||||
pname = "fail";
|
# with p; [
|
||||||
version = "1.0.0";
|
# # Those are already installed system-wide
|
||||||
src = ./.;
|
# # PLS
|
||||||
|
# # PerlTidy
|
||||||
|
#
|
||||||
|
# NetOpenSSH
|
||||||
|
# ]);
|
||||||
|
|
||||||
|
libpcl = stdenv.mkDerivation rec {
|
||||||
|
pname = "libpcl1";
|
||||||
|
version = "1.12-2";
|
||||||
|
|
||||||
|
src = pkgs.fetchurl {
|
||||||
|
url = "http://launchpadlibrarian.net/521269537/${pname}_${version}_amd64.deb";
|
||||||
|
hash = "sha256-GL3mjPAccAtRMAJPnDMCHiDf6xNvGi4oUWylOIqBjP0=";
|
||||||
|
};
|
||||||
|
|
||||||
|
dontBuild = true;
|
||||||
|
nativeBuildInputs = with pkgs; [
|
||||||
|
dpkg
|
||||||
|
autoPatchelfHook
|
||||||
|
];
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
|
mkdir -p $out/lib
|
||||||
|
cp -rv usr/lib/x86_64-linux-gnu/* $out/lib/
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
wasi-sdk = stdenv.mkDerivation rec {
|
||||||
|
pname = "wasi-sdk";
|
||||||
|
version = "29";
|
||||||
|
|
||||||
|
src = let
|
||||||
|
baseurl = "https://github.com/WebAssembly/wasi-sdk/releases/download";
|
||||||
|
in
|
||||||
|
builtins.fetchTarball {
|
||||||
|
url = "${baseurl}/${pname}-${version}/${pname}-${version}.0-x86_64-linux.tar.gz";
|
||||||
|
sha256 = "sha256:16afis71iqfvwiny4dz0lk9f7wbary0wa67ybwyhywr8g57ss6hq";
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = with pkgs; [
|
||||||
|
autoPatchelfHook
|
||||||
|
];
|
||||||
|
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
libgcc.lib
|
||||||
|
];
|
||||||
|
|
||||||
|
dontBuild = true;
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
|
mkdir -p $out
|
||||||
|
cp -rv ./* $out/
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
iwasm = stdenv.mkDerivation rec {
|
||||||
|
pname = "iwasm";
|
||||||
|
version = "2.4.4";
|
||||||
|
|
||||||
|
src = let
|
||||||
|
baseurl = "https://github.com/bytecodealliance/wasm-micro-runtime/releases/download";
|
||||||
|
in
|
||||||
|
builtins.fetchTarball {
|
||||||
|
url = "${baseurl}/WAMR-${version}/${pname}-${version}-x86_64-ubuntu-22.04.tar.gz";
|
||||||
|
sha256 = "sha256:05irihz3yf7hpc0a59qz9i62imhrsni9xy9nxwsn6b8s92c1yzrp";
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = with pkgs; [
|
||||||
|
autoPatchelfHook
|
||||||
|
];
|
||||||
|
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
libz
|
||||||
|
zstd
|
||||||
|
libgcc.lib
|
||||||
|
];
|
||||||
|
|
||||||
|
dontBuild = true;
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
|
mkdir -p $out/bin
|
||||||
|
cp -rv ./* $out/bin/
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
wamrc = stdenv.mkDerivation rec {
|
||||||
|
pname = "wamrc";
|
||||||
|
version = "2.4.4";
|
||||||
|
|
||||||
|
src = let
|
||||||
|
baseurl = "https://github.com/bytecodealliance/wasm-micro-runtime/releases/download";
|
||||||
|
in
|
||||||
|
builtins.fetchTarball {
|
||||||
|
url = "${baseurl}/WAMR-${version}/${pname}-${version}-x86_64-ubuntu-22.04.tar.gz";
|
||||||
|
sha256 = "sha256:0264arh03gc35z0zdvw07qdvqgfvsxr3qgl1aszghwicmdmh4sqj";
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = with pkgs; [
|
||||||
|
autoPatchelfHook
|
||||||
|
];
|
||||||
|
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
libz
|
||||||
|
zstd
|
||||||
|
libgcc.lib
|
||||||
|
];
|
||||||
|
|
||||||
|
dontBuild = true;
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
|
mkdir -p $out/bin
|
||||||
|
cp -rv ./* $out/bin/
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
wamr = stdenv.mkDerivation {
|
||||||
|
pname = "wamr";
|
||||||
|
version = "2.4.4";
|
||||||
|
|
||||||
|
src = pkgs.fetchFromGitea {
|
||||||
|
domain = "gitea.local.chriphost.de";
|
||||||
|
owner = "christoph";
|
||||||
|
repo = "wamr";
|
||||||
|
rev = "fd69a4e76ec0d384bd79f514772b7dfa240fc0d7";
|
||||||
|
hash = "sha256-rlCx4isI0k6rC9E0hWIA9LeinqiACug7zxj9z/e4SBQ=";
|
||||||
|
};
|
||||||
|
|
||||||
|
dontBuild = true;
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
|
mkdir -p $out
|
||||||
|
cp -rv ./* $out/
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
mkLibiwasm = {
|
||||||
|
buildenv,
|
||||||
|
platform,
|
||||||
|
buildtype,
|
||||||
|
cflags,
|
||||||
|
extraCmakeFlags ? [],
|
||||||
|
}:
|
||||||
|
buildenv.mkDerivation {
|
||||||
|
pname = "libiwasm";
|
||||||
|
version = "2.4.4";
|
||||||
|
|
||||||
|
src = pkgs.fetchFromGitea {
|
||||||
|
domain = "gitea.local.chriphost.de";
|
||||||
|
owner = "christoph";
|
||||||
|
repo = "wamr";
|
||||||
|
|
||||||
|
# With mmap_space in .text.wamr_aot
|
||||||
|
rev = "cda2008deb85511089b04b0ac736ad4da2d07e58";
|
||||||
|
hash = "sha256-CN6xTiwzF4Jbrpf21TF5c/C03Xb3urwkibRuIXjoU/w=";
|
||||||
|
|
||||||
|
# Without mmap_space in .text.wamr_aot
|
||||||
|
# rev = "4e7aed33fe53bf3ee4a3f2fe582c74816f850759";
|
||||||
|
# hash = "sha256-/4BKwoFDRfkA+DmbWagxdtkCDAED5rxbz5e4xvjvVWU=";
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = with pkgs; [cmake];
|
||||||
|
|
||||||
dontStrip = true;
|
dontStrip = true;
|
||||||
|
cmakeBuildType = buildtype;
|
||||||
|
cmakeFlags =
|
||||||
|
extraCmakeFlags
|
||||||
|
++ [
|
||||||
|
"-DCMAKE_VERBOSE_MAKEFILE=ON"
|
||||||
|
"-DCMAKE_COLOR_DIAGNOSTICS=ON"
|
||||||
|
|
||||||
nativeBuildInputs = with pkgs; [
|
"-DWAMR_BUILD_PLATFORM=${platform}"
|
||||||
autoPatchelfHook
|
"-DWAMR_BUILD_TARGET=X86_32"
|
||||||
];
|
"-DWAMR_BUILD_AOT=1"
|
||||||
|
"-DWAMR_BUILD_WAMR_COMPILER=0"
|
||||||
|
"-DWAMR_BUILD_INTERP=1"
|
||||||
|
"-DWAMR_BUILD_FAST_INTERP=0"
|
||||||
|
"-DWAMR_BUILD_JIT=0"
|
||||||
|
"-DWAMR_BUILD_FAST_JIT=0"
|
||||||
|
"-DWAMR_BUILD_LIBC_BUILTIN=1"
|
||||||
|
"-DWAMR_BUILD_LIBC_WASI=0"
|
||||||
|
"-DWAMR_BUILD_SIMD=0"
|
||||||
|
];
|
||||||
|
|
||||||
buildInputs = with pkgs; [
|
# Since GCC 15, implicit declarations are an error. Disable this.
|
||||||
# FAIL runtime dependencies
|
NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration " + cflags;
|
||||||
python # bochs-experiment-runner.py, resultbrowser.py
|
|
||||||
|
|
||||||
# For old VSS FAIL
|
|
||||||
# alsa-lib # libasound.so.2
|
|
||||||
# boost_pkgs.boost174 # libboost_coroutine.so.1.74.0, libboost_regex.so.1.74.0, libboost_thread.so.1.74.0
|
|
||||||
# capstone_4 # libcapstone.so.4
|
|
||||||
# libdwarf_pkgs.libdwarf # libdwarf.so.1
|
|
||||||
# elfutils # libelf.so.1
|
|
||||||
# mariadb # libmariadb.so.3
|
|
||||||
# libpcl # libpcl.so.1
|
|
||||||
# protobuf_21 # libprotobuf.so.32
|
|
||||||
# SDL # libSDL-1.2.so.0
|
|
||||||
# libx11 # libX11.so.6
|
|
||||||
# libxrandr # libXrandr.so.2
|
|
||||||
# libz # libz.so.1
|
|
||||||
|
|
||||||
# For current FAIL
|
|
||||||
boost183
|
|
||||||
capstone # libcapstone.so.5
|
|
||||||
libdwarf_pkgs.libdwarf # libdwarf.so.1
|
|
||||||
elfutils # libelf.so.1
|
|
||||||
mariadb # libmariadb.so.3
|
|
||||||
protobuf_21 # libprotobuf.so.32
|
|
||||||
libz # libz.so.1
|
|
||||||
];
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
runHook preInstall
|
|
||||||
|
|
||||||
mkdir -p $out
|
|
||||||
cp -rv ./fail/bin $out/bin
|
|
||||||
cp -rv ./fail/share $out/share
|
|
||||||
|
|
||||||
runHook postInstall
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
# Provide package for "nix build"
|
|
||||||
packages = {
|
|
||||||
default = fail-bin;
|
|
||||||
fail = fail-bin;
|
|
||||||
wasi-sdk = wasi-sdk;
|
|
||||||
iwasm = iwasm;
|
|
||||||
wamrc = wamrc;
|
|
||||||
};
|
|
||||||
apps = {
|
|
||||||
default = flake-utils.lib.mkApp {drv = fail-bin;};
|
|
||||||
fail = fail-bin;
|
|
||||||
wasi-sdk = wasi-sdk;
|
|
||||||
iwasm = iwasm;
|
|
||||||
wamrc = wamrc;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
devShells = {
|
libiwasm-baremetal-debug = mkLibiwasm {
|
||||||
# Provide default environment for "nix develop".
|
buildenv = i386_pkgs.stdenv;
|
||||||
# Other environments can be added below.
|
platform = "baremetal";
|
||||||
default = pkgs.mkShell {
|
buildtype = "Debug";
|
||||||
inherit nativeBuildInputs buildInputs shellHook;
|
cflags = "-O0 -ggdb3";
|
||||||
name = description;
|
extraCmakeFlags = [
|
||||||
|
"-DCMAKE_SYSTEM_NAME=Generic"
|
||||||
|
"-DCMAKE_SYSTEM_PROCESSOR=i386"
|
||||||
|
"-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
libiwasm-baremetal-release = mkLibiwasm {
|
||||||
|
buildenv = i386_pkgs.stdenv;
|
||||||
|
platform = "baremetal";
|
||||||
|
buildtype = "MinSizeRel";
|
||||||
|
cflags = "-O2 -ggdb3 -DNDEBUG";
|
||||||
|
extraCmakeFlags = [
|
||||||
|
"-DCMAKE_SYSTEM_NAME=Generic"
|
||||||
|
"-DCMAKE_SYSTEM_PROCESSOR=i386"
|
||||||
|
"-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
# =========================================================================================
|
libiwasm-linux-debug = mkLibiwasm {
|
||||||
# Define environment variables
|
buildenv = pkgs.multiStdenv;
|
||||||
# =========================================================================================
|
platform = "linux";
|
||||||
|
buildtype = "Debug";
|
||||||
|
cflags = "-O0 -ggdb3";
|
||||||
|
};
|
||||||
|
libiwasm-linux-release = mkLibiwasm {
|
||||||
|
buildenv = pkgs.multiStdenv;
|
||||||
|
platform = "linux";
|
||||||
|
buildtype = "MinSizeRel";
|
||||||
|
cflags = "-O2 -ggdb3 -DNDEBUG";
|
||||||
|
};
|
||||||
|
|
||||||
# Dynamic libraries from buildinputs:
|
# ===========================================================================================
|
||||||
# LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;
|
# Specify dependencies
|
||||||
|
# https://nixos.org/manual/nixpkgs/stable/#ssec-stdenv-dependencies-overview
|
||||||
|
# Just for a "nix develop" shell, buildInputs can be used for everything.
|
||||||
|
# ===========================================================================================
|
||||||
|
|
||||||
# Those are read by compile.pl / build.pl
|
# Add dependencies to nativeBuildInputs if they are executed during the build:
|
||||||
FAIL_SHARE = "${fail-bin}/share";
|
# - Those which are needed on $PATH during the build, for example cmake and pkg-config
|
||||||
FAIL_PYTHON = "${python}/bin/python";
|
# - Setup hooks, for example makeWrapper/autoPatchelfHook
|
||||||
WASI_ROOT = wasi-sdk;
|
# - Interpreters needed by patchShebangs for build scripts (with the --build flag), which can be the case for e.g. perl
|
||||||
WAMR_ROOT = "/home/christoph/Notes/TU/MastersThesis/FailNix/wamr";
|
nativeBuildInputs = with pkgs; [
|
||||||
CROSS_CC = "${i386_pkgs.stdenv.cc}/bin/i386-elf-gcc";
|
just
|
||||||
CROSS_CXX = "${i386_pkgs.stdenv.cc}/bin/i386-elf-g++";
|
gdb
|
||||||
LINUX_CC = "${pkgs.multiStdenv.cc}/bin/gcc";
|
xxd
|
||||||
LINUX_CXX = "${pkgs.multiStdenv.cc}/bin/g++";
|
wabt
|
||||||
};
|
grub2
|
||||||
|
xorriso
|
||||||
|
mariadb.client
|
||||||
|
# dbeaver-bin
|
||||||
|
# beekeeper-studio
|
||||||
|
# tableplus
|
||||||
|
lazysql
|
||||||
|
iwasm
|
||||||
|
wamrc
|
||||||
|
fail-bin
|
||||||
|
php
|
||||||
|
|
||||||
|
# perl
|
||||||
|
|
||||||
|
# Don't install to not pollute our PATH. Just export as environment variable.
|
||||||
|
# wasi-sdk
|
||||||
|
# libiwasm_debug
|
||||||
|
# libiwasm_release
|
||||||
|
];
|
||||||
|
|
||||||
|
# Add dependencies to buildInputs if they will end up copied or linked into the final output or otherwise used at runtime:
|
||||||
|
# - Libraries used by compilers, for example zlib
|
||||||
|
# - Interpreters needed by patchShebangs for scripts which are installed, which can be the case for e.g. perl
|
||||||
|
buildInputs = with pkgs; [];
|
||||||
|
|
||||||
|
# ===========================================================================================
|
||||||
|
# Define buildable + installable packages
|
||||||
|
# ===========================================================================================
|
||||||
|
|
||||||
|
fail-bin = stdenv.mkDerivation {
|
||||||
|
pname = "fail";
|
||||||
|
version = "1.0.0";
|
||||||
|
src = ./.;
|
||||||
|
|
||||||
|
nativeBuildInputs = with pkgs; [
|
||||||
|
autoPatchelfHook
|
||||||
|
];
|
||||||
|
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
# FAIL runtime dependencies
|
||||||
|
python # bochs-experiment-runner.py, resultbrowser.py
|
||||||
|
alsa-lib # libasound.so.2
|
||||||
|
boost_pkgs.boost174 # libboost_coroutine.so.1.74.0, libboost_regex.so.1.74.0, libboost_thread.so.1.74.0
|
||||||
|
capstone_4 # libcapstone.so.4
|
||||||
|
libdwarf_pkgs.libdwarf # libdwarf.so.1
|
||||||
|
elfutils # libelf.so.1
|
||||||
|
mariadb # libmariadb.so.3
|
||||||
|
libpcl # libpcl.so.1
|
||||||
|
protobuf_21 # libprotobuf.so.32
|
||||||
|
SDL # libSDL-1.2.so.0
|
||||||
|
libx11 # libX11.so.6
|
||||||
|
libxrandr # libXrandr.so.2
|
||||||
|
libz # libz.so.1
|
||||||
|
];
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
|
mkdir -p $out
|
||||||
|
cp -rv ./fail/bin $out/bin
|
||||||
|
cp -rv ./fail/share $out/share
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
# Provide package for "nix build"
|
||||||
|
packages = {
|
||||||
|
default = fail-bin;
|
||||||
|
fail = fail-bin;
|
||||||
|
wasi-sdk = wasi-sdk;
|
||||||
|
iwasm = iwasm;
|
||||||
|
wamrc = wamrc;
|
||||||
|
};
|
||||||
|
apps = {
|
||||||
|
default = flake-utils.lib.mkApp {drv = fail-bin;};
|
||||||
|
fail = fail-bin;
|
||||||
|
wasi-sdk = wasi-sdk;
|
||||||
|
iwasm = iwasm;
|
||||||
|
wamrc = wamrc;
|
||||||
|
};
|
||||||
|
|
||||||
|
devShells = {
|
||||||
|
# Provide default environment for "nix develop".
|
||||||
|
# Other environments can be added below.
|
||||||
|
default = pkgs.mkShell {
|
||||||
|
inherit nativeBuildInputs buildInputs shellHook;
|
||||||
|
name = description;
|
||||||
|
|
||||||
|
# =========================================================================================
|
||||||
|
# Define environment variables
|
||||||
|
# =========================================================================================
|
||||||
|
|
||||||
|
# Dynamic libraries from buildinputs:
|
||||||
|
# LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;
|
||||||
|
|
||||||
|
JUST_WORKING_DIRECTORY = "/home/christoph/Notes/TU/MastersThesis/FailNix";
|
||||||
|
JUST_JUSTFILE = "/home/christoph/Notes/TU/MastersThesis/FailNix/scripts/nixos.just";
|
||||||
|
|
||||||
|
# Those are read by the justfile
|
||||||
|
FAIL_SHARE = "${fail-bin}/share";
|
||||||
|
WASI_ROOT = wasi-sdk;
|
||||||
|
WAMR_ROOT = wamr;
|
||||||
|
LIBIWASM_DEBUG = "${libiwasm-baremetal-debug}/lib";
|
||||||
|
LIBIWASM_RELEASE = "${libiwasm-baremetal-release}/lib";
|
||||||
|
LIBIWASM_LINUX_DEBUG = "${libiwasm-linux-debug}/lib";
|
||||||
|
LIBIWASM_LINUX_RELEASE = "${libiwasm-linux-release}/lib";
|
||||||
|
CROSS_CC = "${i386_pkgs.stdenv.cc}/bin/i386-elf-gcc";
|
||||||
|
CROSS_CXX = "${i386_pkgs.stdenv.cc}/bin/i386-elf-g++";
|
||||||
|
LINUX_CC = "${pkgs.multiStdenv.cc}/bin/gcc";
|
||||||
|
LINUX_CXX = "${pkgs.multiStdenv.cc}/bin/g++";
|
||||||
};
|
};
|
||||||
}
|
};
|
||||||
);
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,15 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<PROJECT>
|
|
||||||
<PROJECT_DATA_XML_NAME NAME="DISPLAY_DATA">
|
|
||||||
<SAVE_STATE>
|
|
||||||
<ARRAY NAME="EXPANDED_PATHS" TYPE="string">
|
|
||||||
<A VALUE="06-09_13-57-11_sum0_c_fail:" />
|
|
||||||
</ARRAY>
|
|
||||||
<STATE NAME="SHOW_TABLE" TYPE="boolean" VALUE="false" />
|
|
||||||
</SAVE_STATE>
|
|
||||||
</PROJECT_DATA_XML_NAME>
|
|
||||||
<TOOL_MANAGER ACTIVE_WORKSPACE="Workspace">
|
|
||||||
<WORKSPACE NAME="Workspace" ACTIVE="true" />
|
|
||||||
</TOOL_MANAGER>
|
|
||||||
</PROJECT>
|
|
||||||
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,15 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<PROJECT>
|
|
||||||
<PROJECT_DATA_XML_NAME NAME="DISPLAY_DATA">
|
|
||||||
<SAVE_STATE>
|
|
||||||
<ARRAY NAME="EXPANDED_PATHS" TYPE="string">
|
|
||||||
<A VALUE="06-09_22-34-26_sum0_aot_fail:" />
|
|
||||||
</ARRAY>
|
|
||||||
<STATE NAME="SHOW_TABLE" TYPE="boolean" VALUE="false" />
|
|
||||||
</SAVE_STATE>
|
|
||||||
</PROJECT_DATA_XML_NAME>
|
|
||||||
<TOOL_MANAGER ACTIVE_WORKSPACE="Workspace">
|
|
||||||
<WORKSPACE NAME="Workspace" ACTIVE="true" />
|
|
||||||
</TOOL_MANAGER>
|
|
||||||
</PROJECT>
|
|
||||||
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,15 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<PROJECT>
|
|
||||||
<PROJECT_DATA_XML_NAME NAME="DISPLAY_DATA">
|
|
||||||
<SAVE_STATE>
|
|
||||||
<ARRAY NAME="EXPANDED_PATHS" TYPE="string">
|
|
||||||
<A VALUE="06-10_21-32-23_sum0_interp_fail:" />
|
|
||||||
</ARRAY>
|
|
||||||
<STATE NAME="SHOW_TABLE" TYPE="boolean" VALUE="false" />
|
|
||||||
</SAVE_STATE>
|
|
||||||
</PROJECT_DATA_XML_NAME>
|
|
||||||
<TOOL_MANAGER ACTIVE_WORKSPACE="Workspace">
|
|
||||||
<WORKSPACE NAME="Workspace" ACTIVE="true" />
|
|
||||||
</TOOL_MANAGER>
|
|
||||||
</PROJECT>
|
|
||||||
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+4
-6
@@ -33,8 +33,8 @@ public class ImportMarkersAsBookmarks extends GhidraScript {
|
|||||||
int skipped = 0;
|
int skipped = 0;
|
||||||
int lineNo = 0;
|
int lineNo = 0;
|
||||||
|
|
||||||
// CSV columns: (benchmark, resulttype, faults, fault_address, mnemonic)
|
// CSV columns: (benchmark, resulttype, faults, fault_address)
|
||||||
// Example: (ip , OK_MARKER , 4311 , 0x10001B , mov)
|
// Example: (ip , OK_MARKER , 4311 , 0x10001B )
|
||||||
try (BufferedReader br = new BufferedReader(new FileReader(input))) {
|
try (BufferedReader br = new BufferedReader(new FileReader(input))) {
|
||||||
String line;
|
String line;
|
||||||
while ((line = br.readLine()) != null) {
|
while ((line = br.readLine()) != null) {
|
||||||
@@ -47,7 +47,7 @@ public class ImportMarkersAsBookmarks extends GhidraScript {
|
|||||||
|
|
||||||
// Make sure to always use "," delimiter and never quotations
|
// Make sure to always use "," delimiter and never quotations
|
||||||
String[] parts = line.split(",");
|
String[] parts = line.split(",");
|
||||||
if (parts.length != 5) {
|
if (parts.length != 4) {
|
||||||
skipped++;
|
skipped++;
|
||||||
printerr("Line " + lineNo + ": malformed");
|
printerr("Line " + lineNo + ": malformed");
|
||||||
continue;
|
continue;
|
||||||
@@ -57,13 +57,11 @@ public class ImportMarkersAsBookmarks extends GhidraScript {
|
|||||||
String typeText = parts[1].trim();
|
String typeText = parts[1].trim();
|
||||||
String countText = parts[2].trim();
|
String countText = parts[2].trim();
|
||||||
String addrText = parts[3].trim();
|
String addrText = parts[3].trim();
|
||||||
String mnemonicText = parts[4].trim();
|
|
||||||
|
|
||||||
if (benchText.isEmpty()
|
if (benchText.isEmpty()
|
||||||
|| typeText.isEmpty()
|
|| typeText.isEmpty()
|
||||||
|| countText.isEmpty()
|
|| countText.isEmpty()
|
||||||
|| addrText.isEmpty()
|
|| addrText.isEmpty()) {
|
||||||
|| mnemonicText.isEmpty()) {
|
|
||||||
skipped++;
|
skipped++;
|
||||||
printerr("Line " + lineNo + ": malformed");
|
printerr("Line " + lineNo + ": malformed");
|
||||||
continue;
|
continue;
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user