Verified Commit 1f6aeb30 authored by jD91mZM2's avatar jD91mZM2

Refactor compilation of test binaries

I know I should use Nix over Make, but I just wanted something quick
and dirty for these tiny files. And I want everyone to be able to use
them in a similar quick and dirty fashion.
parent 2d93df68
......@@ -44,6 +44,7 @@ dependencies = [
[[package]]
name = "gdb-remote-protocol"
version = "0.1.0"
source = "git+https://github.com/luser/rust-gdb-remote-protocol?rev=565ab0c0ac189c82b0e7df217860599fc1ae6287#565ab0c0ac189c82b0e7df217860599fc1ae6287"
dependencies = [
"log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"nom 3.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
......@@ -55,7 +56,7 @@ dependencies = [
name = "gdbserver"
version = "0.1.0"
dependencies = [
"gdb-remote-protocol 0.1.0",
"gdb-remote-protocol 0.1.0 (git+https://github.com/luser/rust-gdb-remote-protocol?rev=565ab0c0ac189c82b0e7df217860599fc1ae6287)",
"libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)",
"memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"structopt 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
......@@ -249,6 +250,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3d155346769a6855b86399e9bc3814ab343cd3d62c7e985113d46a0ec3c281fd"
"checksum cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "b486ce3ccf7ffd79fdeb678eac06a9e6c09fc88d33836340becb8fffe87c5e33"
"checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9"
"checksum gdb-remote-protocol 0.1.0 (git+https://github.com/luser/rust-gdb-remote-protocol?rev=565ab0c0ac189c82b0e7df217860599fc1ae6287)" = "<none>"
"checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205"
"checksum libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)" = "34fcd2c08d2f832f376f4173a231990fa5aef4e99fb569867318a227ef4c06ba"
"checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7"
......
......@@ -5,8 +5,7 @@ authors = ["jD91mZM2 <me@krake.one>"]
edition = "2018"
[dependencies]
# gdb-remote-protocol = { git = "https://github.com/luser/rust-gdb-remote-protocol", rev = "3e2f7c7204f85781f8b37d601217b05935547a7f" }
gdb-remote-protocol = { path = "../external/rust-gdb-remote-protocol/" }
gdb-remote-protocol = { git = "https://github.com/luser/rust-gdb-remote-protocol", rev = "565ab0c0ac189c82b0e7df217860599fc1ae6287" }
structopt = "0.2.18"
memchr = "2.2.1"
libc = "0.2.62"
/minimal-asm
/minimal-c
all: minimal-asm minimal-c
clean:
rm minimal-asm minimal-c
minimal-asm.o: minimal.asm
nix-shell -p nasm --run "nasm -f elf64 minimal.asm -g -o minimal-asm.o"
minimal-asm: minimal-asm.o
ld minimal-asm.o -o minimal-asm
rm minimal-asm.o
minimal-c: minimal.c
nix-shell -p musl --run "musl-gcc -g -static minimal.c -o minimal-c"
;; Compile with:
;; nasm -f elf64 test.asm -g && ld test.o && ./a.out
global _start
section .data
......
// Compile with: musl-gcc -static -g test.c
#include <stdio.h>
int main() {
......
......@@ -13,5 +13,5 @@ let
"$@"
'';
in pkgs.mkShell {
nativeBuildInputs = [ gdb-init gdb-test pkgs.musl ];
nativeBuildInputs = [ gdb-init gdb-test ];
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment