diff options
| author | Donald Sharp <donaldsharp72@gmail.com> | 2024-05-06 10:29:05 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-06 10:29:05 -0400 |
| commit | 216bac2826d60c47615cf50df1833c5c8543c75e (patch) | |
| tree | b84c9e08d3113e1dd478d7fc222a0c77b07dbcca /python/xrelfo.py | |
| parent | 9de2f138f0b3e76324dfb9a11d85fbf6c13b8b89 (diff) | |
| parent | 2e84c37460e2f0f3444afe6645620c556a5f209a (diff) | |
Merge pull request #15902 from opensourcerouting/build-xref-setup-hppa
build: fix missing `XREF_SETUP` (and HP PA-RISC build failure)
Diffstat (limited to 'python/xrelfo.py')
| -rw-r--r-- | python/xrelfo.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/python/xrelfo.py b/python/xrelfo.py index a40b19e5fb..07cd74071f 100644 --- a/python/xrelfo.py +++ b/python/xrelfo.py @@ -22,7 +22,7 @@ import argparse from clippy.uidhash import uidhash from clippy.elf import * -from clippy import frr_top_src, CmdAttr +from clippy import frr_top_src, CmdAttr, elf_notes from tiabwarfo import FieldApplicator from xref2vtysh import CommandEntry @@ -327,6 +327,7 @@ class Xrelfo(dict): } ) self._xrefs = [] + self.note_warn = False def load_file(self, filename): orig_filename = filename @@ -395,6 +396,15 @@ class Xrelfo(dict): ptrs = edf.iter_data(XrefPtr, slice(start, end)) else: + if elf_notes: + self.note_warn = True + sys.stderr.write( + """%s: warning: binary has no FRRouting.XREF note +%s- one of FRR_MODULE_SETUP, FRR_DAEMON_INFO or XREF_SETUP must be used +""" + % (orig_filename, orig_filename) + ) + xrefarray = edf.get_section("xref_array") if xrefarray is None: raise ValueError("file has neither xref note nor xref_array section") @@ -471,6 +481,9 @@ def _main(args): sys.stderr.write("while processing %s:\n" % (fn)) traceback.print_exc() + if xrelfo.note_warn and args.Werror: + errors += 1 + for option in dir(args): if option.startswith("W") and option != "Werror": checks = sorted(xrelfo.check(args)) |
