Skip to content

Commit c1eef33

Browse files
authored
Remove --release from Makefile.toml (#1522)
* rem release * Revert "rem release" This reverts commit 13aaf13. * toggle it with envvar * fm
1 parent dc7d561 commit c1eef33

File tree

29 files changed

+191
-163
lines changed

29 files changed

+191
-163
lines changed

fuzzers/baby_fuzzer_swap_differential/Makefile.toml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,24 @@
33
FUZZER_NAME='fuzzer_sd'
44
PROJECT_DIR = { script = ["pwd"] }
55
CARGO_TARGET_DIR = { value = "target", condition = { env_not_set = ["CARGO_TARGET_DIR"] } }
6-
LIBAFL_CC = '${CARGO_TARGET_DIR}/release/libafl_cc'
7-
FUZZER = '${CARGO_TARGET_DIR}/release/${FUZZER_NAME}'
6+
PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} }
7+
LIBAFL_CC = '${CARGO_TARGET_DIR}/${PROFILE}/libafl_cc'
8+
FUZZER = '${CARGO_TARGET_DIR}/${PROFILE}/${FUZZER_NAME}'
89

910
# Compilers
1011
[tasks.cc]
1112
command = "cargo"
12-
args = ["build" , "--release", "--bin", "libafl_cc"]
13+
args = ["build" , "--${PROFILE}", "--bin", "libafl_cc"]
1314

1415
# Harness
1516
[tasks.fuzzer]
1617
command = "cargo"
17-
args = ["build" , "--release", "--bin", "${FUZZER_NAME}"]
18+
args = ["build" , "--${PROFILE}", "--bin", "${FUZZER_NAME}"]
1819
dependencies = [ "cc" ]
1920

2021
# Run the fuzzer
2122
[tasks.run]
22-
command = "${CARGO_TARGET_DIR}/release/${FUZZER_NAME}"
23+
command = "${CARGO_TARGET_DIR}/${PROFILE}/${FUZZER_NAME}"
2324
dependencies = [ "fuzzer" ]
2425

