]> git.ipfire.org Git - thirdparty/kmod.git/commit
testsuite: Fix build when linking with lld
authorLucas De Marchi <lucas.de.marchi@gmail.com>
Fri, 3 Jan 2025 19:01:14 +0000 (13:01 -0600)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Sat, 4 Jan 2025 04:44:18 +0000 (22:44 -0600)
commit0396fc239ddacb6d774b5d4e315721d0aa022f5b
tree3e3b532b5fca424721de51e198c3a1a0a7407370
parent47bc9145fcf61ff335059ae169e144c11123ec4d
testsuite: Fix build when linking with lld

When building with clang and linking with lld there is an issue with
keeping the kmod_tests sections: On ELF targets, __attribute__((used))
prevents compiler discarding, but does not affect linker --gc-sections,
according to https://lld.llvm.org/ELF/start-stop-gc.

Make sure the _start/_stop symbols are not weak and add the "retain"
attribute.

Closes: https://github.com/kmod-project/kmod/issues/269
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/274
testsuite/testsuite.h