scripts: make security checks architecture independent
Summary:
script: remove gitian reference from symbol-check.py
https://github.com/bitcoin/bitcoin/pull/22405/commits/797b3ed9090030f32fade81803b580562d4a90a3
Note that this is the only relevant commit from core#22405, everything else was backported with guix.
scripts: match on EXE_FORMATS rather than name string
This is a minor change, but matching on the EXE_FORMAT is slightly simpler and more robust.
It also fixes the etype == lief.EXE_FORMATS.UNKNOWN check in both python scripts.
scripts: make security checks architecture independent
This paves the way for using and checking for architecture dependent
flags like -fcf-protection on x86_64 Linux and -mbranch-protection on 64
bit ARM.
This is a backport of core#23811 and core#23838
Test Plan: guix build and gitian builds
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D14007