diff options
author | Christopher Larson <chris_larson@mentor.com> | 2019-11-26 23:08:29 +0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-12-04 12:29:29 +0000 |
commit | 8d84fdea1c26ed5f8f8261c89070df44da3f1855 (patch) | |
tree | 5ec6ddef1e1311529a9fed7911a0aa26c5b8b1d1 /meta/recipes-support/libcap-ng/libcap-ng/0002-Wrap-pthread_atfork-usage-in-HAVE_PTHREAD_H.patch | |
parent | ddd2c5624404848ee668dabec0f61599ab5003e4 (diff) | |
download | openembedded-core-contrib-8d84fdea1c26ed5f8f8261c89070df44da3f1855.tar.gz |
libcap-ng: add pthread library if header is found
If the pthread.h header is found, make sure library containing
"pthread_atfork" is added to the list of libraries against which to
link. On some hosts (e.g. openSUSE 15.1) "-lpthread" needs to be
explicitly added in order for the code to compile correctly.
We already had a workaround for this for native builds, but using some
external toolchains, we can be bit by this for the target recipe as
well.
Most of this is courtesy Trevor Woerner <twoerner@gmail.com>, via his
patch at stevegrubb/libcap-ng#10, the last thanks to Khem Raj.
Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-support/libcap-ng/libcap-ng/0002-Wrap-pthread_atfork-usage-in-HAVE_PTHREAD_H.patch')
-rw-r--r-- | meta/recipes-support/libcap-ng/libcap-ng/0002-Wrap-pthread_atfork-usage-in-HAVE_PTHREAD_H.patch | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/meta/recipes-support/libcap-ng/libcap-ng/0002-Wrap-pthread_atfork-usage-in-HAVE_PTHREAD_H.patch b/meta/recipes-support/libcap-ng/libcap-ng/0002-Wrap-pthread_atfork-usage-in-HAVE_PTHREAD_H.patch new file mode 100644 index 0000000000..7eb950f159 --- /dev/null +++ b/meta/recipes-support/libcap-ng/libcap-ng/0002-Wrap-pthread_atfork-usage-in-HAVE_PTHREAD_H.patch @@ -0,0 +1,24 @@ +From d95c4018ad57c37f6272dbedfa5217776567c329 Mon Sep 17 00:00:00 2001 +From: Christopher Larson <chris_larson@mentor.com> +Date: Tue, 26 Nov 2019 22:34:34 +0500 +Subject: [PATCH] Wrap pthread_atfork usage in HAVE_PTHREAD_H + +Signed-off-by: Christopher Larson <chris_larson@mentor.com> +--- + src/cap-ng.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/cap-ng.c b/src/cap-ng.c +index 35fcd7a..97a3dbd 100644 +--- a/src/cap-ng.c ++++ b/src/cap-ng.c +@@ -166,7 +166,9 @@ static void deinit(void) + static void init_lib(void) __attribute__ ((constructor)); + static void init_lib(void) + { ++#ifdef HAVE_PTHREAD_H + pthread_atfork(NULL, NULL, deinit); ++#endif + } + + static void init(void) |