Added `make -C src check-abi` target to leverage libabigail 2.0 tools to
check for ABI changes.
Add ABI baseline files for aarch64, i686, riscv, s390x, and x86_64 Linux
targets and aarch64 and x86_64 QNX SDP 7.1 targets.
Used the check-abi target in the CI-unix github workflow.
Enabling debug mode was convoluted and added cognitive load.
This change simplifies how the configuration option --enable-debug works
by simply adding -DUNW_DEBUG=1 to the preprocesor flags via a specific
confiuration variable, accomplishing the folowing goals.
- don't clobber the CPPFLAGS user variable
- don't mess with -DNDEBUG which has other meanings orthogonal
to libunwind debug mode
- don't hide the definition of the ABI-changing build-time option
behind an ifdef in an internal header file
In addition I added a warning to confogure --help to point out that
enabling the option changes the ABI. Caveat lector.
The user variable CCASFLAGS should never be set in configure.ac, and the
default AM_CCASFLAGS already has AM_CPPFLAGS added so it ends up
appearing in the command line twice.
Remove setting both of these variables so using the user variable from
the command line will do the right thing and there is less noise in the
build logs.
ISO C does not support omitting parameter names in function definitions
before C2X, so better add them.
fixes:
ppc64-test-plt.c: In function ‘unw_get_accessors_int’:
ppc64-test-plt.c:10:41: error: parameter name omitted
10 | unw_accessors_t *unw_get_accessors_int (unw_addr_space_t) { return NULL; }
| ^~~~~~~~~~~~~~~~
ppc64-test-plt.c: In function ‘_Uppc64_dwarf_step’:
ppc64-test-plt.c:11:17: error: parameter name omitted
11 | int dwarf_step (struct dwarf_cursor*) { return 0; }
| ^~~~~~~~~~~~~~~~~~~~
make[1]: *** [Makefile:1662: ppc64-test-plt.o] Error 1
seen on ppc64 with gcc 10.3.1
Tests will now always be built (unless configured with --disable-tests)
and installed by default in ${prefix}/libexec/libunwind. A new script,
test-runner, is supplied to run all of the tests and produce TAP output.
configure.ac: make tests/check-namespace.sh executable,
add license boilerplate
tests/Makefile.am: remove run-coredump-unwind, add test-runner,
add license boilerplate, remove XFAIL for riscv64
tests/README.md: new file
tests/check-namespace.sh.in: make LIBUNWIND and LIBUNWIND_GENERIC
externally settable, add license boilerplate
tests/run-check-namespace: remove file
test/run-ptrace-mapper: look for test-ptrace relative to script,
add license boilerplate
test/run-ptrace-misc: look for test-ptrace relative to script,
add license boilerplate
test/test-runner.in: new file
.github/workflows/CI-unix.yml: change run-check-namespace to
check-namespace.sh, use libtool to run in-tree binaries instead of
forcing static linking
glibc has register macros of the form EF_REGx, but musl uses EF_Rx.
Handle this by using a macro to use the correct names.
Closes#708.
Signed-off-by: Ross Burton <ross.burton@arm.com>
If the compiler supports -march=armv8-a+sve then those options are used
to build this test, but all that needs is a sufficiently new compiler.
This then results in the __ARM_FEATURE_SVE check always passing, because
SVE is explicitly enabled.
However it's perfectly possible for the compiler to support +sve but the
machine running the code to not, which results with the test crashing
with "Illegal instruction".
Handle this case by checking HWCAP for SVE support, and skipping the
test unless we know it is available. This check is Linux-specific at
present, but the logic is easily extended.
Signed-off-by: Ross Burton <ross.burton@arm.com>
- added musl target CI builds to CI-unix.yml
- added config-time check for libucontext
- added better detection of NULL IP in x86_64 unw_step() because musl does not
follow the de facto x86_64 ABI conventions for main program entry
This test source had all kinds of bells and whistles added, requiring all kinds
of (non-portable) dependencies that were never really used. Removed the extra
stuff (logging through syslog, catching segfaults).
Also remove the build dependency on libbacktrace since it actually causes
conflicts with libunwind.
This header file was included in all the other coredump sources and pulled in a
slew of system headers, none of which were used anywhere. Some of those headers
did not even exist on all supported targets.
Fewer build dependencies, fewer build failures, no change in functionality.
Some of the unit test code was bringing an extern function prototype
into scoe in a function body. The idiomatic and expected way to do this
is by using a header file and not adhering to the idiom not only
increases the cognitive load of the reader but tgriggers warning from
static analysis tools.
This change just does it the right way instead. No functional change.
The x86-specific code would often mistakenly advance the cursor through
the signal trampoline by misinterpreting what was on the stack, and it
just happened to work most of the time. It was wrong, however, and
moving the signal trampolive detection up before the DWARF stepping
(like it is on other target architectures) should make it do the right
thing.
This change had the cascade effect of tickling some undefined behaviour
in the target architecture-specific unw_resume code, so that got fixed
too.