2526
# Test
@@ -31,7 +32,7 @@ windows_alias = "unsupported"
3132
[tasks.test_unix]
3233
script_runner = "@shell"
3334
script='''
34-
timeout 10s ${CARGO_TARGET_DIR}/release/${FUZZER_NAME} >fuzz_stdout.log || true
35+
timeout 10s ${CARGO_TARGET_DIR}/${PROFILE}/${FUZZER_NAME} >fuzz_stdout.log || true
3536
if [ -z "$(grep "objectives: 1" fuzz_stdout.log)" ]; then
3637
echo "Fuzzer does not generate any testcases or any crashes"
3738
exit 1

fuzzers/baby_no_std/Makefile.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[env]
22
FUZZER_NAME="fuzzer"
33
PROJECT_DIR = { script = ["pwd"] }
4+
PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} }
45

56
[tasks.unsupported]
67
script_runner="@shell"
@@ -11,7 +12,7 @@ echo "Cargo-make not integrated yet on this"
1112
# Fuzzer
1213
[tasks.build]
1314
command = "cargo"
14-
args = ["build", "--release", "-Zbuild-std=core,alloc", "--target", "x86_64-unknown-linux-gnu"]
15+
args = ["build", "--${PROFILE}", "-Zbuild-std=core,alloc", "--target", "x86_64-unknown-linux-gnu"]
1516

1617
# Test
1718
[tasks.test]
@@ -26,7 +27,7 @@ cargo run -Zbuild-std=core,alloc --target x86_64-unknown-linux-gnu || true
2627
dependencies = ["build"]
2728

2829
[tasks.build_aarch]
29-
script = "cargo +nightly build -Zbuild-std=core,alloc --target aarch64-unknown-none -v --release"
30+
script = "cargo +nightly build -Zbuild-std=core,alloc --target aarch64-unknown-none -v --${PROFILE}"
3031

3132
# Clean
3233
[tasks.clean]

fuzzers/forkserver_libafl_cc/Makefile.toml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
[env]
33
FUZZER_NAME='fuzzer_libafl_cc'
44
CARGO_TARGET_DIR = { value = "${PROJECT_DIR}/target", condition = { env_not_set = ["CARGO_TARGET_DIR"] } }
5-
LIBAFL_CC = '${CARGO_TARGET_DIR}/release/libafl_cc'
6-
LIBAFL_CXX = '${CARGO_TARGET_DIR}/release/libafl_cxx'
7-
FUZZER = '${CARGO_TARGET_DIR}/release/${FUZZER_NAME}'
5+
PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} }
6+
LIBAFL_CC = '${CARGO_TARGET_DIR}/${PROFILE}/libafl_cc'
7+
LIBAFL_CXX = '${CARGO_TARGET_DIR}/${PROFILE}/libafl_cxx'
8+
FUZZER = '${CARGO_TARGET_DIR}/${PROFILE}/${FUZZER_NAME}'
89
PROJECT_DIR = { script = ["pwd"] }
910

1011
[tasks.unsupported]
@@ -21,7 +22,7 @@ windows_alias = "unsupported"
2122

2223
[tasks.cxx_unix]
2324
command = "cargo"
24-
args = ["build" , "--release"]
25+
args = ["build" , "--${PROFILE}"]
2526

2627
[tasks.cc]
2728
linux_alias = "cc_unix"
@@ -30,7 +31,7 @@ windows_alias = "unsupported"
3031

3132
[tasks.cc_unix]
3233
command = "cargo"
33-
args = ["build" , "--release"]
34+
args = ["build" , "--${PROFILE}"]
3435

3536
[tasks.crash_cxx]
3637
linux_alias = "crash_cxx_unix"
@@ -39,7 +40,7 @@ windows_alias = "unsupported"
3940

4041
[tasks.crash_cxx_unix]
4142
command = "cargo"
42-
args = ["build" , "--release", "--features=crash"]
43+
args = ["build" , "--${PROFILE}", "--features=crash"]
4344

4445
[tasks.crash_cc]
4546
linux_alias = "crash_cc_unix"
@@ -48,7 +49,7 @@ windows_alias = "unsupported"
4849

4950
[tasks.crash_cc_unix]
5051
command = "cargo"
51-
args = ["build" , "--release", "--features=crash"]
52+
args = ["build" , "--${PROFILE}", "--features=crash"]
5253

5354
# Harness
5455
[tasks.fuzzer]
@@ -57,7 +58,7 @@ mac_alias = "fuzzer_unix"
5758
windows_alias = "unsupported"
5859

5960
[tasks.fuzzer_unix]
60-
command = "${CARGO_TARGET_DIR}/release/libafl_cc"
61+
command = "${CARGO_TARGET_DIR}/${PROFILE}/libafl_cc"
6162
args = ["${PROJECT_DIR}/src/program.c", "-o", "${FUZZER_NAME}", "-lm"]
6263
dependencies = [ "cxx", "cc" ]
6364

@@ -68,7 +69,7 @@ mac_alias = "fuzzer_crash_unix"
6869
windows_alias = "unsupported"
6970

7071
[tasks.fuzzer_crash_unix]
71-
command = "${CARGO_TARGET_DIR}/release/libafl_cc"
72+
command = "${CARGO_TARGET_DIR}/${PROFILE}/libafl_cc"
7273
args = ["${PROJECT_DIR}/src/program.c", "-o", "${FUZZER_NAME}_crash", "-lm"]
7374
dependencies = [ "crash_cxx", "crash_cc" ]
7475

@@ -81,7 +82,7 @@ windows_alias = "unsupported"
8182
[tasks.run_unix]
8283
script_runner = "@shell"
8384
script='''
84-
taskset -c 1 ${CARGO_TARGET_DIR}/release/${CARGO_MAKE_PROJECT_NAME} ./${FUZZER_NAME} ./corpus/ -t 1000
85+
taskset -c 1 ${CARGO_TARGET_DIR}/${PROFILE}/${CARGO_MAKE_PROJECT_NAME} ./${FUZZER_NAME} ./corpus/ -t 1000
8586
'''
8687
dependencies = [ "fuzzer" ]
8788

@@ -95,7 +96,7 @@ windows_alias = "unsupported"
9596
[tasks.crash_unix]
9697
script_runner = "@shell"
9798
script='''
98-
taskset -c 1 ${CARGO_TARGET_DIR}/release/${CARGO_MAKE_PROJECT_NAME} ./${FUZZER_NAME}_crash ./corpus/ -t 1000
99+
taskset -c 1 ${CARGO_TARGET_DIR}/${PROFILE}/${CARGO_MAKE_PROJECT_NAME} ./${FUZZER_NAME}_crash ./corpus/ -t 1000
99100
'''
100101
dependencies = [ "fuzzer_crash" ]
101102

fuzzers/frida_executable_libpng/Makefile.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Variables
22
[env]
33
CARGO_TARGET_DIR = { value = "target", condition = { env_not_set = ["CARGO_TARGET_DIR"] } }
4-
4+
PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} }
55

66
[tasks.unsupported]
77
script_runner="@shell"
@@ -61,7 +61,7 @@ windows_alias = "unsupported"
6161
[tasks.fuzzer_unix]
6262
script_runner="@shell"
6363
script='''
64-
cargo build --release
64+
cargo build --${PROFILE}
6565
'''
6666

6767
# Run the fuzzer
@@ -73,7 +73,7 @@ windows_alias = "unsupported"
7373
[tasks.run_unix]
7474
script_runner = "@shell"
7575
script='''
76-
LD_PRELOAD=$CARGO_TARGET_DIR/release/libfrida_executable_fuzzer.so ./libpng-harness -i corpus -o out -H ./libpng-harness
76+
LD_PRELOAD=$CARGO_TARGET_DIR/${PROFILE}/libfrida_executable_fuzzer.so ./libpng-harness -i corpus -o out -H ./libpng-harness
7777
'''
7878
dependencies = [ "fuzzer", "harness" ]
7979

@@ -87,7 +87,7 @@ windows_alias = "unsupported"
8787
script_runner = "@shell"
8888
script='''
8989
rm -rf libafl_unix_shmem_server || true
90-
LD_PRELOAD=$CARGO_TARGET_DIR/release/libfrida_executable_fuzzer.so ./libpng-harness -i corpus -o out -H ./libpng-harness > fuzz_stdout.log &
90+
LD_PRELOAD=$CARGO_TARGET_DIR/${PROFILE}/libfrida_executable_fuzzer.so ./libpng-harness -i corpus -o out -H ./libpng-harness > fuzz_stdout.log &
9191
sleep 10s && pkill libpng-harness
9292
if [ -z "$(grep "corpus: 30" fuzz_stdout.log)" ]; then
9393
echo "Fuzzer does not generate any testcases or any crashes"

