c11/threads: resolve link issues with -O0
authorEmil Velikov <emil.velikov@collabora.com>
Tue, 24 May 2016 15:23:09 +0000 (16:23 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Tue, 24 May 2016 19:21:31 +0000 (20:21 +0100)
commit7e196cd1708bfe567454269bba7bc3f7b75364dc
tree49b265adbb75515cd6bccaa60c9592f7b4808f59
parent0ceed1701de6ffc40fb60fbff87c81e492fb18e0
c11/threads: resolve link issues with -O0

Add weak symbol notation for the pthread_mutexattr* symbols, thus making
the linker happy. When building with -O1 or greater the optimiser will
kick in and remove the said functions as they are dead/unreachable code.

Ideally we'll enable the optimisations locally, yet that does not seem
to work atm.

v2: Add the AX_GCC_FUNC_ATTRIBUTE([weak]) hunk in configure.

Cc: Alejandro PiƱeiro <apinheiro@igalia.com>
Cc: Ben Widawsky <ben@bwidawsk.net>
Cc: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: Rob Herring <robh@kernel.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Tested-by: Rob Clark <robdclark@gmail.com>
Tested-by: Mark Janes <mark.a.janes@intel.com>
configure.ac
include/c11/threads_posix.h