Compare commits
1 Commits
1571c52012
...
0f628b6518
Author | SHA1 | Date | |
---|---|---|---|
0f628b6518 |
2
Makefile
2
Makefile
@ -19,7 +19,7 @@ asan:
|
|||||||
make -rRf make/asan.mk all
|
make -rRf make/asan.mk all
|
||||||
|
|
||||||
msan:
|
msan:
|
||||||
make -rRf make/msan.mk all
|
make -rRf make/asan.mk all
|
||||||
|
|
||||||
validate: asan msan debug
|
validate: asan msan debug
|
||||||
./validate.sh
|
./validate.sh
|
||||||
|
@ -1,29 +0,0 @@
|
|||||||
# Building
|
|
||||||
|
|
||||||
To build oas in the default configuration you just need (gnu) make and a
|
|
||||||
sufficiently modern clang.
|
|
||||||
|
|
||||||
```
|
|
||||||
make
|
|
||||||
```
|
|
||||||
|
|
||||||
## Make targets
|
|
||||||
|
|
||||||
There are a number of make targets available to build various instrumented
|
|
||||||
builds that are used in validation, analysis and sanitizing. Some of these may
|
|
||||||
require extra dependencies.
|
|
||||||
|
|
||||||
|
|
||||||
- `debug`: Creates the debug build in `build/debug`. This is the default target.
|
|
||||||
- `all`: Builds all binary executable targets. These are
|
|
||||||
`debug`, `release`, `msan`, `asan` and `afl`. All executables can be found
|
|
||||||
in `build/` in a subdirectory matching their target names.
|
|
||||||
- `release`: Creates the release build in `build/release`
|
|
||||||
- `afl`: Creates a build with AFL++ instrumentation for fuzzing
|
|
||||||
- `fuzz`: Starts the fuzzer with the instrumented afl executable
|
|
||||||
- `asan`: builds with the address and undefined clang sanitizers
|
|
||||||
- `msan`: builds with the memory clang sanitizer
|
|
||||||
- `validate`: Builds `debug`, `msan`, and `asan` targets, then runs the
|
|
||||||
validation script. This script executes the sanitizer targets and runs
|
|
||||||
Valgrind on the debug target across multiple modes and test input files.
|
|
||||||
|
|
@ -2,7 +2,7 @@ BUILD_DIR=build/analyze/
|
|||||||
-include make/base.mk
|
-include make/base.mk
|
||||||
|
|
||||||
analyze:
|
analyze:
|
||||||
mkdir -p reports/static-analysis
|
mkdir z-p reports/static-analysis
|
||||||
scan-build -o reports/static-analysis/ -plist-html --status-bugs make -rRf make/analyze.mk all
|
scan-build -o reports/static-analysis/ -plist-html --status-bugs make -rRf make/analyze.mk all
|
||||||
|
|
||||||
distclean: clean
|
distclean: clean
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
CFLAGS=-Wall -Wextra -Wpedantic -O0 -g3 -std=c23 -fno-omit-frame-pointer -fno-optimize-sibling-calls -D_POSIX_C_SOURCE=200809L -fsanitize=address,undefined
|
CFLAGS=-Wall -Wextra -Wpedantic -O0 -g3 -std=c23 -fno-omit-frame-pointer -fno-optimize-sibling-calls -D_POSIX_C_SOURCE=200809L -fsanitize=address,undefined
|
||||||
LDFLAGS=-fsanitize=address,undefined
|
LDFLAGS=-fsanitize=address,undefined
|
||||||
BUILD_DIR=build/asan/
|
BUILD_DIR=build/msan/
|
||||||
|
|
||||||
-include make/base.mk
|
-include make/base.mk
|
||||||
|
@ -24,4 +24,4 @@ $(BUILD_DIR)%.o: %.c
|
|||||||
-include $(DEPENDENCIES)
|
-include $(DEPENDENCIES)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf $(BUILD_DIR)
|
rm -f $(BUILD_DIR)$(TARGET) $(OBJECTS)
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
CC?=clang
|
||||||
|
LD?=clang
|
||||||
CFLAGS?=-Wall -Wextra -Wpedantic -O2 -std=c23 -flto -fomit-frame-pointer -DNDEBUG -D_POSIX_C_SOURCE=200809L
|
CFLAGS?=-Wall -Wextra -Wpedantic -O2 -std=c23 -flto -fomit-frame-pointer -DNDEBUG -D_POSIX_C_SOURCE=200809L
|
||||||
LDFLAGS?=-flto -s -Wl,--gc-sections
|
LDFLAGS?=-flto -s -Wl,--gc-sections
|
||||||
BUILD_DIR?=build/release/
|
BUILD_DIR?=build/release/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user