fuzzers/frida_gdiplus/Makefile.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
[env]
33
CARGO_TARGET_DIR = { value = "target", condition = { env_not_set = ["CARGO_TARGET_DIR"] } }
44
FUZZER_NAME={ source = "${CARGO_MAKE_RUST_TARGET_OS}", default_value = "frida_gdiplus", mapping = {"linux" = "frida_gdiplus", "macos" = "frida_gdiplus", "windows" = "frida_gdiplus.exe"} }
5-
5+
PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} }
66

77
[tasks.unsupported]
88
script_runner="@shell"
@@ -32,8 +32,8 @@ windows_alias = "fuzzer_windows"
3232
[tasks.fuzzer_windows]
3333
script_runner="@shell"
3434
script='''
35-
cargo build --release
36-
cp ./target/release/${FUZZER_NAME} .
35+
cargo build --${PROFILE}
36+
cp ./target/${PROFILE}/${FUZZER_NAME} .
3737
'''
3838

3939
# Run the fuzzer

fuzzers/frida_libpng/Makefile.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
[env]
33
CARGO_TARGET_DIR = { value = "target", condition = { env_not_set = ["CARGO_TARGET_DIR"] } }
44
FUZZER_NAME={ source = "${CARGO_MAKE_RUST_TARGET_OS}", default_value = "frida_fuzzer", mapping = {"linux" = "frida_fuzzer", "macos" = "frida_fuzzer", "windows" = "frida_fuzzer.exe"} }
5-
5+
PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} }
66

