selftests: vDSO: separate LDLIBS from CFLAGS for libsodium
authorJason A. Donenfeld <Jason@zx2c4.com>
Tue, 27 Aug 2024 14:27:13 +0000 (16:27 +0200)
committerJason A. Donenfeld <Jason@zx2c4.com>
Fri, 30 Aug 2024 13:44:38 +0000 (15:44 +0200)
commita5330eb3bcd87f3ce7738a2e898671a0ff561e85
treef4e232822e1430794ff47a89d5218e1e2d7cf420
parent1e661b349041c3d5026d9e95930b1d396c0c6e6d
selftests: vDSO: separate LDLIBS from CFLAGS for libsodium

On systems that set -Wl,--as-needed, putting the -lsodium in the wrong
place on the command line means we get a linker error:

      CC       vdso_test_chacha
    /usr/bin/ld: /tmp/ccKpjnSM.o: in function `main':
    vdso_test_chacha.c:(.text+0x276): undefined reference to `crypto_stream_chacha20'
    collect2: error: ld returned 1 exit status

Fix this by passing pkg-config's --libs output to the LDFLAGS field
instead of the CFLAGS field, as is customary.

Reported-by: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
tools/testing/selftests/vDSO/Makefile