Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
asn1c
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
asn1c
Commits
387a8f01
Commit
387a8f01
authored
Sep 15, 2017
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
draft fuzzer infrastructure
parent
b5cdc5d2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
3 deletions
+40
-3
configure.ac
configure.ac
+1
-1
tests/tests-c-compiler/check-assembly.sh
tests/tests-c-compiler/check-assembly.sh
+39
-2
No files found.
configure.ac
View file @
387a8f01
...
...
@@ -164,7 +164,7 @@ AC_ARG_ENABLE([test-fuzzer],
[enable_test_fuzzer=$enableval], [enable_test_fuzzer=no])
AS_IF([test "x$enable_test_fuzzer" != xno], [
AX_CHECK_COMPILE_FLAG([-fsanitize=fuzzer],
[LIBFUZZER_CFLAGS="${FUZZER_CFLAGS} -fsanitize=fuzzer"],
[LIBFUZZER_CFLAGS="${FUZZER_CFLAGS} -fsanitize=fuzzer
-DENABLE_LIBFUZZER
"],
[
AC_MSG_FAILURE(
[--enable-test-fuzzer=$enable_test_fuzzer is not supported on a target system.
...
...
tests/tests-c-compiler/check-assembly.sh
View file @
387a8f01
...
...
@@ -39,6 +39,7 @@ if [ ! "$has_per" ]; then
fi
args
=
$(
echo
"
$source_short
"
|
sed
-E
-e
's/\.c+$//'
)
source_obj
=
$(
echo
"
$source_short
"
|
sed
-E
-e
's/\.c+$/.o/'
)
OFS
=
$IFS
IFS
=
"."
...
...
@@ -57,6 +58,13 @@ touch "${testdir}-FAILED"
mkdir
-p
"
${
testdir
}
"
ln
-fns
"../
${
source_full
}
"
"
${
testdir
}
"
if
test
"
${
LIBFUZZER_CFLAGS
}
"
&&
grep
LLVMFuzzer
${
source_full
}
>
/dev/null
;
then
MAKE_FUZZER
=
yes
else
MAKE_FUZZER
=
no
fi
asn_module
=
$(
echo
"
${
abs_top_srcdir
}
/tests/tests-asn1c-compiler/
${
testno
}
"
-
*
.asn1
)
AUTOGENERATED
=
"# This file is autogenerated by
$0
${
source_full
}
${
AFLAGS
}
"
...
...
@@ -69,6 +77,7 @@ COMMON_FLAGS= -I.
CFLAGS =
\$
{COMMON_FLAGS}
${
CFLAGS
:-}
-g -O1
CFLAGS += -DSRCDIR=../
${
srcdir
}
${
CODECS_FLAGS
}
CXXFLAGS =
\$
{CFLAGS}
${
CXXFLAGS
}
LIBFUZZER_CFLAGS =
${
LIBFUZZER_CFLAGS
}
LDFLAGS =
${
LDFLAGS
:-}
CC ?=
${
CC
}
...
...
@@ -90,10 +99,34 @@ compiled-module: ${asn_module} ${abs_top_builddir}/asn1c/asn1c
rm -f converter-sample.c
@touch compiled-module
TARGETS
if
[
"
${
MAKE_FUZZER
}
"
!=
"yes"
]
;
then
CHECK_FUZZER
=
": # No fuzzer defined"
cat
<<
TARGETS
>> "
${
testdir
}
/Makefile.targets"
.PHONY check-fuzzer:
check-fuzzer:
TARGETS
else
CHECK_FUZZER
=
"./check-fuzzer -timeout=3 -max_total_time=60 -max-len 512 -detect_leaks=1"
cat
<<
TARGETS
>> "
${
testdir
}
/Makefile.targets"
check-fuzzer:
\$
(OBJS)
rm -f
${
source_obj
}
\$
(CC)
\$
(CFLAGS)
\$
(LIBFUZZER_CFLAGS) -c -o
${
source_obj
}
${
source_short
}
\$
(CC)
\$
(CFLAGS)
\$
(LIBFUZZER_CFLAGS)
\$
(LDFLAGS) -o check-fuzzer
\$
(OBJS)
rm -f
${
source_obj
}
TARGETS
fi
cat
<<
TARGETS
>> "
${
testdir
}
/Makefile.targets"
check-succeeded: compiled-module
\$
(MAKE) check-executable
\$
(MAKE) check-fuzzer
@rm -f check-succeeded
./check-executable
${
CHECK_FUZZER
}
@touch check-succeeded
check: check-succeeded
...
...
@@ -112,14 +145,18 @@ produce_specific_makefile() {
${
AUTOGENERATED
}
SRCS_C!=find . -name
\*
.c
SRCS_CXX!=find . -name
\*
.cc
SRCS=
\$
(SRCS_C)
\$
(SRCS_CXX)
OBJS=
\$
{SRCS_C:.c=.o}
${
SRCS_CXX
:.cc
=.o
}
.sinclude <Makefile.targets>
OBJECTS
else
cat
<<-
OBJECTS
>
${
make_file
}
${
AUTOGENERATED
}
OBJS =
\$
(patsubst %.c,%.o,
\$
(wildcard *.c))
OBJS+=
\$
(patsubst %.cc,%.o,
\$
(wildcard *.cc))
SRCS_C :=
\$
(wildcard *.c)
SRCS_CXX :=
\$
(wildcard *.cc)
SRCS =
\$
(SRCS_C)
\$
(SRCS_CXX)
OBJS =
\$
(patsubst %.c,%.o,
\$
(SRCS_C))
OBJS+=
\$
(patsubst %.cc,%.o,
\$
(SRCS_CXX))
-include Makefile.targets
OBJECTS
fi
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment