Commit Graph

89 Commits

Author SHA1 Message Date
Alessandro Di Federico 6347ef5ba5 scripts/revng: --verbose reports all commands
Previously, we were reporting only those going though `wrap`.
2021-02-24 13:05:57 +01:00
Alessandro Di Federico 27b58695a1 Let FunctionIsolation and EnforceABI use the Model 2021-02-19 09:39:49 +01:00
Alessandro Di Federico 3f0e715b98 Decrease verbosity of tests 2021-02-19 09:39:49 +01:00
Alessandro Di Federico a314fd61ef Import revng-dump-model 2021-02-18 18:46:49 +01:00
Alessandro Di Federico 0ab1b786b6 check-revng-conventions: static in C headers is OK 2021-02-18 18:44:42 +01:00
Filippo Cremonese f05f785023 Fix revng_merge_dynamic installation
This commit also substantially reorganizes the root CMakeLists.txt.
2021-02-10 00:00:38 +01:00
Alessandro Di Federico a655507a0c Use relative paths during builds 2021-01-27 19:46:53 +01:00
Filippo Cremonese c5680b2120 Refactor revng-merge-dynamic
Notable changes:

- Split in multiple files the existing revng-merge-dynamic script
- Add the option to merge additional LOAD segments in the resulting
  binary
- Align the new .dynstr to a 4 byte boundary
- Ensure the last verneed entry is marked as such (vn_next == 0)
- Ensure LOAD PHDRs are listed in ascending order,
  as mandated by ELF spec
2021-01-23 00:41:52 +01:00
Alessandro Di Federico 8549844d36 Set BaseAddress to 0x400000 by default 2021-01-06 17:40:56 +01:00
Alessandro Di Federico 28432e30c1 Disable HARD_FLAGS_* when invoking linker
This commit is necessary in order to avoid using the compiler wrapper
provided by orchestra when developing.
2021-01-06 14:40:27 +01:00
Alessandro Di Federico 3c58c7441b Whitespace changes 2020-12-29 16:14:49 +01:00
Pietro Fezzardi d37aed928e Run check-revng-conventions from outside git dirs
This enables running the check-revng-conventions script as part of the
build and install process, to generate the .clang-format file for
installation and use from other projects.
2020-12-29 16:14:45 +01:00
Pietro Fezzardi 86fcff5db4 check-revng-conventions: improve help 2020-12-29 15:43:34 +01:00
Pietro Fezzardi 13a893e91f check-revng-conventions prints errors on more opts
Options with only a single leading dash were previously recognized as
filenames.
Now they are recognized as options.
2020-12-29 15:43:34 +01:00
Pietro Fezzardi 01118920b0 Add check-revng-conventions option to print config
This option is enabled with --print-clang-format-config.
This is useful to work around the fact that clang-format configuration
is hard-coded in a file.
Using this option is easier to generate a .clang-format file that can be
dropped in single projects to be picked up by IDE.
2020-12-29 15:43:34 +01:00
Pietro Fezzardi 4b4e791afe Add missing option to check-revng-conventions help 2020-12-29 15:43:34 +01:00
Pietro Fezzardi cb2c3c610f Add --help flag to check-revng-conventions 2020-12-29 15:43:32 +01:00
Alessandro Di Federico dab8a2dfae Install clang-format-style-file 2020-11-20 18:06:16 +01:00
Pietro Fezzardi e79dcaf780 check-revng-conventions: enforce #pragma once 2020-11-13 14:12:18 +01:00
Pietro Fezzardi 9869f057b9 Use #pragma once for header include guards 2020-11-13 14:12:18 +01:00
Pietro Fezzardi 1a09c00aa1 check-revng-conventions: regroup header includes 2020-11-13 10:00:27 +01:00
Pietro Fezzardi dc4ab84ad3 Move .clang-format to scripts/
The format file has also been renamed to revng-clang-format-style-file.

The check-revng-conventions scripts now always uses the same format
file, unless otherwise specified with the new option
--use-local-clang-format-file.

