summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/vDSO/Makefile
diff options
context:
space:
mode:
authorChristophe Leroy <christophe.leroy@csgroup.eu>2024-09-01 20:24:03 +0300
committerJason A. Donenfeld <Jason@zx2c4.com>2024-09-13 18:28:35 +0300
commitecb8bd70d51ccf9009219a6097cef293deada65b (patch)
tree80cfb684d96c6dd528333347f3f6497c31de69a8 /tools/testing/selftests/vDSO/Makefile
parent18efd0b10e0fd77fe649a375f9f17a387b5d1609 (diff)
downloadlinux-ecb8bd70d51ccf9009219a6097cef293deada65b.tar.xz
selftests: vDSO: build tests with O2 optimization
Without -O2, the generated code for testing chacha function is awful. GCC even implements rol32() as a function of 20 instructions instead of just using the rotlwi instruction. ~# time ./vdso_test_chacha TAP version 13 1..1 ok 1 chacha: PASS real 0m 37.16s user 0m 36.89s sys 0m 0.26s Several other selftests directory add -O2, and the kernel is also always built with optimisation active. Do the same for vDSO selftests. With this patch the time is reduced by approximately 15%. ~# time ./vdso_test_chacha TAP version 13 1..1 ok 1 chacha: PASS real 0m 32.09s user 0m 31.86s sys 0m 0.22s Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'tools/testing/selftests/vDSO/Makefile')
-rw-r--r--tools/testing/selftests/vDSO/Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/vDSO/Makefile b/tools/testing/selftests/vDSO/Makefile
index d586d3e7a7c1..04930125035e 100644
--- a/tools/testing/selftests/vDSO/Makefile
+++ b/tools/testing/selftests/vDSO/Makefile
@@ -14,7 +14,7 @@ TEST_GEN_PROGS += vdso_test_getrandom
TEST_GEN_PROGS += vdso_test_chacha
endif
-CFLAGS := -std=gnu99
+CFLAGS := -std=gnu99 -O2
ifeq ($(CONFIG_X86_32),y)
LDLIBS += -lgcc_s