Skip to content

Commit 0a86618

Browse files
s1341rmalmain
authored andcommitted
librasan: tiny fixes to make it build (#3065)
* librasan: tiny fixes to make it build * librasan: source -> .
1 parent 72562bf commit 0a86618

File tree

9 files changed

+91
-87
lines changed

9 files changed

+91
-87
lines changed

libafl_qemu/librasan/Justfile

+19-19
Original file line numberDiff line numberDiff line change
@@ -13,65 +13,65 @@ build: build_asan build_dummy build_fuzz build_gasan build_qasan build_runner bu
1313
test: test_asan
1414

1515
pretty_rust:
16-
#!/bin/bash
16+
#!/bin/sh
1717
MAIN_LLVM_VERSION=$LLVM_VERSION cargo run --manifest-path ../../utils/libafl_fmt/Cargo.toml --release -- -v
1818

1919
pretty_toml:
20-
#!/bin/bash
20+
#!/bin/sh
2121
taplo fmt
2222

2323
pretty: pretty_rust pretty_toml
2424

2525
fix: fix_asan fix_dummy fix_fuzz fix_gasan fix_qasan fix_runner fix_zasan
2626

2727
clippy:
28-
#!/bin/bash
28+
#!/bin/sh
2929
cargo clippy
3030

3131
doc:
32-
#!/bin/bash
32+
#!/bin/sh
3333
cargo doc
3434

3535
all: fix pretty build test clippy doc
3636

3737
build_arm_dev:
38-
#!/bin/bash
38+
#!/bin/sh
3939
ARCH=arm PROFILE=dev just build
4040

4141
build_aarch64_dev:
42-
#!/bin/bash
42+
#!/bin/sh
4343
ARCH=aarch64 PROFILE=dev just build
4444

4545
build_x86_64_dev:
46-
#!/bin/bash
46+
#!/bin/sh
4747
ARCH=x86_64 PROFILE=dev just build
4848

4949
build_i386_dev:
50-
#!/bin/bash
50+
#!/bin/sh
5151
ARCH=i386 PROFILE=dev just build
5252

5353
build_ppc_dev:
54-
#!/bin/bash
54+
#!/bin/sh
5555
ARCH=ppc PROFILE=dev just build
5656

5757
build_arm_release:
58-
#!/bin/bash
58+
#!/bin/sh
5959
ARCH=arm PROFILE=release just build
6060

6161
build_aarch64_release:
62-
#!/bin/bash
62+
#!/bin/sh
6363
ARCH=aarch64 PROFILE=release just build
6464

6565
build_x86_64_release:
66-
#!/bin/bash
66+
#!/bin/sh
6767
ARCH=x86_64 PROFILE=release just build
6868

6969
build_i386_release:
70-
#!/bin/bash
70+
#!/bin/sh
7171
ARCH=i386 PROFILE=release just build
7272

7373
build_ppc_release:
74-
#!/bin/bash
74+
#!/bin/sh
7575
ARCH=ppc PROFILE=release just build
7676

7777
build_everything_dev: \
@@ -91,39 +91,39 @@ build_everything_release: \
9191
build_everything: build_everything_dev build_everything_release
9292

9393
test_arm:
94-
#!/bin/bash
94+
#!/bin/sh
9595
ARCH=arm \
9696
PROFILE=dev \
9797
RUSTLOG=debug \
9898
RUST_BACKTRACE=full \
9999
just test
100100

101101
test_aarch64:
102-
#!/bin/bash
102+
#!/bin/sh
103103
ARCH=aarch64 \
104104
PROFILE=dev \
105105
RUSTLOG=debug \
106106
RUST_BACKTRACE=full \
107107
just test
108108

109109
test_x86_64:
110-
#!/bin/bash
110+
#!/bin/sh
111111
ARCH=x86_64 \
112112
PROFILE=dev \
113113
RUSTLOG=debug \
114114
RUST_BACKTRACE=full \
115115
just test
116116

117117
test_i386:
118-
#!/bin/bash
118+
#!/bin/sh
119119
ARCH=i386 \
120120
PROFILE=dev \
121121
RUSTLOG=debug \
122122
RUST_BACKTRACE=full \
123123
just test
124124

125125
test_ppc:
126-
#!/bin/bash
126+
#!/bin/sh
127127
ARCH=ppc \
128128
PROFILE=dev \
129129
RUSTLOG=debug \

libafl_qemu/librasan/asan/Justfile

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ ASAN_SOURCE_DIR := source_directory()
55

66
[unix]
77
compile_asan:
8-
#!/bin/bash
9-
source {{ DOTENV }}
8+
#!/bin/sh
9+
. {{ DOTENV }}
1010
cargo \
1111
+nightly \
1212
build \
@@ -17,8 +17,8 @@ compile_asan:
1717

1818
[unix]
1919
fix_asan:
20-
#!/bin/bash
21-
source {{ DOTENV }}
20+
#!/bin/sh
21+
. {{ DOTENV }}
2222
cargo \
2323
+nightly \
2424
fix \
@@ -30,8 +30,8 @@ fix_asan:
3030

3131
[unix]
3232
test_asan:
33-
#!/bin/bash
34-
source {{ DOTENV }}
33+
#!/bin/sh
34+
. {{ DOTENV }}
3535
cd {{ ASAN_SOURCE_DIR }}
3636
cargo \
3737
+nightly \

libafl_qemu/librasan/asan/build.rs

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ fn main() {
99

1010
cc::Build::new()
1111
.define("_GNU_SOURCE", None)
12+
.opt_level(3)
1213
.flag("-Werror")
1314
.flag("-fno-stack-protector")
1415
.flag("-ffunction-sections")
@@ -18,6 +19,7 @@ fn main() {
1819

1920
cc::Build::new()
2021
.define("_GNU_SOURCE", None)
22+
.opt_level(3)
2123
.flag("-Werror")
2224
.flag("-fno-stack-protector")
2325
.flag("-ffunction-sections")
@@ -27,6 +29,7 @@ fn main() {
2729

2830
cc::Build::new()
2931
.define("_GNU_SOURCE", None)
32+
.opt_level(3)
3033
.flag("-Werror")
3134
.flag("-fno-stack-protector")
3235
.flag("-ffunction-sections")
@@ -36,6 +39,7 @@ fn main() {
3639

3740
cc::Build::new()
3841
.define("_GNU_SOURCE", None)
42+
.opt_level(3)
3943
.flag("-Werror")
4044
.flag("-fno-stack-protector")
4145
.flag("-ffunction-sections")

libafl_qemu/librasan/dummy_libc/Justfile

+8-8
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ DUMMY_SOURCE_DIR := source_directory()
55

66
[unix]
77
compile_dummy:
8-
#!/bin/bash
9-
source {{ DOTENV }}
8+
#!/bin/sh
9+
. {{ DOTENV }}
1010
cargo \
1111
+nightly \
1212
build \
@@ -17,8 +17,8 @@ compile_dummy:
1717

1818
[unix]
1919
fix_dummy:
20-
#!/bin/bash
21-
source {{ DOTENV }}
20+
#!/bin/sh
21+
. {{ DOTENV }}
2222
cargo \
2323
+nightly \
2424
fix \
@@ -31,8 +31,8 @@ fix_dummy:
3131

3232
[unix]
3333
link_dummy: compile_dummy
34-
#!/bin/bash
35-
source {{ DOTENV }}
34+
#!/bin/sh
35+
. {{ DOTENV }}
3636
${CROSS_CC} \
3737
${LIBRASAN_CFLAGS} \
3838
-shared \
@@ -51,8 +51,8 @@ link_dummy: compile_dummy
5151

5252
[unix]
5353
strip_dummy: link_dummy
54-
#!/bin/bash
55-
source {{ DOTENV }}
54+
#!/bin/sh
55+
. {{ DOTENV }}
5656
${CROSS_STRIP} \
5757
--strip-unneeded \
5858
-o {{ TARGET_DIR }}/$CROSS_TARGET/{{ PROFILE_DIR }}/libdummy_libc.so \

libafl_qemu/librasan/fuzz/Justfile

+14-14
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ FUZZ_JOBS := if PROFILE == "dev" { "" } else { "-jobs=8" }
77

88
[unix]
99
build_fuzz:
10-
#!/bin/bash
11-
source {{ DOTENV }}
10+
#!/bin/sh
11+
. {{ DOTENV }}
1212
cargo \
1313
+nightly \
1414
build \
@@ -19,8 +19,8 @@ build_fuzz:
1919

2020
[unix]
2121
fix_fuzz:
22-
#!/bin/bash
23-
source {{ DOTENV }}
22+
#!/bin/sh
23+
. {{ DOTENV }}
2424
cargo \
2525
+nightly \
2626
fix \
@@ -32,8 +32,8 @@ fix_fuzz:
3232

3333
[unix]
3434
run_fuzz:
35-
#!/bin/bash
36-
source {{ DOTENV }}
35+
#!/bin/sh
36+
. {{ DOTENV }}
3737
cargo \
3838
+nightly \
3939
fuzz \
@@ -48,24 +48,24 @@ run_fuzz:
4848

4949
[unix]
5050
fuzz_guest_shadow:
51-
#!/bin/bash
52-
source {{ DOTENV }}
51+
#!/bin/sh
52+
. {{ DOTENV }}
5353
HARNESS=guest_shadow just run_fuzz
5454

5555
[unix]
5656
fuzz_guest_tracking:
57-
#!/bin/bash
58-
source {{ DOTENV }}
57+
#!/bin/sh
58+
. {{ DOTENV }}
5959
HARNESS=guest_tracking just run_fuzz
6060

6161
[unix]
6262
fuzz_default_frontend_mock:
63-
#!/bin/bash
64-
source {{ DOTENV }}
63+
#!/bin/sh
64+
. {{ DOTENV }}
6565
HARNESS=default_frontend_mock just run_fuzz
6666

6767
[unix]
6868
fuzz_default_frontend_dlmalloc:
69-
#!/bin/bash
70-
source {{ DOTENV }}
69+
#!/bin/sh
70+
. {{ DOTENV }}
7171
HARNESS=default_frontend_dlmalloc just run_fuzz

libafl_qemu/librasan/gasan/Justfile

+12-12
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ GASAN_SOURCE_DIR := source_directory()
66

77
[unix]
88
compile_gasan:
9-
#!/bin/bash
10-
source {{ DOTENV }}
9+
#!/bin/sh
10+
. {{ DOTENV }}
1111
cargo \
1212
+nightly \
1313
build \
@@ -18,8 +18,8 @@ compile_gasan:
1818

1919
[unix]
2020
fix_gasan:
21-
#!/bin/bash
22-
source {{ DOTENV }}
21+
#!/bin/sh
22+
. {{ DOTENV }}
2323
cargo \
2424
+nightly \
2525
fix \
@@ -32,8 +32,8 @@ fix_gasan:
3232

3333
[unix]
3434
rel_gasan: compile_gasan build_dummy
35-
#!/bin/bash
36-
source {{ DOTENV }}
35+
#!/bin/sh
36+
. {{ DOTENV }}
3737
${CROSS_CC} \
3838
${LIBRASAN_CFLAGS} \
3939
-r \
@@ -65,8 +65,8 @@ rel_gasan: compile_gasan build_dummy
6565

6666
[unix]
6767
rename_gasan: rel_gasan
68-
#!/bin/bash
69-
source {{ DOTENV }}
68+
#!/bin/sh
69+
. {{ DOTENV }}
7070
${CROSS_OBJCOPY} \
7171
--redefine-syms={{ GASAN_SOURCE_DIR }}/rename_real.syms \
7272
--redefine-syms={{ GASAN_SOURCE_DIR }}/rename_patch.syms \
@@ -75,8 +75,8 @@ rename_gasan: rel_gasan
7575

7676
[unix]
7777
link_gasan: rename_gasan
78-
#!/bin/bash
79-
source {{ DOTENV }}
78+
#!/bin/sh
79+
. {{ DOTENV }}
8080
${CROSS_CC} \
8181
-shared \
8282
-nodefaultlibs \
@@ -111,8 +111,8 @@ link_gasan: rename_gasan
111111
"-ldummy_libc" \
112112

113113
strip_gasan: link_gasan
114-
#!/bin/bash
115-
source {{ DOTENV }}
114+
#!/bin/sh
115+
. {{ DOTENV }}
116116
${CROSS_STRIP} \
117117
--strip-unneeded \
118118
-o {{ TARGET_DIR }}/$CROSS_TARGET/{{ PROFILE_DIR }}/libgasan.so \

0 commit comments

Comments
 (0)