Compare commits

..
158 Commits
Author SHA1 Message Date
christoph 9ca8e88ec0 don't save client logs 2026-05-06 20:36:10 +02:00
christoph be2c4b7bf2 log experiment stages to separate files 2026-05-06 20:30:41 +02:00
christoph 644603fb8b don't move runner log 2026-05-06 20:08:39 +02:00
christoph 0dccd1df46 update fail binaries again again 2026-05-06 19:52:25 +02:00
christoph 9db4cb8bb1 remove fail binaries 2026-05-06 19:39:47 +02:00
Christoph Urlacher 10fe608a90 separate client/server logs + move logs to experiment dir 2026-05-04 13:32:34 +02:00
christoph 2de6e20675 update fail binaries again - set static port (--server-port doesn't work) 2026-05-04 13:31:18 +02:00
christoph bc98e2af5c add updated fail binaries 2026-05-04 11:38:05 +02:00
christoph 3819e84acb remove fail binaries 2026-05-04 11:35:42 +02:00
christoph 6ce8987ebd add --server-port option to generic-experiment-client 2026-04-29 21:02:10 +02:00
christoph 6859402483 update FAIL database queries for new version 2026-04-29 20:16:24 +02:00
christoph 32b1f3fa31 move old FAIL binaries so nix doesn't autopatchelf them 2026-04-29 20:10:02 +02:00
christoph a6f33f1960 update FAIL version to current 2026-04-29 19:58:18 +02:00
christoph 1bf4886c64 choose experiments instead of builds for radare/objdump/wasm-objdump actions 2026-04-28 00:53:46 +02:00
christoph e33fed9b8d add binaryninja action to menu 2026-04-28 00:40:31 +02:00
christoph c87409dd5c add radare/objdump/wasm-objdump actions to menu 2026-04-28 00:17:51 +02:00
christoph 5f6537b7ea reenable --catch-outerspace and --catch-write-textsegment 2026-04-27 19:09:19 +02:00
christoph 5bfe1a366b disable --catch-outerspace and --catch-write-textsegment 2026-04-27 18:49:51 +02:00
christoph f2559c8445 disable --catch-write-textsegment 2026-04-27 15:57:17 +02:00
christoph 4d0693dd30 disable --catch-outerspace 2026-04-27 15:49:18 +02:00
christoph bba9ced348 add sankey chart 2026-04-24 15:27:41 +02:00
christoph a8aa0bbb07 add matrix multiplication test program 2026-04-24 15:27:20 +02:00
christoph 1257534a64 enable --full-trace and --check-bounds 2026-04-24 15:27:11 +02:00
christoph 5aab319424 import native symbols in lib.h
lib.h gets included into the host module and the wasm module. For the
host module the attributes will be ignored.
2026-04-24 10:45:55 +02:00
christoph 348aac20ae add lazysql menu action 2026-04-24 00:25:06 +02:00
christoph 5da8fffed0 add tableplus to shell environment 2026-04-24 00:03:25 +02:00
christoph 2b554a22ad read entire marker notes file instead of first line 2026-04-23 22:44:50 +02:00
christoph c76b0b8a8e allow annotating markers in explorer 2026-04-23 21:53:07 +02:00
christoph 5f42323ccb display corresponding section for markers in explorer 2026-04-23 18:42:31 +02:00
christoph 551335bf53 store additional files with builds (flake/startup/linkerscript/...) 2026-04-23 17:56:46 +02:00
christoph 7bd3d205c9 scatterplot: addresses in hex 2026-04-23 17:55:57 +02:00
christoph 59e36f6a7f update fail-db.png 2026-04-22 23:59:53 +02:00
christoph 693378d059 fix fail trace sources import 2026-04-22 21:53:52 +02:00
christoph 1773e1d55a run FullTraceImporter when importing trace + import --sources 2026-04-22 21:45:44 +02:00
christoph 99c32e1ac0 add visualfail 2026-04-22 21:45:18 +02:00
christoph 5ff6f6d0d8 remove obsolete startup.s modifications 2026-04-22 15:41:15 +02:00
christoph 6c7351b3d1 add result comparison menu action 2026-04-22 15:40:57 +02:00
christoph e36cfdc07d abort assembly/source loading if no marker is selected in explorer 2026-04-22 10:22:57 +02:00
christoph 7067c015bc exclude existing experiments when archiving 2026-04-21 23:21:14 +02:00
christoph 94ec38fa84 cleanup old injections/projects 2026-04-21 22:37:18 +02:00
christoph 42817bab52 decrease loop iterations in sum sample 2026-04-21 22:35:33 +02:00
christoph aec774c633 link mmap_space + aot array into .text 2026-04-21 22:34:36 +02:00
christoph 41ffcaeb08 add obsidian experiment note creation menu action 2026-04-21 22:32:17 +02:00
christoph 41e079b977 add resultbrowser menu action 2026-04-21 18:39:47 +02:00
christoph 371b323980 add ssh keepalive to perl ssh connection 2026-04-21 18:39:27 +02:00
christoph d1d6e4de34 undo last change 2026-04-21 16:34:10 +02:00
christoph a7e2c14529 don't redirect fail client output to /dev/null 2026-04-21 16:21:29 +02:00
christoph 7bbd30a6f8 add ACCESS_OUTERSPACE markertype to explorer filters 2026-04-21 16:18:27 +02:00
christoph 8ea5aed355 fix database creation in deploy.pl 2026-04-21 14:48:47 +02:00
christoph 264795bf71 don't link mmap region into .text but aot array itself 2026-04-21 14:46:31 +02:00
christoph ea56079c09 replace : with - on experiment archival 2026-04-21 14:11:57 +02:00
christoph f45ce702d2 add abandoned ghidra path remapping script 2026-04-21 14:11:24 +02:00
christoph 545b581659 color points based on resulttype in scatterplot 2026-04-21 14:10:37 +02:00
christoph 353f971408 remove faulty injections 2026-04-21 14:07:58 +02:00
christoph 77d0cd7814 remove faulty ghidra projects 2026-04-21 14:07:18 +02:00
christoph ed0a3b67de filter markers by default in explorer 2026-04-21 12:21:15 +02:00
christoph 51fb2ef4d4 only deploy "fail" targets, only gdb "linux" targets, only import new results into ghidra 2026-04-21 01:06:57 +02:00
christoph 0dbcaf68cd update wasm aot recipe for linux (only use --xip for fail/baremetal) 2026-04-21 00:39:00 +02:00
christoph 19048ed4bf add run in gdb menu action 2026-04-20 23:52:06 +02:00
christoph 495f74ade7 ignore db.conf 2026-04-20 21:06:14 +02:00
christoph 6125a3b9fc add barebones results bar chart 2026-04-20 21:01:07 +02:00
christoph 7b31507403 add result explorer 2026-04-20 20:59:36 +02:00
christoph aacc895800 update flake to use direnv 2026-04-20 11:41:08 +02:00
christoph 116aa5f303 update ghidra projects 2026-04-20 00:21:29 +02:00
christoph 2d9837219c update injections 2026-04-20 00:21:18 +02:00
christoph fabf7745ee update ghidra marker import script (headless, import all types from all benchs) 2026-04-20 00:17:46 +02:00
christoph 5b316bbd64 add curses entry point for scripts (archival, ghidra import, plots, queries, cleanup) 2026-04-20 00:16:27 +02:00
christoph 9c7933e912 add query for detected markers 2026-04-19 13:21:56 +02:00
christoph d925b19135 add queries for other fault types 2026-04-19 13:19:55 +02:00
christoph 31d2b422cb move update_db_config to util 2026-04-19 13:05:32 +02:00
christoph 10bffc0fbc run all available queries automatically 2026-04-19 12:55:33 +02:00
christoph f6989084ff fix query typos 2026-04-19 12:46:36 +02:00
christoph d345745962 use qualified names for module functions 2026-04-19 12:45:46 +02:00
christoph f729cfbcd2 add current script path to @INC 2026-04-19 12:42:52 +02:00
christoph 8a381d71cf add objdump just recipe 2026-04-19 12:39:14 +02:00
christoph c092295520 move queries to modules 2026-04-19 12:39:00 +02:00
christoph 7efa945977 move some functions to Util module 2026-04-19 12:38:47 +02:00
christoph 40d40bc57b update targets 2026-04-18 19:46:45 +02:00
christoph 5dd763fd8a pass substitution as function 2026-04-18 18:03:05 +02:00
christoph 4d714a4442 substitute tabs with , for csv output 2026-04-18 17:49:04 +02:00
christoph 540596c33d fix injection error handling 2026-04-18 17:42:14 +02:00
christoph cf319c5a72 wait for fail server port 2026-04-18 12:10:01 +02:00
christoph e7cfc59096 add fork logs to inject 2026-04-18 11:52:52 +02:00
christoph d9e0d8d70d send injection results as ntfy attachements 2026-04-18 11:50:06 +02:00
christoph b141ba1e38 invoke runner without screen + add log file 2026-04-18 11:36:47 +02:00
christoph 959c9a8bee run with all available cpus 2026-04-18 11:36:36 +02:00
christoph 86e3814fb2 loop dropdb + support multiple selection 2026-04-18 11:36:12 +02:00
Christoph Urlacher a287df261c fix runner external commands 2026-04-18 10:27:08 +02:00
christoph eebb596773 update sub import/inject 2026-04-17 22:45:10 +02:00
christoph d45d367d89 update sub trace 2026-04-17 22:39:38 +02:00
christoph 038660c969 fix print to filehandle bug 2026-04-17 22:33:56 +02:00
christoph ca405f953b add success check to file writing 2026-04-17 22:27:36 +02:00
christoph c3ada55395 add newline to db.conf updater 2026-04-17 22:21:48 +02:00
christoph 52e766e1c2 fix duplicated filehandle bug 2026-04-17 22:18:02 +02:00
christoph a10f04c83e fix screen old session termination bug + db.conf rewriting bug 2026-04-17 22:13:31 +02:00
christoph 0d168bf759 add wip buildscripts for automated experiment execution 2026-04-17 21:58:29 +02:00
christoph 94f3fc7611 update injections + projects (aot readonly test) 2026-04-17 15:17:53 +02:00
christoph 5538e19c82 move justfiles to scripts/ 2026-04-17 15:17:30 +02:00
christoph 980025e5a1 disable --catch-write-textsegment after moving mmap memory region into .text 2026-04-17 00:59:04 +02:00
christoph 18c3f13a71 move wamr mmap memory region into .text segment for wamr aot mode 2026-04-17 00:25:22 +02:00
christoph 3563a810a1 enable --catch-write-textsegment and --catch-outerspace 2026-04-16 22:36:48 +02:00
christoph 329014aada unify host programs across targets 2026-04-16 22:36:36 +02:00
christoph e73ab0a788 update build recipe: copy wasm-module source to build directory for archival 2026-04-16 12:47:06 +02:00
christoph bd7f09251e update injections + projects (cored aot/interp) 2026-04-16 12:46:42 +02:00
christoph 187ad521cb update injections + projects (cored c) 2026-04-13 23:04:05 +02:00
christoph 550ce0b079 do fail interactions inside wasm module + unify host modules + fix cored module 2026-04-13 23:03:54 +02:00
christoph fe6c2f5b99 update injections + projects (cored interp) 2026-04-08 18:32:44 +02:00
christoph 89db76e555 update injections + projects (cored c/aot) 2026-04-07 22:13:13 +02:00
christoph 28a3c37d41 update hosts for cored target
WIP: currently the hosts are not generic and don't support different
targets
2026-04-07 22:12:57 +02:00
christoph 39d2e1c51f switch fail markers to function symbols 2026-04-01 21:17:01 +02:00
christoph 353dfae39c add interp ghidra project with -O0 2026-03-19 18:59:25 +01:00
christoph e3b97ba865 add interp injection with -O0 2026-03-19 18:59:09 +01:00
christoph fc1d3feadb update mars faildir 2026-03-19 09:02:53 +01:00
christoph 63231f8b48 update mars faildir 2026-03-19 01:17:43 +01:00
christoph 07830e1976 re-add file (lfs issue) 2026-03-19 01:14:08 +01:00
christoph f170ded33b remove file 2026-03-19 01:10:39 +01:00
christoph 23f1d55feb rename file 2026-03-19 01:08:44 +01:00
christoph a10dc97616 update injections + projects 2026-03-19 01:01:01 +01:00
christoph d797e9f71c compile with -O0 and -ggdb3 2026-03-19 01:00:54 +01:00
christoph ea6a009c0d add aot ghidra project 2026-03-18 23:13:34 +01:00
christoph bc2eefface add c-only ghidra project 2026-03-18 23:13:27 +01:00
christoph a0ea3a3bbf update .gitignore 2026-03-18 23:13:21 +01:00
christoph 92ac5ec7d8 move ghidra script location 2026-03-18 23:12:47 +01:00
christoph 07ac6f6fc3 update .gitattributes 2026-03-18 23:12:18 +01:00
christoph 7b47a70448 add aot injection 2026-03-18 23:11:00 +01:00
christoph 96082f33aa add c-only injection 2026-03-18 23:10:56 +01:00
christoph 945c1fe0bc update recipes 2026-03-18 23:10:41 +01:00
christoph 5efff7c84e add rough fail db table overview 2026-03-18 23:10:38 +01:00
christoph 83ae53768c update .gitattributes 2026-03-18 23:10:33 +01:00
christoph c8fb5d537d add gitattributes 2026-03-18 20:06:36 +01:00
christoph a6a335aaf4 move fail binaries 2026-03-18 19:54:44 +01:00
christoph 5d4d84de39 add ghidra script to import markers as bookmarks 2026-03-17 23:52:33 +01:00
christoph 8afdee2fd2 add recipe to download markers from mars 2026-03-17 23:52:22 +01:00
christoph 0d871c4e56 add recipe to export markers to csv 2026-03-17 23:09:12 +01:00
christoph 5e0b71a818 update radare2 config 2026-03-17 20:43:39 +01:00
christoph af70aebcff update radare2 config 2026-03-17 20:42:26 +01:00
christoph cacd2d8883 update radare2 config 2026-03-17 20:41:54 +01:00
christoph 35dec73236 update radare2 config 2026-03-17 20:40:57 +01:00
christoph e23a3d5033 disable importing --sources because of libdwarf error on mars
FAIL_IMPORT requires dwarf_init from libdwarf, but provided version only
defines dwarf_init_b?
2026-03-13 00:37:28 +01:00
christoph b500d56c8e make radare recipe accept an address 2026-03-13 00:31:23 +01:00
christoph 8a0193408f remove obsolete recipe 2026-03-13 00:24:57 +01:00
christoph 129ba0e0b6 add a c-only target (no WASM) 2026-03-13 00:22:03 +01:00
christoph 0f847d7d2d split compilation into wasm.just + add targets for interpreted wasm 2026-03-12 21:13:06 +01:00
christoph 28d1db3b79 launch fail on non-default port on mars 2026-03-12 15:36:09 +01:00
christoph c1eb861bfb fix just path in mars.just 2026-03-12 15:16:57 +01:00
christoph 4b8a4ad0f1 split justfile into nixos.just + mars.just 2026-03-12 15:15:15 +01:00
christoph a79219d39e add just static binaries 2026-03-12 14:57:48 +01:00
christoph 593b88c3fd don't stop server in all-in-one 2026-03-12 14:52:22 +01:00
christoph b1a8fe0c53 add all in one recipe 2026-03-12 14:26:36 +01:00
christoph 99608cc645 use shebang recipes for conditional dependencies instead of inline templating 2026-03-12 14:06:45 +01:00
christoph 50c6e9adea add linux-posix + linux-baremetal recipes 2026-03-12 13:45:33 +01:00
christoph 66eb0b3814 replace compose-file with direct docker command + add dbeaver recipe 2026-03-12 10:16:09 +01:00
christoph 078fdca44b fix incompatible libdwarf version 2026-03-12 10:15:30 +01:00
christoph 744af52f76 slightly restructure flake 2026-03-12 09:27:07 +01:00
christoph 43414edd0a add injection targets 2026-03-12 01:42:34 +01:00
christoph 679aeb24d4 add build + fail recipes 2026-03-12 01:42:25 +01:00
christoph facf04df7f add wasi/wamr dependencies 2026-03-12 01:41:43 +01:00
christoph 86baf67fac add binaries 2026-03-11 20:22:30 +01:00
3218 changed files with 9532 additions and 530958 deletions
-1
View File
@@ -6,4 +6,3 @@
/db.conf
/fail/bin/resultbrowser/app/__pycache__
/fail/bin/VisualFAIL/CONFIGURATION.php
/qemu.log
-9
View File
@@ -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
-72
View File
@@ -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",
},
}
],
}
-25
View File
@@ -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$",
},
},
},
],
}
@@ -6,16 +6,13 @@ library(ggalluvial)
args <- commandArgs(trailingOnly = TRUE)
argc <- length(args)
if (argc < 2 || argc > 3) {
print("Expecting two or three arguments: exp1 exp2 [faults_file]")
if (argc != 2) {
print("Expecting two input files")
stop()
}
faults_file <- if (argc == 3) args[3] else "faults.csv"
suffix <- gsub("^faults|\\.csv$", "", faults_file)
for (experiment in args[1:2]) {
datafile <- file.path(experiment, faults_file)
for (experiment in args) {
datafile <- paste(experiment, "/faults.csv", sep = "")
if (!file.exists(datafile)) {
print(paste("Input file", datafile, "is missing"))
stop()
@@ -33,13 +30,13 @@ resulttype_labels <- c(
)
# Read data
datafile1 <- file.path(args[1], faults_file)
datafile1 <- paste(args[1], "/faults.csv", sep = "")
data1 <- readr::read_csv(datafile1)
data1$fault_address <- strtoi(data1$fault_address)
data1$resulttype <- resulttype_labels[data1$resulttype]
# tibble::glimpse(data1)
datafile2 <- file.path(args[2], faults_file)
datafile2 <- paste(args[2], "/faults.csv", sep = "")
data2 <- readr::read_csv(datafile2)
data2$fault_address <- strtoi(data2$fault_address)
data2$resulttype <- resulttype_labels[data2$resulttype]
@@ -78,6 +75,6 @@ plot <- ggplot(
# TODO: Name the file according to the benchmarks
ggsave(
paste0(args[2], "/../sankey", suffix, ".svg"),
paste(args[2], "/../sankey.svg", sep = ""),
plot = plot,
)
@@ -1,12 +1,10 @@
library(ggplot2)
# Usage: Rscript single_result.r exp_abspath [resultsdata_file]
# Usage: Rscript single_result.r exp_abspath
args <- commandArgs(trailingOnly = TRUE)
experiment <- args[1]
resultsdata_file <- if (length(args) >= 2) args[2] else "resultsdata.csv"
suffix <- gsub("^resultsdata|\\.csv$", "", resultsdata_file)
datafile <- file.path(experiment, resultsdata_file)
datafile <- paste(experiment, "/resultsdata.csv", sep = "")
if (!file.exists(datafile)) {
print(paste("Input file", datafile, "is missing"))
@@ -23,6 +21,6 @@ plot <- ggplot(data, aes(x = benchmark, y = faults, fill = resulttype)) +
theme_minimal()
ggsave(
paste0(experiment, "/single_result", suffix, ".svg"),
paste(experiment, "/single_result.svg", sep = ""),
plot = plot,
)
@@ -6,9 +6,7 @@ library(ggplot2)
args <- commandArgs(trailingOnly = TRUE)
experiment <- args[1]
faults_file <- if (length(args) >= 2) args[2] else "faults.csv"
suffix <- gsub("^faults|\\.csv$", "", faults_file)
datafile <- file.path(experiment, faults_file)
datafile <- paste(experiment, "/faults.csv", sep = "")
if (!file.exists(datafile)) {
print(paste("Input file", datafile, "is missing"))
@@ -29,6 +27,6 @@ plot <- ggplot(data, aes(x = fault_address, y = faults)) +
theme_minimal()
ggsave(
paste0(experiment, "/scatter", suffix, ".svg"),
paste(experiment, "/scatter.svg", sep = ""),
plot = plot,
)
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Submodule fail/src deleted from dda6da2a50
+489 -348
View File
@@ -12,388 +12,529 @@ rec {
flake-utils,
}:
# Create a shell (and possibly package) for each possible system, not only x86_64-linux
flake-utils.lib.eachDefaultSystem (
system: let
# =========================================================================================
# Define pkgs/stdenvs
# =========================================================================================
pkgs = import nixpkgs {
flake-utils.lib.eachDefaultSystem (system: let
# =========================================================================================
# Define pkgs/stdenvs
# =========================================================================================
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;
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;
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 (pkgs) lib stdenv;
libdwarf_pkgs =
import
(builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/f597e7e9fcf37d8ed14a12835ede0a7d362314bd.tar.gz";
sha256 = "sha256:1l79hh7jh7m8yc5mvc8dbg6s8rf30bgm994kf07xriqbzwfn158r";
})
{
inherit system;
};
# =========================================================================================
# Define shell environment
# =========================================================================================
inherit (pkgs) lib stdenv;
# =========================================================================================
# Define shell environment
# =========================================================================================
# 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)}
'';
# Setup the shell when entering the "nix develop" environment (bash script).
shellHook = let
mkCmakeScript = type: let
typeLower = lib.toLower type;
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}"'"
pkgs.writers.writeFish "cmake-${typeLower}.fish" ''
cd $FLAKE_PROJECT_ROOT
# 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}"
''
];
echo "Removing build directory ./cmake-build-${typeLower}/"
rm -rf ./cmake-build-${typeLower}
# ===========================================================================================
# Define custom dependencies
# ===========================================================================================
echo "Creating build directory"
mkdir cmake-build-${typeLower}
cd cmake-build-${typeLower}
python = pkgs.python314.withPackages (
p:
with p; [
setuptools
flask
flask-mysqldb
pyyaml
tabulate
]
);
echo "Running cmake"
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="${type}" -DCMAKE_EXPORT_COMPILE_COMMANDS="On" ..
# perl = pkgs.perl.withPackages (p:
# with p; [
# # Those are already installed system-wide
# # 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
echo "Linking compile_commands.json"
cd ..
ln -sf ./cmake-build-${typeLower}/compile_commands.json ./compile_commands.json
'';
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
wasi-sdk = stdenv.mkDerivation rec {
pname = "wasi-sdk";
version = "29";
eraseAbbr = name: value: ''abbr --erase ${name} 2>/dev/null'';
createAbbr = name: value: ''abbr -a ${name} "${value}"'';
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";
};
# 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..."
nativeBuildInputs = with pkgs; [
autoPatchelfHook
];
${builtins.concatStringsSep "\n" (lib.mapAttrsToList eraseAbbr abbrs)}
'';
buildInputs = with pkgs; [
libgcc.lib
];
# 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}
dontBuild = true;
installPhase = ''
runHook preInstall
echo "Sourcing \"${description}\" environment..."
mkdir -p $out
cp -rv ./* $out/
${builtins.concatStringsSep "\n" (lib.mapAttrsToList createAbbr abbrs)}
'';
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
'';
};
# 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
# 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}"
''
];
# 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 custom dependencies
# ===========================================================================================
# ===========================================================================================
# Define buildable + installable packages
# ===========================================================================================
python = pkgs.python314.withPackages (p:
with p; [
setuptools
flask
flask-mysqldb
pyyaml
]);
fail-bin = stdenv.mkDerivation {
pname = "fail";
version = "1.0.0";
src = ./.;
# perl = pkgs.perl.withPackages (p:
# with p; [
# # Those are already installed system-wide
# # 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";
# domain = "git.cs.tu-dortmund.de";
# owner = "christoph.urlacher";
repo = "wamr";
# With mmap_space in .text.wamr_aot
rev = "cda2009deb85511089b04b0ac736ad4da2d07e58";
hash = "sha256-CN6xTiwzF4Jbrpf21TF5c/C03Xb3urwkibRuIXjoU/w=";
# Without mmap_space in .text.wamr_aot
# rev = "4e7aed33fe53bf3ee4a3f2fe582c74816f850759";
# hash = "sha256-/4BKwoFDRfkA+DmbWagxdtkCDAED5rxbz5e4xvjvVWU=";
};
nativeBuildInputs = with pkgs; [cmake];
dontStrip = true;
cmakeBuildType = buildtype;
cmakeFlags =
extraCmakeFlags
++ [
"-DCMAKE_VERBOSE_MAKEFILE=ON"
"-DCMAKE_COLOR_DIAGNOSTICS=ON"
nativeBuildInputs = with pkgs; [
autoPatchelfHook
];
"-DWAMR_BUILD_PLATFORM=${platform}"
"-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; [
# FAIL runtime dependencies
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;
# Since GCC 15, implicit declarations are an error. Disable this.
NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration " + cflags;
};
devShells = {
# Provide default environment for "nix develop".
# Other environments can be added below.
default = pkgs.mkShell {
inherit nativeBuildInputs buildInputs shellHook;
name = description;
libiwasm-baremetal-debug = mkLibiwasm {
buildenv = i386_pkgs.stdenv;
platform = "baremetal";
buildtype = "Debug";
cflags = "-O0 -ggdb3";
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"
];
};
# =========================================================================================
# Define environment variables
# =========================================================================================
libiwasm-linux-debug = mkLibiwasm {
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
FAIL_SHARE = "${fail-bin}/share";
FAIL_PYTHON = "${python}/bin/python";
WASI_ROOT = wasi-sdk;
WAMR_ROOT = "/home/christoph/Notes/TU/MastersThesis/FailNix/wamr";
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++";
};
# 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; [
just
gdb
xxd
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
# 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 = {
# 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.
@@ -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.
@@ -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.
@@ -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.
@@ -33,8 +33,8 @@ public class ImportMarkersAsBookmarks extends GhidraScript {
int skipped = 0;
int lineNo = 0;
// CSV columns: (benchmark, resulttype, faults, fault_address, mnemonic)
// Example: (ip , OK_MARKER , 4311 , 0x10001B , mov)
// CSV columns: (benchmark, resulttype, faults, fault_address)
// Example: (ip , OK_MARKER , 4311 , 0x10001B )
try (BufferedReader br = new BufferedReader(new FileReader(input))) {
String line;
while ((line = br.readLine()) != null) {
@@ -47,7 +47,7 @@ public class ImportMarkersAsBookmarks extends GhidraScript {
// Make sure to always use "," delimiter and never quotations
String[] parts = line.split(",");
if (parts.length != 5) {
if (parts.length != 4) {
skipped++;
printerr("Line " + lineNo + ": malformed");
continue;
@@ -57,13 +57,11 @@ public class ImportMarkersAsBookmarks extends GhidraScript {
String typeText = parts[1].trim();
String countText = parts[2].trim();
String addrText = parts[3].trim();
String mnemonicText = parts[4].trim();
if (benchText.isEmpty()
|| typeText.isEmpty()
|| countText.isEmpty()
|| addrText.isEmpty()
|| mnemonicText.isEmpty()) {
|| addrText.isEmpty()) {
skipped++;
printerr("Line " + lineNo + ": malformed");
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.
1 version https://git-lfs.github.com/spec/v1
2 oid sha256:922a1baafbbfafe3e318ae339bb0b216eb596c075598e722e0b883d089c12317
3 size 3717
Binary file not shown.
1 version https://git-lfs.github.com/spec/v1
2 oid sha256:4937e207655c78cfbd81145709e31a03cedc45d6aacf3a1fcc2810227abef815
3 size 3717
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 version https://git-lfs.github.com/spec/v1
2 oid sha256:6a2a0b131a2b254bed1c3ee8e2b8a2dc4b4d0aace0c901b9974474fbdf0bb331
3 size 97
Binary file not shown.
1 version https://git-lfs.github.com/spec/v1
2 oid sha256:8753d7b67c83e1a04f2e305855ada9a6b53e8ab5b25681d59325a3ec33b31ed8
3 size 97
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 version https://git-lfs.github.com/spec/v1
2 oid sha256:f55c59602b0cba659b4c966bcc0527fb932ac58b9953efe8e5a885558df6532c
3 size 322
Binary file not shown.
1 version https://git-lfs.github.com/spec/v1
2 oid sha256:5574a95ffd444bbee21c1bc850155188001725ccb3f288f7d4f6f514703eac51
3 size 322
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