77
[tasks.unsupported]
88
script_runner="@shell"
@@ -68,15 +68,15 @@ windows_alias = "fuzzer_windows"
6868
[tasks.fuzzer_unix]
6969
script_runner="@shell"
7070
script='''
71-
cargo build --release
72-
cp ${CARGO_TARGET_DIR}/release/${FUZZER_NAME} .
71+
cargo build --${PROFILE}
72+
cp ${CARGO_TARGET_DIR}/${PROFILE}/${FUZZER_NAME} .
7373
'''
7474

7575
[tasks.fuzzer_windows]
7676
script_runner="@shell"
7777
script='''
78-
cargo build --release
79-
cp ./target/release/${FUZZER_NAME} .
78+
cargo build --${PROFILE}
79+
cp ./target/${PROFILE}/${FUZZER_NAME} .
8080
'''
8181

8282
# Run the fuzzer

fuzzers/fuzzbench/Makefile.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
PROJECT_DIR = { script = ["pwd"] }
33
CARGO_TARGET_DIR = { value = "${PROJECT_DIR}/target", condition = { env_not_set = ["CARGO_TARGET_DIR"] } }
44
FUZZER_NAME="fuzzer"
5+
PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} }
56

67
[tasks.unsupported]
78
script_runner="@shell"
@@ -17,7 +18,7 @@ windows_alias = "unsupported"
1718

1819
[tasks.cxx_unix]
1920
command = "cargo"
20-
args = ["build" , "--release"]
21+
args = ["build" , "--${PROFILE}"]
2122

2223
[tasks.cc]
2324
linux_alias = "cc_unix"
@@ -26,7 +27,7 @@ windows_alias = "unsupported"
2627

2728
[tasks.cc_unix]
2829
command = "cargo"
29-
args = ["build" , "--release"]
30+
args = ["build" , "--${PROFILE}"]
3031

3132
# fuzz.o File
3233
[tasks.fuzz_o]
@@ -35,7 +36,7 @@ mac_alias = "fuzz_o_unix"
3536
windows_alias = "unsupported"
3637

3738
[tasks.fuzz_o_unix]
38-
command = "${CARGO_TARGET_DIR}/release/libafl_cc"
39+
command = "${CARGO_TARGET_DIR}/${PROFILE}/libafl_cc"
3940
args = ["--libafl-no-link", "-O3", "-c", "fuzz.c", "-o", "fuzz.o"]
4041
dependencies = ["cc", "cxx"]
4142

@@ -46,7 +47,7 @@ mac_alias = "fuzzer_unix"
4647
windows_alias = "unsupported"
4748

4849
[tasks.fuzzer_unix]
49-
command = "${CARGO_TARGET_DIR}/release/libafl_cxx"
50+
command = "${CARGO_TARGET_DIR}/${PROFILE}/libafl_cxx"
5051
args = ["--libafl", "fuzz.o", "-o", "${FUZZER_NAME}", "-lm", "-lz"]
5152
dependencies = ["cc", "cxx", "fuzz_o"]
5253

fuzzers/fuzzbench_fork_qemu/Makefile.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
[env]
33
FUZZER_NAME='libpng_harness'
44
PROJECT_DIR = { script = ["pwd"] }
5+
PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} }
56

67
[tasks.unsupported]
78
script_runner="@shell"
@@ -31,7 +32,7 @@ windows_alias = "unsupported"
3132

3233
[tasks.fuzzer_unix]
3334
command = "cargo"
34-
args = ["build", "--release"]
35+
args = ["build", "--${PROFILE}"]
3536

3637
# Harness
3738
[tasks.harness]
@@ -65,7 +66,7 @@ windows_alias = "unsupported"
6566

