build-sys: Fix atomic support detection
Attempting to use atomics operations on an architecture that does not support them generally results in a link error:
ld: /tmp/ccjYcMPP.o: in function func': testfile.c:(.text+0x1c): undefined reference to
__sync_bool_compare_and_swap_4'
The current build system uses cc.compiles() to check if atomic ops are supported, but cc.compiles() does not attempt to link, so the test fails to enable libatomics_opts.
Fix this by using cc.links() instead of cc.compiles().
Signed-off-by: Nicolas Cavallari nicolas.cavallari@green-communications.fr