diff options
author | jonathanmetzman <31354670+jonathanmetzman@users.noreply.github.com> | 2019-05-13 15:01:25 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-13 15:01:25 -0700 |
commit | c60fcd7247da0505e3977b0725d795a96966b3db (patch) | |
tree | dd62fdd7f9f6f48b0c463bb2051c30d1c8f5ed10 /infra/helper.py | |
parent | 7b6c4674b96afd1dee79e2469075417570ae3776 (diff) | |
download | oss-fuzz-c60fcd7247da0505e3977b0725d795a96966b3db.tar.gz |
Add initial support for i386 builds (#2347)
This feature is not yet officially supported
Diffstat (limited to 'infra/helper.py')
-rwxr-xr-x | infra/helper.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/infra/helper.py b/infra/helper.py index bac3114a6..dcf87e8ee 100755 --- a/infra/helper.py +++ b/infra/helper.py @@ -78,6 +78,7 @@ def main(): build_fuzzers_parser = subparsers.add_parser( 'build_fuzzers', help='Build fuzzers for a project.') + _add_architecture_args(build_fuzzers_parser) _add_engine_args(build_fuzzers_parser) _add_sanitizer_args(build_fuzzers_parser) _add_environment_args(build_fuzzers_parser) @@ -95,6 +96,7 @@ def main(): check_build_parser = subparsers.add_parser( 'check_build', help='Checks that fuzzers execute without errors.') + _add_architecture_args(check_build_parser) _add_engine_args(check_build_parser, choices=['libfuzzer', 'afl']) _add_sanitizer_args( check_build_parser, choices=['address', 'memory', 'undefined']) @@ -149,6 +151,7 @@ def main(): shell_parser = subparsers.add_parser( 'shell', help='Run /bin/bash within the builder container.') shell_parser.add_argument('project_name', help='name of the project') + _add_architecture_args(shell_parser) _add_engine_args(shell_parser) _add_sanitizer_args(shell_parser) _add_environment_args(shell_parser) @@ -249,6 +252,11 @@ def _get_work_dir(project_name=''): return os.path.join(BUILD_DIR, 'work', project_name) +def _add_architecture_args(parser, choices=('x86_64', 'i386')): + """Add common architecture args.""" + parser.add_argument('--architecture', default='x86_64', choices=choices) + + def _add_engine_args( parser, choices=('libfuzzer', 'afl', 'honggfuzz', 'dataflow', 'none')): @@ -416,7 +424,8 @@ def build_fuzzers(args): env = [ 'FUZZING_ENGINE=' + args.engine, - 'SANITIZER=' + args.sanitizer + 'SANITIZER=' + args.sanitizer, + 'ARCHITECTURE=' + args.architecture ] if args.e: env += args.e |