SDL/src/test
David Gow c57bcb47b1 test: Fix building with libunwind under autotools
There are two issues which are stopping the SDL tests from building on
my machine:
- libunwind is not being linked
- Even if it is, it is missing several symbols.

The first is fixed by having the test programs link against libunwind if
available. Technically, SDL2_test should be linking against it, as it's
used in SDL_test_memory.c, but as SDL2_test is a static library, it
can't itself import libunwind. We just assume that if it's present on
the system, we should link it directly to the test programs. This should
strictly be an improvement, as the only case where this'd fail is if
SDL2 was compiled when libunwind was present, but the tests are being
compiled without it, and that'd fail anyway.

The second is fixed by #define-ing UNW_LOCAL_ONLY before including
libunwind.h: this is required to make libunwind link to predicatable
symbols, in what can only be described as a bit of a farce. There are a
few more details in the libunwind man page, but the gist of it is that
it disables support for "remote unwinding": unwinding stack frames in a
different process (and possibly from a different architecture?):
http://www.nongnu.org/libunwind/man/libunwind(3).html

Note that I haven't tried this with CMake: I suspect that it'll work,
though, as the CMakeLists.txt seems to have SDL2 link against libunwind if
it's present. This adds an ugly extra dependency to SDL2, but does mean
that issue 1 isn't present. The UNW_LOCAL_ONLY change shouldn't be
build-system-specific.
2021-10-25 11:28:20 -07:00
..
SDL_test_assert.c Updated copyright for 2021 2021-01-02 10:25:38 -08:00
SDL_test_common.c Added Ctrl-T to toggle topmost mode in test programs 2021-08-13 17:53:39 -07:00
SDL_test_compare.c Updated copyright for 2021 2021-01-02 10:25:38 -08:00
SDL_test_crc32.c Updated copyright for 2021 2021-01-02 10:25:38 -08:00
SDL_test_font.c Updated copyright for 2021 2021-01-02 10:25:38 -08:00
SDL_test_fuzzer.c Updated copyright for 2021 2021-01-02 10:25:38 -08:00
SDL_test_harness.c Updated copyright for 2021 2021-01-02 10:25:38 -08:00
SDL_test_imageBlit.c Updated copyright for 2021 2021-01-02 10:25:38 -08:00
SDL_test_imageBlitBlend.c Updated copyright for 2021 2021-01-02 10:25:38 -08:00
SDL_test_imageFace.c Updated copyright for 2021 2021-01-02 10:25:38 -08:00
SDL_test_imagePrimitives.c Updated copyright for 2021 2021-01-02 10:25:38 -08:00
SDL_test_imagePrimitivesBlend.c Updated copyright for 2021 2021-01-02 10:25:38 -08:00
SDL_test_log.c Updated copyright for 2021 2021-01-02 10:25:38 -08:00
SDL_test_md5.c Updated copyright for 2021 2021-01-02 10:25:38 -08:00
SDL_test_memory.c test: Fix building with libunwind under autotools 2021-10-25 11:28:20 -07:00
SDL_test_random.c Updated copyright for 2021 2021-01-02 10:25:38 -08:00