Oh, and I just found out that the ax_check_aligned_access_required detection
script
will "hide" the unaligned memory access crash if it's compiled with
optimization.
When using -O0, it will crash with a bus error on sparc64, as it should.
It's the same with a more recent version of the script[1].
OK, so the code remains broken.
So, IMHO the cleanest fix should be to compile test script without
optimization, to
ensure it's causing a bus error and correctly detect that the target cpu
requires
aligned memory access.
Well, the bus error is well visible when running the xdelta3 testsuite.
Well, the bus error in xdelta3 itself yes... but I was referring to the autconf
check.
This one _doesn't_ cause a bus error (as it should), when it's compiled with
optimization.
If it was, configure could detect it and and automatically set
ax_cv_have_aligned_access_required=yes - which will then set a macro that
disables all the code that causes unaligned access.
If the autoconf check script is compiled with -O0, it will cause a bus error,
which is what I suggested as a solution. I'm not sure how to fix this script so
it will trigger the bus error even with -Os or -O3.
The rest of xdelta3 can be compiled with -O3/-Os just fine, as long as the
macro is set.