In this way, the check-revng-conventions uses the same format in all the
projects by default, but if a project needs to customize it (e.g.
cold-revng which follows the Qt style) it can use the new flag to
fallback to using the local .clang-format file.
2020-11-13 09:59:42 +01:00
Alessandro Di Federico 56b6797f8c scripts/revng: backport shlex.join 2020-11-12 16:21:32 +01:00
Alessandro Di Federico 864bcdc471 scripts/revng: add --lldb 2020-11-12 14:55:57 +01:00
Alessandro Di Federico c7e0361acf scripts/revng: handle empty ASAN_OPTIONS 2020-11-12 14:55:57 +01:00
Alessandro Di Federico 0b15c965ce scripts/revng: use subprocess.Popen directly
We used to use `subprocess.run`, but it's not supported in Pytnon 3.2
(Debian 7).
2020-11-10 10:04:31 +01:00
Alessandro Di Federico ea832c5063 script/revng: print command upon failure 2020-11-02 09:05:03 +01:00
Alessandro Di Federico d1ea87e536 revng-merge-dynamic: make Python 3 compatible
Wow, we no longer need Python 2.
2020-10-30 09:50:03 +01:00
Alessandro Di Federico a08d5a14e0 scripts/revng: fix matching libraries to link 2020-10-23 17:40:13 +02:00
Alessandro Di Federico 2e995fdaa7 Pretty print JSONs 2020-10-22 11:25:31 +02:00
Alessandro Di Federico 3a78fae441 Polyfill for shutil.which 2020-10-21 10:34:35 +02:00
Alessandro Di Federico 0e4c4aad59 Make --use-debug-symbols the default 2020-10-21 10:34:34 +02:00
Alessandro Di Federico 94b28d0514 bin/revng: more robust diff of opt --help output 2020-10-06 16:04:55 +02:00
Alessandro Di Federico 1c2d3e0613 bin/revng: introduce $REAL_ARGV0 2020-10-06 16:04:32 +02:00
Alessandro Di Federico 5a7d4d194a Install check-revng-conventions 2020-10-01 18:17:53 +02:00
Alain Carlucci 9034fcb235 scripts/revng: s/log/log_error/ 2020-10-01 18:17:53 +02:00
Pietro Fezzardi 998d003d10 check-conventions.sh: better match C++ filenames 2020-10-01 18:17:46 +02:00
Pietro Fezzardi 44e47de54c check-conventions.sh: properly set exit status
Before this commit, the exit status was not really taken care of.
Now the exit status is set to error whenever some of the checks fail,
and to success only if all the checks succeed.
2020-10-01 18:17:46 +02:00
Pietro Fezzardi 643a79ede5 check-conventions.sh: add check helper functions
This commit adds two helper functions that run two set of checks:
- `run_clang_format` runs clang format
- `run_revng_checks` runs revng-specific checks

This is a preliminary commit to ease extension of `check-conventions.sh`
so that it can be better integrated with bash scripts and git hooks.
2020-10-01 18:17:45 +02:00
Pietro Fezzardi 1594664743 check-conventions.sh: drop --format option
This option is now redundant, since `clang-format` always runs.
2020-10-01 18:17:29 +02:00
Alessandro Di Federico 85058249c5 Avoid pygraphviz crash with Python 3
Just a workaround.
2020-09-04 17:40:00 +02:00
Andrea Gussoni a590159993 Use c++ compiler for linking the translated module
We now make use of the `__gxx_personality_v0` personality function to
handle the exception behavior.

For this reason, we now need to use a c++ compiler for linking the final
module after the translation process of a binary.
2020-08-03 22:11:18 +02:00
Alessandro Di Federico e190c3189e check-conventions.sh: always run clang-format 2020-06-13 10:36:08 +02:00
Alessandro Di Federico e51d6e5458 Make the revng script compatible with clang's ASan 2020-05-14 11:59:05 +02:00
Pietro Fezzardi a0102592b5 Lifting non-x86 dynamic ELFs: fix error message 2020-02-27 11:55:09 +01:00
Alessandro Di Federico 525325d1c6 Add revng translate --output 2020-02-19 12:19:59 +01:00
Alessandro Di Federico 0a79b3d0f2 scripts/revng: fix order of post -- arguments 2020-02-19 12:19:31 +01:00
Alessandro Di Federico d247745df8 revng: informative error message on missing file 2019-09-04 11:52:07 +02:00
Alessandro Di Federico 981389d80a revng: handle different version of pyelftools
The contents of ELF dynamic tags is return either as a `str` or a
`bytes` depending on the versions of `pyelftools`.

This commit forces it to be a string to ensure compatibility with both
options.
2019-06-06 17:39:42 +02:00
AndreaJegher 8492c56333 Enable AArch64 support (no tests)
This commit enables AArch64 as an input architecture. However, tests are
not enabled yet due to some known bugs.
2019-05-27 19:36:12 +02:00