contrib: pthreads: Fix building with llvm-mingw
commitc407f7fbbdf75712f5e7a634321975cd60484db8
authorMartin Storsjö <martin@martin.st>
Fri, 5 Jan 2018 21:53:37 +0000 (5 23:53 +0200)
committerMartin Storsjö <martin@martin.st>
Sun, 25 Feb 2018 20:18:41 +0000 (25 22:18 +0200)
tree92c3dc745e78132b3143636ae2f0c8fe5cd985ec
parent8743195a1a6b58efb79eeac74d375fb2ff414ce7
contrib: pthreads: Fix building with llvm-mingw

This avoids doing things with dlltool that llvm-dlltool doesn't
implement.

I don't see the need of running a second pass with dlltool to
produce an output def file and yet another pass to produce
an import library out of it; just make the linker output the
import library while linking the dll. (If the import library is
to be used by MSVC, there is a point in generating it with dlltool
instead of with ld though. Even then, there's no point in generating
the def file using dlltool though, when it could just be generated by
the linker.)

Remove an inline declaration on a function that can't be inline-only
(static inline).

For non-static inline functions in C, the compiler can choose to
use the inline function itself, or assume that a definition exists
in a different translation unit. In this case, clang seems to
not inline ptw32_cond_check_need_init and creates an undefined
reference to the same function that should be defined in another
translation unit (which doesn't exist).

See https://www.greenend.org.uk/rjk/tech/inline.html for more details
on this.
contrib/src/pthreads/implib.patch [new file with mode: 0644]
contrib/src/pthreads/remove-inline.patch [new file with mode: 0644]
contrib/src/pthreads/rules.mak