6667
[tasks.run_unix]
6768
command = "cargo"
68-
args = ["run", "--release", "./${FUZZER_NAME}", "--", "--libafl-in", "../libfuzzer_libpng/corpus", "--libafl-out", "./out", "./${FUZZER_NAME}"]
69+
args = ["run", "--${PROFILE}", "./${FUZZER_NAME}", "--", "--libafl-in", "../libfuzzer_libpng/corpus", "--libafl-out", "./out", "./${FUZZER_NAME}"]
6970
dependencies = [ "harness", "fuzzer" ]
7071

7172
# Run the fuzzer

fuzzers/fuzzbench_qemu/Makefile.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
[env]
33
FUZZER_NAME='libpng_harness'
44
PROJECT_DIR = { script = ["pwd"] }
5+
PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} }
56

67
[tasks.unsupported]
78
script_runner="@shell"
@@ -31,7 +32,7 @@ windows_alias = "unsupported"
3132

3233
[tasks.fuzzer_unix]
3334
command = "cargo"
34-
args = ["build", "--release"]
35+
args = ["build", "--${PROFILE}"]
3536

3637
# Harness
3738
[tasks.harness]
@@ -65,7 +66,7 @@ windows_alias = "unsupported"
6566

6667
[tasks.run_unix]
6768
command = "cargo"
68-
args = ["run", "--release", "./${FUZZER_NAME}", "--", "--libafl-in", "../libfuzzer_libpng/corpus", "--libafl-out", "./out", "./${FUZZER_NAME}"]
69+
args = ["run", "--${PROFILE}", "./${FUZZER_NAME}", "--", "--libafl-in", "../libfuzzer_libpng/corpus", "--libafl-out", "./out", "./${FUZZER_NAME}"]
6970
dependencies = [ "harness", "fuzzer" ]
7071

7172
# Run the fuzzer

fuzzers/fuzzbench_text/Makefile.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
PROJECT_DIR = { script = ["pwd"] }
33
CARGO_TARGET_DIR = { value = "${PROJECT_DIR}/target", condition = { env_not_set = ["CARGO_TARGET_DIR"] } }
44
FUZZER_NAME="fuzzer"
5+
PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} }
56

67
[tasks.unsupported]
78
script_runner="@shell"
@@ -17,7 +18,7 @@ windows_alias = "unsupported"
1718

1819
[tasks.cxx_unix]
1920
command = "cargo"
20-
args = ["build" , "--release"]
21+
args = ["build" , "--${PROFILE}"]
2122

2223
[tasks.cc]
2324
linux_alias = "cc_unix"
@@ -26,7 +27,7 @@ windows_alias = "unsupported"
2627

2728
[tasks.cc_unix]
2829
command = "cargo"
29-
args = ["build" , "--release"]
30+
args = ["build" , "--${PROFILE}"]
3031

3132
# fuzz.o File
3233
[tasks.fuzz_o]
@@ -35,7 +36,7 @@ mac_alias = "fuzz_o_unix"
3536
windows_alias = "unsupported"
3637

3738
[tasks.fuzz_o_unix]
38-
command = "${CARGO_TARGET_DIR}/release/libafl_cc"
39+
command = "${CARGO_TARGET_DIR}/${PROFILE}/libafl_cc"
3940
args = ["--libafl-no-link", "-O3", "-c", "fuzz.c", "-o", "fuzz.o"]
4041
dependencies = ["cc", "cxx"]
4142

@@ -46,7 +47,7 @@ mac_alias = "fuzzer_unix"
4647
windows_alias = "unsupported"
4748

4849
[tasks.fuzzer_unix]
49-
command = "${CARGO_TARGET_DIR}/release/libafl_cxx"
50+
command = "${CARGO_TARGET_DIR}/${PROFILE}/libafl_cxx"
5051
args = ["--libafl", "fuzz.o", "-o", "${FUZZER_NAME}", "-lm", "-lz"]
5152
dependencies = ["cc", "cxx", "fuzz_o"]
5253

0 commit comments

Comments
 (0)