-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
214 changed files
with
3,057 additions
and
16,977 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Force the use of Clang for C++ builds. | ||
build --action_env=CC=clang | ||
build --action_env=CXX=clang++ | ||
|
||
# Define the --config=asan-libfuzzer configuration. | ||
build:asan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine=@rules_fuzzing//fuzzing/engines:libfuzzer | ||
build:asan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine_instrumentation=libfuzzer | ||
build:asan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine_sanitizer=asan | ||
|
||
# Define the --config=msan-libfuzzer configuration. | ||
build:msan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine=@rules_fuzzing//fuzzing/engines:libfuzzer | ||
build:msan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine_instrumentation=libfuzzer | ||
build:msan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine_sanitizer=msan | ||
|
||
# Define the --config=ubsan-libfuzzer configuration. | ||
build:ubsan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine=@rules_fuzzing//fuzzing/engines:libfuzzer | ||
build:ubsan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine_instrumentation=libfuzzer | ||
build:ubsan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine_sanitizer=ubsan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1 @@ | ||
*.o | ||
*.so | ||
*.a | ||
*.ncb | ||
*.plg | ||
*.aps | ||
*.opt | ||
*.aac | ||
*.wav | ||
*.lo | ||
*.in | ||
Makefile | ||
*.libs | ||
*.deps | ||
*.la | ||
project/msvc/.vs/ | ||
project/msvc/bin/ | ||
project/msvc/intermediate/ | ||
#libfaad/win32_ver.h | ||
*.user | ||
/libfaad/faad2.pc | ||
bazel-* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
load("@rules_fuzzing//fuzzing:cc_defs.bzl", "cc_fuzz_test") | ||
load("@properties//:properties.bzl", "PROPERTIES") | ||
|
||
# Unless building for embedded systems all headers / functions should exist. | ||
FAAD_DEFINES = [ | ||
"APPLY_DRC", | ||
"HAVE_INTTYPES_H=1", | ||
"HAVE_MEMCPY=1", | ||
"HAVE_STRING_H=1", | ||
"HAVE_STRINGS_H=1", | ||
"HAVE_SYS_STAT_H=1", | ||
"HAVE_SYS_TYPES_H=1", | ||
"STDC_HEADERS=1", | ||
"PACKAGE_VERSION=\\\"%s\\\"" % PROPERTIES["PACKAGE_VERSION"], | ||
] | ||
|
||
FAAD_SOURCES = glob([ | ||
"libfaad/**/*.c", | ||
"libfaad/**/*.h", | ||
]) | ||
|
||
FAAD_FLAGS = [ | ||
"-Wall", | ||
"-pedantic", | ||
] | ||
|
||
DRM_AFFIX = [ | ||
"", | ||
"_drm", | ||
] | ||
|
||
DRM_DEFINES = [ | ||
[], | ||
["DRM_SUPPORT"], | ||
] | ||
|
||
FIXED_AFFIX = [ | ||
"", | ||
"_fixed", | ||
] | ||
|
||
FIXED_DEFINES = [ | ||
[], | ||
["FIXED_POINT"], | ||
] | ||
|
||
[cc_library( | ||
name = "faad" + DRM_AFFIX[drm] + FIXED_AFFIX[fixed], | ||
srcs = FAAD_SOURCES, | ||
hdrs = ["include/neaacdec.h"], | ||
copts = FAAD_FLAGS, | ||
includes = ["libfaad"], | ||
local_defines = FAAD_DEFINES + DRM_DEFINES[drm] + FIXED_DEFINES[fixed], | ||
strip_include_prefix = "include", | ||
) for drm in range(2) for fixed in range(2)] | ||
|
||
# To start fuzzing run: bazel run --config=asan-libfuzzer //:fuzz_config_run | ||
cc_fuzz_test( | ||
name = "fuzz_config", | ||
srcs = ["fuzz/fuzz_config.c"], | ||
deps = [":faad"], | ||
) | ||
|
||
# To start fuzzing run: bazel run --config=asan-libfuzzer //:fuzz_decode_run | ||
[cc_fuzz_test( | ||
name = "fuzz_decode" + DRM_AFFIX[drm] + FIXED_AFFIX[fixed], | ||
srcs = ["fuzz/fuzz_decode.c"], | ||
local_defines = DRM_DEFINES[drm], | ||
deps = [":faad" + DRM_AFFIX[drm] + FIXED_AFFIX[fixed]], | ||
) for drm in range(2) for fixed in range(2)] | ||
|
||
CLI_SOURCES = glob(["frontend/**/*.c", "frontend/**/*.h"], exclude = ["frontend/**/getopt.*"]) | ||
|
||
[cc_binary( | ||
name = "faad_cli" + DRM_AFFIX[drm] + FIXED_AFFIX[fixed], | ||
srcs = CLI_SOURCES, | ||
includes = ["frontend"], | ||
local_defines = FAAD_DEFINES + DRM_DEFINES[drm] + FIXED_DEFINES[fixed], | ||
deps = [":faad" + DRM_AFFIX[drm] + FIXED_AFFIX[fixed]], | ||
) for drm in range(2) for fixed in range(2)] |
Oops, something went wrong.