-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathjustfile
More file actions
94 lines (76 loc) · 2.6 KB
/
justfile
File metadata and controls
94 lines (76 loc) · 2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
rust:
RUSTFLAGS="-C target-cpu=x86-64 -C target-feature=+crt-static -C link-arg=-nostartfiles -C link-arg=-nodefaultlibs -C link-arg=-Wl,--gc-sections" \
rustc --target x86_64-pc-windows-gnu \
--cfg 'feature="utils"' \
-C opt-level=z \
-C panic=abort \
-C debuginfo=0 \
-C strip=symbols \
-C codegen-units=1 \
-C embed-bitcode=no \
--emit=obj \
src/lib.rs -o objects/rust_part.o
rust-beacon_api:
RUSTFLAGS="-C target-cpu=x86-64 -C target-feature=+crt-static -C link-arg=-nostartfiles -C link-arg=-nodefaultlibs -C link-arg=-Wl,--gc-sections" \
rustc --target x86_64-pc-windows-gnu \
--cfg 'feature="utils"' \
--cfg 'feature="beacon_api"' \
-C opt-level=z \
-C panic=abort \
-C debuginfo=0 \
-C strip=symbols \
-C codegen-units=1 \
-C embed-bitcode=no \
--emit=obj \
src/lib.rs -o objects/rust_part.o
rust-alloc:
RUSTFLAGS="-C target-cpu=x86-64 -C target-feature=+crt-static -C link-arg=-nostartfiles -C link-arg=-nodefaultlibs -C link-arg=-Wl,--gc-sections" \
rustc --target x86_64-pc-windows-gnu \
--cfg 'feature="utils"' \
--cfg 'feature="alloc"' \
-C opt-level=z \
-C panic=abort \
-C debuginfo=0 \
-C strip=symbols \
-C codegen-units=1 \
-C embed-bitcode=no \
--emit=obj \
src/lib.rs -o objects/rust_part.o
rust-all:
RUSTFLAGS="-C target-cpu=x86-64 -C target-feature=+crt-static -C link-arg=-nostartfiles -C link-arg=-nodefaultlibs -C link-arg=-Wl,--gc-sections" \
rustc --target x86_64-pc-windows-gnu \
--cfg 'feature="utils"' \
--cfg 'feature="alloc"' \
--cfg 'feature="beacon_api"' \
-C opt-level=z \
-C panic=abort \
-C debuginfo=0 \
-C strip=symbols \
-C codegen-units=1 \
-C embed-bitcode=no \
--emit=obj \
src/lib.rs -o objects/rust_part.o
ld:
x86_64-w64-mingw32-ld -r objects/rust_part.o objects/c_part.o -o objects/combined.o
copy: ld
x86_64-w64-mingw32-objcopy \
--remove-section=.drectve \
--strip-symbol=@feat.00 \
--remove-section=.bss \
--strip-symbol=rust_begin_unwind \
--strip-debug \
objects/combined.o \
bof.o
c:
x86_64-w64-mingw32-gcc -c src/entry.c -o objects/c_part.o
c-utils:
x86_64-w64-mingw32-gcc -DUTILS -c src/entry.c -o objects/c_part.o
c-all:
x86_64-w64-mingw32-gcc -DUTILS -DBEACON_API -c src/entry.c -o objects/c_part.o
bof: bof-utils
bof-utils: rust c-utils copy view-bof
bof-beacon_api: rust-beacon_api c-all copy view-bof
bof-alloc: rust-alloc c-utils copy view-bof
bof-all: rust-all c-all copy view-bof
view-bof:
objdump -t bof.o