From 53d10f48b5ed98085a718107b9aed30d9f08137c Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Mon, 14 Aug 2023 10:12:52 +0200 Subject: [PATCH 1/7] OpenBSD port --- Makefile | 41 ++++++--------------- Symbol.map | 59 +++++++++++++++--------------- call_once.c | 4 +-- cnd.c | 4 +-- locks_annotate.h | 94 ++++++++++++++++++++++++++++++++++++++++++++++++ mtx.c | 4 +-- shlib_version | 2 ++ thrd.c | 4 +-- thrd_create.3 | 2 -- tss.c | 4 +-- 10 files changed, 140 insertions(+), 78 deletions(-) create mode 100644 locks_annotate.h create mode 100644 shlib_version diff --git a/Makefile b/Makefile index de696c7..8b9cdc6 100644 --- a/Makefile +++ b/Makefile @@ -1,41 +1,20 @@ -# $FreeBSD$ - -PACKAGE=lib${LIB} LIB= stdthreads -SHLIB_MAJOR= 0 -INCS= threads.h +HDR= threads.h SRCS= threads.h call_once.c cnd.c mtx.c thrd.c tss.c MAN= thrd_create.3 -MLINKS= thrd_create.3 call_once.3 \ - thrd_create.3 cnd_broadcast.3 \ - thrd_create.3 cnd_destroy.3 \ - thrd_create.3 cnd_init.3 \ - thrd_create.3 cnd_signal.3 \ - thrd_create.3 cnd_timedwait.3 \ - thrd_create.3 cnd_wait.3 \ - thrd_create.3 mtx_destroy.3 \ - thrd_create.3 mtx_init.3 \ - thrd_create.3 mtx_lock.3 \ - thrd_create.3 mtx_timedlock.3 \ - thrd_create.3 mtx_trylock.3 \ - thrd_create.3 mtx_unlock.3 \ - thrd_create.3 thrd_current.3 \ - thrd_create.3 thrd_detach.3 \ - thrd_create.3 thrd_equal.3 \ - thrd_create.3 thrd_exit.3 \ - thrd_create.3 thrd_join.3 \ - thrd_create.3 thrd_sleep.3 \ - thrd_create.3 thrd_yield.3 \ - thrd_create.3 tss_create.3 \ - thrd_create.3 tss_delete.3 \ - thrd_create.3 tss_get.3 \ - thrd_create.3 tss_set.3 +CPPFLAGS+= -Wno-incompatible-pointer-types-discards-qualifiers LIBADD= pthread -VERSION_DEF= ${SRCTOP}/lib/libc/Versions.def -SYMBOL_MAPS= ${.CURDIR}/Symbol.map +VERSION_SCRIPT= ${.CURDIR}/Symbol.map + +includes: + @cd ${.CURDIR}; j="cmp -s ${HDR} ${DESTDIR}/usr/include/${HDR} || \ + ${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} \ + -m 444 ${HDR} ${DESTDIR}/usr/include"; \ + echo $$j; \ + eval "$$j"; \ .include diff --git a/Symbol.map b/Symbol.map index 0fe6eac..ade78da 100644 --- a/Symbol.map +++ b/Symbol.map @@ -1,31 +1,30 @@ -/* - * $FreeBSD$ - */ - -FBSD_1.3 { - call_once; - cnd_broadcast; - cnd_destroy; - cnd_init; - cnd_signal; - cnd_timedwait; - cnd_wait; - mtx_destroy; - mtx_init; - mtx_lock; - mtx_timedlock; - mtx_trylock; - mtx_unlock; - thrd_create; - thrd_current; - thrd_detach; - thrd_equal; - thrd_exit; - thrd_join; - thrd_sleep; - thrd_yield; - tss_create; - tss_delete; - tss_get; - tss_set; +{ + global: + call_once; + cnd_broadcast; + cnd_destroy; + cnd_init; + cnd_signal; + cnd_timedwait; + cnd_wait; + mtx_destroy; + mtx_init; + mtx_lock; + mtx_timedlock; + mtx_trylock; + mtx_unlock; + thrd_create; + thrd_current; + thrd_detach; + thrd_equal; + thrd_exit; + thrd_join; + thrd_sleep; + thrd_yield; + tss_create; + tss_delete; + tss_get; + tss_set; + local: + *; }; diff --git a/call_once.c b/call_once.c index f00e308..a09a06a 100644 --- a/call_once.c +++ b/call_once.c @@ -25,12 +25,10 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD$ */ #include -__FBSDID("$FreeBSD$"); - +#include "locks_annotate.h" #include #include "threads.h" diff --git a/cnd.c b/cnd.c index 0c3cbdd..e74c8eb 100644 --- a/cnd.c +++ b/cnd.c @@ -25,12 +25,10 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD$ */ #include -__FBSDID("$FreeBSD$"); - +#include "locks_annotate.h" #include #include diff --git a/locks_annotate.h b/locks_annotate.h new file mode 100644 index 0000000..9a91eb7 --- /dev/null +++ b/locks_annotate.h @@ -0,0 +1,94 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Berkeley Software Design, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)cdefs.h 8.8 (Berkeley) 1/9/95 + */ + +#ifndef _LOCKS_ANNOTATE_H +#define _LOCKS_ANNOTATE_H + +/* + * Lock annotations. + * + * Clang provides support for doing basic thread-safety tests at + * compile-time, by marking which locks will/should be held when + * entering/leaving a functions. + * + * Furthermore, it is also possible to annotate variables and structure + * members to enforce that they are only accessed when certain locks are + * held. + */ + +#if __has_extension(c_thread_safety_attributes) +#define __lock_annotate(x) __attribute__((x)) +#else +#define __lock_annotate(x) +#endif + +/* Structure implements a lock. */ +#define __lockable __lock_annotate(lockable) + +/* Function acquires an exclusive or shared lock. */ +#define __locks_exclusive(...) \ + __lock_annotate(exclusive_lock_function(__VA_ARGS__)) +#define __locks_shared(...) \ + __lock_annotate(shared_lock_function(__VA_ARGS__)) + +/* Function attempts to acquire an exclusive or shared lock. */ +#define __trylocks_exclusive(...) \ + __lock_annotate(exclusive_trylock_function(__VA_ARGS__)) +#define __trylocks_shared(...) \ + __lock_annotate(shared_trylock_function(__VA_ARGS__)) + +/* Function releases a lock. */ +#define __unlocks(...) __lock_annotate(unlock_function(__VA_ARGS__)) + +/* Function asserts that an exclusive or shared lock is held. */ +#define __asserts_exclusive(...) \ + __lock_annotate(assert_exclusive_lock(__VA_ARGS__)) +#define __asserts_shared(...) \ + __lock_annotate(assert_shared_lock(__VA_ARGS__)) + + +/* Function requires that an exclusive or shared lock is or is not held. */ +#define __requires_exclusive(...) \ + __lock_annotate(exclusive_locks_required(__VA_ARGS__)) +#define __requires_shared(...) \ + __lock_annotate(shared_locks_required(__VA_ARGS__)) +#define __requires_unlocked(...) \ + __lock_annotate(locks_excluded(__VA_ARGS__)) + +/* Function should not be analyzed. */ +#define __no_lock_analysis __lock_annotate(no_thread_safety_analysis) + +#endif diff --git a/mtx.c b/mtx.c index 124ddd6..40cb428 100644 --- a/mtx.c +++ b/mtx.c @@ -25,12 +25,10 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD$ */ #include -__FBSDID("$FreeBSD$"); - +#include "locks_annotate.h" #include #include diff --git a/shlib_version b/shlib_version new file mode 100644 index 0000000..97c9f92 --- /dev/null +++ b/shlib_version @@ -0,0 +1,2 @@ +major=0 +minor=0 diff --git a/thrd.c b/thrd.c index 5ecfb91..ca60d47 100644 --- a/thrd.c +++ b/thrd.c @@ -25,12 +25,10 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD$ */ #include -__FBSDID("$FreeBSD$"); - +#include "locks_annotate.h" #include #include #include diff --git a/thrd_create.3 b/thrd_create.3 index df3bd4f..79026ee 100644 --- a/thrd_create.3 +++ b/thrd_create.3 @@ -22,8 +22,6 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD$ -.\" .Dd December 26, 2011 .Dt THRD_CREATE 3 .Os diff --git a/tss.c b/tss.c index a7e085b..d38fa10 100644 --- a/tss.c +++ b/tss.c @@ -25,12 +25,10 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD$ */ #include -__FBSDID("$FreeBSD$"); - +#include "locks_annotate.h" #include #include "threads.h" From bed6ac416b6e44eb00b77ebabc3692004ce119ca Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Mon, 14 Aug 2023 10:57:43 +0200 Subject: [PATCH 2/7] Merge lock annotation macros in threads.h --- call_once.c | 2 +- cnd.c | 2 +- locks_annotate.h | 94 ------------------------------------------------ mtx.c | 2 +- thrd.c | 2 +- threads.h | 54 ++++++++++++++++++++++++++++ tss.c | 2 +- 7 files changed, 59 insertions(+), 99 deletions(-) delete mode 100644 locks_annotate.h diff --git a/call_once.c b/call_once.c index a09a06a..0f32bb5 100644 --- a/call_once.c +++ b/call_once.c @@ -28,7 +28,7 @@ */ #include -#include "locks_annotate.h" + #include #include "threads.h" diff --git a/cnd.c b/cnd.c index e74c8eb..462c7df 100644 --- a/cnd.c +++ b/cnd.c @@ -28,7 +28,7 @@ */ #include -#include "locks_annotate.h" + #include #include diff --git a/locks_annotate.h b/locks_annotate.h deleted file mode 100644 index 9a91eb7..0000000 --- a/locks_annotate.h +++ /dev/null @@ -1,94 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-3-Clause - * - * Copyright (c) 1991, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Berkeley Software Design, Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)cdefs.h 8.8 (Berkeley) 1/9/95 - */ - -#ifndef _LOCKS_ANNOTATE_H -#define _LOCKS_ANNOTATE_H - -/* - * Lock annotations. - * - * Clang provides support for doing basic thread-safety tests at - * compile-time, by marking which locks will/should be held when - * entering/leaving a functions. - * - * Furthermore, it is also possible to annotate variables and structure - * members to enforce that they are only accessed when certain locks are - * held. - */ - -#if __has_extension(c_thread_safety_attributes) -#define __lock_annotate(x) __attribute__((x)) -#else -#define __lock_annotate(x) -#endif - -/* Structure implements a lock. */ -#define __lockable __lock_annotate(lockable) - -/* Function acquires an exclusive or shared lock. */ -#define __locks_exclusive(...) \ - __lock_annotate(exclusive_lock_function(__VA_ARGS__)) -#define __locks_shared(...) \ - __lock_annotate(shared_lock_function(__VA_ARGS__)) - -/* Function attempts to acquire an exclusive or shared lock. */ -#define __trylocks_exclusive(...) \ - __lock_annotate(exclusive_trylock_function(__VA_ARGS__)) -#define __trylocks_shared(...) \ - __lock_annotate(shared_trylock_function(__VA_ARGS__)) - -/* Function releases a lock. */ -#define __unlocks(...) __lock_annotate(unlock_function(__VA_ARGS__)) - -/* Function asserts that an exclusive or shared lock is held. */ -#define __asserts_exclusive(...) \ - __lock_annotate(assert_exclusive_lock(__VA_ARGS__)) -#define __asserts_shared(...) \ - __lock_annotate(assert_shared_lock(__VA_ARGS__)) - - -/* Function requires that an exclusive or shared lock is or is not held. */ -#define __requires_exclusive(...) \ - __lock_annotate(exclusive_locks_required(__VA_ARGS__)) -#define __requires_shared(...) \ - __lock_annotate(shared_locks_required(__VA_ARGS__)) -#define __requires_unlocked(...) \ - __lock_annotate(locks_excluded(__VA_ARGS__)) - -/* Function should not be analyzed. */ -#define __no_lock_analysis __lock_annotate(no_thread_safety_analysis) - -#endif diff --git a/mtx.c b/mtx.c index 40cb428..1e04187 100644 --- a/mtx.c +++ b/mtx.c @@ -28,7 +28,7 @@ */ #include -#include "locks_annotate.h" + #include #include diff --git a/thrd.c b/thrd.c index ca60d47..15e0269 100644 --- a/thrd.c +++ b/thrd.c @@ -28,7 +28,7 @@ */ #include -#include "locks_annotate.h" + #include #include #include diff --git a/threads.h b/threads.h index fdf56bb..0d2fd3d 100644 --- a/threads.h +++ b/threads.h @@ -33,6 +33,60 @@ #include +/* + * Lock annotations. + * + * Clang provides support for doing basic thread-safety tests at + * compile-time, by marking which locks will/should be held when + * entering/leaving a functions. + * + * Furthermore, it is also possible to annotate variables and structure + * members to enforce that they are only accessed when certain locks are + * held. + */ + +#if __has_extension(c_thread_safety_attributes) +#define __lock_annotate(x) __attribute__((x)) +#else +#define __lock_annotate(x) +#endif + +/* Structure implements a lock. */ +#define __lockable __lock_annotate(lockable) + +/* Function acquires an exclusive or shared lock. */ +#define __locks_exclusive(...) \ + __lock_annotate(exclusive_lock_function(__VA_ARGS__)) +#define __locks_shared(...) \ + __lock_annotate(shared_lock_function(__VA_ARGS__)) + +/* Function attempts to acquire an exclusive or shared lock. */ +#define __trylocks_exclusive(...) \ + __lock_annotate(exclusive_trylock_function(__VA_ARGS__)) +#define __trylocks_shared(...) \ + __lock_annotate(shared_trylock_function(__VA_ARGS__)) + +/* Function releases a lock. */ +#define __unlocks(...) __lock_annotate(unlock_function(__VA_ARGS__)) + +/* Function asserts that an exclusive or shared lock is held. */ +#define __asserts_exclusive(...) \ + __lock_annotate(assert_exclusive_lock(__VA_ARGS__)) +#define __asserts_shared(...) \ + __lock_annotate(assert_shared_lock(__VA_ARGS__)) + + +/* Function requires that an exclusive or shared lock is or is not held. */ +#define __requires_exclusive(...) \ + __lock_annotate(exclusive_locks_required(__VA_ARGS__)) +#define __requires_shared(...) \ + __lock_annotate(shared_locks_required(__VA_ARGS__)) +#define __requires_unlocked(...) \ + __lock_annotate(locks_excluded(__VA_ARGS__)) + +/* Function should not be analyzed. */ +#define __no_lock_analysis __lock_annotate(no_thread_safety_analysis) + /* * The C11 threads interface. * diff --git a/tss.c b/tss.c index d38fa10..6ffa8e4 100644 --- a/tss.c +++ b/tss.c @@ -28,7 +28,7 @@ */ #include -#include "locks_annotate.h" + #include #include "threads.h" From cfecb19d9de9ecda65ea063579d489c5ac1ed9a4 Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Mon, 14 Aug 2023 10:58:12 +0200 Subject: [PATCH 3/7] remove unused file --- Makefile.depend | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 Makefile.depend diff --git a/Makefile.depend b/Makefile.depend deleted file mode 100644 index 25b26ea..0000000 --- a/Makefile.depend +++ /dev/null @@ -1,17 +0,0 @@ -# $FreeBSD$ -# Autogenerated - do NOT edit! - -DIRDEPS = \ - include \ - include/xlocale \ - lib/${CSU_DIR} \ - lib/libc \ - lib/libcompiler_rt \ - lib/libthr \ - - -.include - -.if ${DEP_RELDIR} == ${_DEP_RELDIR} -# local dependencies - needed for -jN in clean tree -.endif From d94267b5d6388f6e576f093166731a2a07b82be6 Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Mon, 14 Aug 2023 11:32:37 +0200 Subject: [PATCH 4/7] Fix linking with libpthreads --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8b9cdc6..fab9f97 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ SRCS= threads.h call_once.c cnd.c mtx.c thrd.c tss.c MAN= thrd_create.3 CPPFLAGS+= -Wno-incompatible-pointer-types-discards-qualifiers -LIBADD= pthread +LDADD= -L${BSDOBJDIR}/lib/librthread -lpthread VERSION_SCRIPT= ${.CURDIR}/Symbol.map From adbdfee2a4f8923365e8afa1cb1ddc366a14833b Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Mon, 14 Aug 2023 11:33:03 +0200 Subject: [PATCH 5/7] Add pkg-config file --- Makefile | 20 ++++++++++++++++++++ stdthreads.pc.in | 11 +++++++++++ 2 files changed, 31 insertions(+) create mode 100644 stdthreads.pc.in diff --git a/Makefile b/Makefile index fab9f97..b681fb8 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,6 @@ LIB= stdthreads +PACKAGE_VERSION?= 0.2 +PREFIX?= /usr HDR= threads.h SRCS= threads.h call_once.c cnd.c mtx.c thrd.c tss.c @@ -17,4 +19,22 @@ includes: echo $$j; \ eval "$$j"; \ +stdthreads.pc: stdthreads.pc.in + @sed -e 's#@prefix@#${PREFIX}#g' \ + -e 's#@exec_prefix@#$${prefix}#g' \ + -e 's#@libdir@#$${exec_prefix}/lib#g' \ + -e 's#@includedir@#$${prefix}/include#g' \ + -e 's#@PACKAGE_VERSION@#'${PACKAGE_VERSION}'#g' \ + < ${.CURDIR}/stdthreads.pc.in > $@ + +all: stdthreads.pc + +CLEANFILES+= stdthreads.pc + +install-pc: stdthreads.pc + ${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m 444 \ + stdthreads.pc ${LIBDIR}/pkgconfig + +realinstall: install-pc + .include diff --git a/stdthreads.pc.in b/stdthreads.pc.in new file mode 100644 index 0000000..78cdb85 --- /dev/null +++ b/stdthreads.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: stdthreads +Description: The C11 standard threads library +Version: @PACKAGE_VERSION@ + +Cflags: -I${includedir} +Libs: -L${libdir} -lstdthreads From e83a241d776d032cadecd18893b555fa363e9901 Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Mon, 14 Aug 2023 11:45:50 +0200 Subject: [PATCH 6/7] Fix pkg-config installation --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b681fb8..bdf561d 100644 --- a/Makefile +++ b/Makefile @@ -33,7 +33,7 @@ CLEANFILES+= stdthreads.pc install-pc: stdthreads.pc ${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m 444 \ - stdthreads.pc ${LIBDIR}/pkgconfig + stdthreads.pc ${DESTDIR}${LIBDIR}/pkgconfig realinstall: install-pc From 23ba7e847accfd0342d302c5f2993392548ffcb3 Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Mon, 14 Aug 2023 16:43:19 +0200 Subject: [PATCH 7/7] Add -lpthread to Libs: in pkg-config file --- Makefile | 2 +- stdthreads.pc.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index bdf561d..513b323 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ LIB= stdthreads -PACKAGE_VERSION?= 0.2 +PACKAGE_VERSION?= 0.3.2 PREFIX?= /usr HDR= threads.h diff --git a/stdthreads.pc.in b/stdthreads.pc.in index 78cdb85..6e06247 100644 --- a/stdthreads.pc.in +++ b/stdthreads.pc.in @@ -8,4 +8,4 @@ Description: The C11 standard threads library Version: @PACKAGE_VERSION@ Cflags: -I${includedir} -Libs: -L${libdir} -lstdthreads +Libs: -L${libdir} -lstdthreads -lpthread