Compare commits
2 Commits
0f628b6518
...
1571c52012
Author | SHA1 | Date | |
---|---|---|---|
1571c52012 | |||
0f9ced8eb1 |
2
Makefile
2
Makefile
@ -19,7 +19,7 @@ asan:
|
||||
make -rRf make/asan.mk all
|
||||
|
||||
msan:
|
||||
make -rRf make/asan.mk all
|
||||
make -rRf make/msan.mk all
|
||||
|
||||
validate: asan msan debug
|
||||
./validate.sh
|
||||
|
29
doc/BUILDING.md
Normal file
29
doc/BUILDING.md
Normal file
@ -0,0 +1,29 @@
|
||||
# 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
|
||||
|
||||
analyze:
|
||||
mkdir z-p reports/static-analysis
|
||||
mkdir -p reports/static-analysis
|
||||
scan-build -o reports/static-analysis/ -plist-html --status-bugs make -rRf make/analyze.mk all
|
||||
|
||||
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
|
||||
LDFLAGS=-fsanitize=address,undefined
|
||||
BUILD_DIR=build/msan/
|
||||
BUILD_DIR=build/asan/
|
||||
|
||||
-include make/base.mk
|
||||
|
@ -24,4 +24,4 @@ $(BUILD_DIR)%.o: %.c
|
||||
-include $(DEPENDENCIES)
|
||||
|
||||
clean:
|
||||
rm -f $(BUILD_DIR)$(TARGET) $(OBJECTS)
|
||||
rm -rf $(BUILD_DIR)
|
||||
|
@ -1,5 +1,3 @@
|
||||
CC?=clang
|
||||
LD?=clang
|
||||
CFLAGS?=-Wall -Wextra -Wpedantic -O2 -std=c23 -flto -fomit-frame-pointer -DNDEBUG -D_POSIX_C_SOURCE=200809L
|
||||
LDFLAGS?=-flto -s -Wl,--gc-sections
|
||||
BUILD_DIR?=build/release/
|
||||
|
Loading…
x
Reference in New Issue
Block a user