All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] acpica: correct flex/bison deps, add explicit m4-native dep
@ 2019-11-25 22:13 Christopher Larson
  2019-11-25 22:13 ` [PATCH 2/3] dosfstools: fix CP437 error from `dosfsck -l` Christopher Larson
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Christopher Larson @ 2019-11-25 22:13 UTC (permalink / raw)
  To: openembedded-core; +Cc: Christopher Larson

From: Christopher Larson <chris_larson@mentor.com>

This project doesn't require target flex or bison, just the natives,
and it uses m4 explicitly in its configuration.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
---
 meta/recipes-extended/acpica/acpica_20191018.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-extended/acpica/acpica_20191018.bb b/meta/recipes-extended/acpica/acpica_20191018.bb
index 4692275762..04732bbfe3 100644
--- a/meta/recipes-extended/acpica/acpica_20191018.bb
+++ b/meta/recipes-extended/acpica/acpica_20191018.bb
@@ -14,7 +14,7 @@ LIC_FILES_CHKSUM = "file://source/compiler/aslcompile.c;beginline=7;endline=150;
 
 COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux"
 
-DEPENDS = "bison flex bison-native"
+DEPENDS = "m4-native flex-native bison-native"
 
 SRC_URI = "https://acpica.org/sites/acpica/files/acpica-unix-${PV}.tar.gz"
 SRC_URI[md5sum] = "539a0252bcb42c383ceeaeb12ae9a60d"
-- 
2.11.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/3] dosfstools: fix CP437 error from `dosfsck -l`
  2019-11-25 22:13 [PATCH 1/3] acpica: correct flex/bison deps, add explicit m4-native dep Christopher Larson
@ 2019-11-25 22:13 ` Christopher Larson
  2019-11-25 22:28   ` Khem Raj
  2019-11-25 22:13 ` [PATCH 3/3] libcap-ng: fix built failure with some external toolchains due to missing pthread Christopher Larson
  2019-11-25 22:32 ` ✗ patchtest: failure for "acpica: correct flex/bison dep..." and 2 more Patchwork
  2 siblings, 1 reply; 9+ messages in thread
From: Christopher Larson @ 2019-11-25 22:13 UTC (permalink / raw)
  To: openembedded-core; +Cc: Christopher Larson

From: Christopher Larson <chris_larson@mentor.com>

Fix this error seen when using dosfsck -l to list fs contents:

    CP437: Invalid argument

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
---
 meta/recipes-devtools/dosfstools/dosfstools_4.1.bb | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/recipes-devtools/dosfstools/dosfstools_4.1.bb b/meta/recipes-devtools/dosfstools/dosfstools_4.1.bb
index 69aa81af44..c99d2019c8 100644
--- a/meta/recipes-devtools/dosfstools/dosfstools_4.1.bb
+++ b/meta/recipes-devtools/dosfstools/dosfstools_4.1.bb
@@ -23,3 +23,6 @@ EXTRA_OECONF = "--without-udev --enable-compat-symlinks"
 CFLAGS += "-D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
 
 BBCLASSEXTEND = "native"
+
+# Add codepage437 to avoid error from `dosfsck -l`
+RRECOMMENDS_${PN}_append_libc-glibc += "glibc-gconv-ibm437"
-- 
2.11.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/3] libcap-ng: fix built failure with some external toolchains due to missing pthread
  2019-11-25 22:13 [PATCH 1/3] acpica: correct flex/bison deps, add explicit m4-native dep Christopher Larson
  2019-11-25 22:13 ` [PATCH 2/3] dosfstools: fix CP437 error from `dosfsck -l` Christopher Larson
@ 2019-11-25 22:13 ` Christopher Larson
  2019-11-25 22:27   ` Khem Raj
  2019-11-25 22:32 ` ✗ patchtest: failure for "acpica: correct flex/bison dep..." and 2 more Patchwork
  2 siblings, 1 reply; 9+ messages in thread
From: Christopher Larson @ 2019-11-25 22:13 UTC (permalink / raw)
  To: openembedded-core; +Cc: Christopher Larson

From: Christopher Larson <chris_larson@mentor.com>

The libcap-ng build doesn't pass -pthread and can fail to link.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
---
 meta/recipes-support/libcap-ng/libcap-ng.inc       |  1 +
 .../libcap-ng/revert-pthread_atfork-fix.patch      | 56 ++++++++++++++++++++++
 2 files changed, 57 insertions(+)
 create mode 100644 meta/recipes-support/libcap-ng/libcap-ng/revert-pthread_atfork-fix.patch

diff --git a/meta/recipes-support/libcap-ng/libcap-ng.inc b/meta/recipes-support/libcap-ng/libcap-ng.inc
index aec83896e4..46d37e6807 100644
--- a/meta/recipes-support/libcap-ng/libcap-ng.inc
+++ b/meta/recipes-support/libcap-ng/libcap-ng.inc
@@ -9,6 +9,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
 
 SRC_URI = "http://people.redhat.com/sgrubb/libcap-ng/libcap-ng-${PV}.tar.gz \
            file://python.patch \
+           file://revert-pthread_atfork-fix.patch \
 "
 
 SRC_URI[md5sum] = "57dc267e2949cdecb651a929f9206572"
diff --git a/meta/recipes-support/libcap-ng/libcap-ng/revert-pthread_atfork-fix.patch b/meta/recipes-support/libcap-ng/libcap-ng/revert-pthread_atfork-fix.patch
new file mode 100644
index 0000000000..d3f7790b1e
--- /dev/null
+++ b/meta/recipes-support/libcap-ng/libcap-ng/revert-pthread_atfork-fix.patch
@@ -0,0 +1,56 @@
+From 81dc82393fae9851397fa5d94094434aa1d5c3d1 Mon Sep 17 00:00:00 2001
+From: Christopher Larson <chris_larson@mentor.com>
+Date: Thu, 14 Nov 2019 21:13:24 +0500
+Subject: [PATCH] Revert "Fix usage of pthread_atfork a whole different way"
+
+This reverts commit 08a09cba90f3d960c080a20833fb8c0908f1cea6.
+
+The fix was breaking builds with some toolchains.
+
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+---
+ src/Makefile.am |  2 +-
+ src/cap-ng.c    | 12 +++++++++++-
+ 2 files changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 5a66d4e..d46d02b 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -34,5 +34,5 @@ noinst_HEADERS = captab.h
+ libcap_ng_la_SOURCES = cap-ng.c lookup_table.c
+ libcap_ng_la_LIBADD =
+ libcap_ng_la_DEPENDENCIES = $(libcap_ng_la_SOURCES) ../config.h
+-libcap_ng_la_LDFLAGS = -Wl,-z,relro
++libcap_ng_la_LDFLAGS = -Wl,-z,relro -Wl,-z,nodelete
+ 
+diff --git a/src/cap-ng.c b/src/cap-ng.c
+index 35fcd7a..ed31afa 100644
+--- a/src/cap-ng.c
++++ b/src/cap-ng.c
+@@ -155,6 +155,15 @@ static __thread struct cap_ng m =	{ 1,
+ 					CAPNG_NEW,
+ 					{0, 0} };
+ 
++
++/*
++ * The pthread_atfork function is being made weak so that we can use it
++ * if the program is linked with pthreads and not requiring it for
++ * everything that uses libcap-ng.
++ */
++extern int __attribute__((weak)) pthread_atfork(void (*prepare)(void),
++	void (*parent)(void), void (*child)(void));
++
+ /*
+  * Reset the state so that init gets called to erase everything
+  */
+@@ -166,7 +175,8 @@ static void deinit(void)
+ static void init_lib(void) __attribute__ ((constructor));
+ static void init_lib(void)
+ {
+-	pthread_atfork(NULL, NULL, deinit);
++	if (pthread_atfork)
++		pthread_atfork(NULL, NULL, deinit);
+ }
+ 
+ static void init(void)
-- 
2.11.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/3] libcap-ng: fix built failure with some external toolchains due to missing pthread
  2019-11-25 22:13 ` [PATCH 3/3] libcap-ng: fix built failure with some external toolchains due to missing pthread Christopher Larson
@ 2019-11-25 22:27   ` Khem Raj
  2019-11-25 22:40     ` Christopher Larson
  2019-11-26 17:29     ` Christopher Larson
  0 siblings, 2 replies; 9+ messages in thread
From: Khem Raj @ 2019-11-25 22:27 UTC (permalink / raw)
  To: Christopher Larson
  Cc: Christopher Larson, Patches and discussions about the oe-core layer

On Mon, Nov 25, 2019 at 2:13 PM Christopher Larson <kergoth@gmail.com> wrote:
>
> From: Christopher Larson <chris_larson@mentor.com>
>
> The libcap-ng build doesn't pass -pthread and can fail to link.
>

perhaps, adding a configure time check for pthread.h would be possible

AC_CHECK_HEADERS(pthread.h, [], [AC_MSG_WARN(pthread.h not found,
pthread_atfork disabled.)])

then include pthread.h inside conditional like below in source files.

#ifdef HAVE_PTHREAD_H
#endif



> Signed-off-by: Christopher Larson <chris_larson@mentor.com>
> ---
>  meta/recipes-support/libcap-ng/libcap-ng.inc       |  1 +
>  .../libcap-ng/revert-pthread_atfork-fix.patch      | 56 ++++++++++++++++++++++
>  2 files changed, 57 insertions(+)
>  create mode 100644 meta/recipes-support/libcap-ng/libcap-ng/revert-pthread_atfork-fix.patch
>
> diff --git a/meta/recipes-support/libcap-ng/libcap-ng.inc b/meta/recipes-support/libcap-ng/libcap-ng.inc
> index aec83896e4..46d37e6807 100644
> --- a/meta/recipes-support/libcap-ng/libcap-ng.inc
> +++ b/meta/recipes-support/libcap-ng/libcap-ng.inc
> @@ -9,6 +9,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
>
>  SRC_URI = "http://people.redhat.com/sgrubb/libcap-ng/libcap-ng-${PV}.tar.gz \
>             file://python.patch \
> +           file://revert-pthread_atfork-fix.patch \
>  "
>
>  SRC_URI[md5sum] = "57dc267e2949cdecb651a929f9206572"
> diff --git a/meta/recipes-support/libcap-ng/libcap-ng/revert-pthread_atfork-fix.patch b/meta/recipes-support/libcap-ng/libcap-ng/revert-pthread_atfork-fix.patch
> new file mode 100644
> index 0000000000..d3f7790b1e
> --- /dev/null
> +++ b/meta/recipes-support/libcap-ng/libcap-ng/revert-pthread_atfork-fix.patch
> @@ -0,0 +1,56 @@
> +From 81dc82393fae9851397fa5d94094434aa1d5c3d1 Mon Sep 17 00:00:00 2001
> +From: Christopher Larson <chris_larson@mentor.com>
> +Date: Thu, 14 Nov 2019 21:13:24 +0500
> +Subject: [PATCH] Revert "Fix usage of pthread_atfork a whole different way"
> +
> +This reverts commit 08a09cba90f3d960c080a20833fb8c0908f1cea6.
> +
> +The fix was breaking builds with some toolchains.
> +
> +Signed-off-by: Christopher Larson <chris_larson@mentor.com>
> +---
> + src/Makefile.am |  2 +-
> + src/cap-ng.c    | 12 +++++++++++-
> + 2 files changed, 12 insertions(+), 2 deletions(-)
> +
> +diff --git a/src/Makefile.am b/src/Makefile.am
> +index 5a66d4e..d46d02b 100644
> +--- a/src/Makefile.am
> ++++ b/src/Makefile.am
> +@@ -34,5 +34,5 @@ noinst_HEADERS = captab.h
> + libcap_ng_la_SOURCES = cap-ng.c lookup_table.c
> + libcap_ng_la_LIBADD =
> + libcap_ng_la_DEPENDENCIES = $(libcap_ng_la_SOURCES) ../config.h
> +-libcap_ng_la_LDFLAGS = -Wl,-z,relro
> ++libcap_ng_la_LDFLAGS = -Wl,-z,relro -Wl,-z,nodelete
> +
> +diff --git a/src/cap-ng.c b/src/cap-ng.c
> +index 35fcd7a..ed31afa 100644
> +--- a/src/cap-ng.c
> ++++ b/src/cap-ng.c
> +@@ -155,6 +155,15 @@ static __thread struct cap_ng m = { 1,
> +                                       CAPNG_NEW,
> +                                       {0, 0} };
> +
> ++
> ++/*
> ++ * The pthread_atfork function is being made weak so that we can use it
> ++ * if the program is linked with pthreads and not requiring it for
> ++ * everything that uses libcap-ng.
> ++ */
> ++extern int __attribute__((weak)) pthread_atfork(void (*prepare)(void),
> ++      void (*parent)(void), void (*child)(void));
> ++
> + /*
> +  * Reset the state so that init gets called to erase everything
> +  */
> +@@ -166,7 +175,8 @@ static void deinit(void)
> + static void init_lib(void) __attribute__ ((constructor));
> + static void init_lib(void)
> + {
> +-      pthread_atfork(NULL, NULL, deinit);
> ++      if (pthread_atfork)
> ++              pthread_atfork(NULL, NULL, deinit);
> + }
> +
> + static void init(void)
> --
> 2.11.1
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/3] dosfstools: fix CP437 error from `dosfsck -l`
  2019-11-25 22:13 ` [PATCH 2/3] dosfstools: fix CP437 error from `dosfsck -l` Christopher Larson
@ 2019-11-25 22:28   ` Khem Raj
  2019-11-25 22:38     ` Christopher Larson
  0 siblings, 1 reply; 9+ messages in thread
From: Khem Raj @ 2019-11-25 22:28 UTC (permalink / raw)
  To: Christopher Larson
  Cc: Christopher Larson, Patches and discussions about the oe-core layer

On Mon, Nov 25, 2019 at 2:12 PM Christopher Larson <kergoth@gmail.com> wrote:
>
> From: Christopher Larson <chris_larson@mentor.com>
>
> Fix this error seen when using dosfsck -l to list fs contents:
>
>     CP437: Invalid argument
>
> Signed-off-by: Christopher Larson <chris_larson@mentor.com>
> ---
>  meta/recipes-devtools/dosfstools/dosfstools_4.1.bb | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/meta/recipes-devtools/dosfstools/dosfstools_4.1.bb b/meta/recipes-devtools/dosfstools/dosfstools_4.1.bb
> index 69aa81af44..c99d2019c8 100644
> --- a/meta/recipes-devtools/dosfstools/dosfstools_4.1.bb
> +++ b/meta/recipes-devtools/dosfstools/dosfstools_4.1.bb
> @@ -23,3 +23,6 @@ EXTRA_OECONF = "--without-udev --enable-compat-symlinks"
>  CFLAGS += "-D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
>
>  BBCLASSEXTEND = "native"
> +
> +# Add codepage437 to avoid error from `dosfsck -l`
> +RRECOMMENDS_${PN}_append_libc-glibc += "glibc-gconv-ibm437"

I think += should be dropped

> --
> 2.11.1
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


^ permalink raw reply	[flat|nested] 9+ messages in thread

* ✗ patchtest: failure for "acpica: correct flex/bison dep..." and 2 more
  2019-11-25 22:13 [PATCH 1/3] acpica: correct flex/bison deps, add explicit m4-native dep Christopher Larson
  2019-11-25 22:13 ` [PATCH 2/3] dosfstools: fix CP437 error from `dosfsck -l` Christopher Larson
  2019-11-25 22:13 ` [PATCH 3/3] libcap-ng: fix built failure with some external toolchains due to missing pthread Christopher Larson
@ 2019-11-25 22:32 ` Patchwork
  2 siblings, 0 replies; 9+ messages in thread
From: Patchwork @ 2019-11-25 22:32 UTC (permalink / raw)
  To: Christopher Larson; +Cc: openembedded-core

== Series Details ==

Series: "acpica: correct flex/bison dep..." and 2 more
Revision: 1
URL   : https://patchwork.openembedded.org/series/21349/
State : failure

== Summary ==


Thank you for submitting this patch series to OpenEmbedded Core. This is
an automated response. Several tests have been executed on the proposed
series by patchtest resulting in the following failures:



* Issue             Added patch file is missing Upstream-Status in the header [test_upstream_status_presence_format] 
  Suggested fix    Add Upstream-Status: <Valid status> to the header of meta/recipes-support/libcap-ng/libcap-ng/revert-pthread_atfork-fix.patch
  Standard format  Upstream-Status: <Valid status>
  Valid status     Pending, Accepted, Backport, Denied, Inappropriate [reason], Submitted [where]



If you believe any of these test results are incorrect, please reply to the
mailing list (openembedded-core@lists.openembedded.org) raising your concerns.
Otherwise we would appreciate you correcting the issues and submitting a new
version of the patchset if applicable. Please ensure you add/increment the
version number when sending the new version (i.e. [PATCH] -> [PATCH v2] ->
[PATCH v3] -> ...).

---
Guidelines:     https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/3] dosfstools: fix CP437 error from `dosfsck -l`
  2019-11-25 22:28   ` Khem Raj
@ 2019-11-25 22:38     ` Christopher Larson
  0 siblings, 0 replies; 9+ messages in thread
From: Christopher Larson @ 2019-11-25 22:38 UTC (permalink / raw)
  To: Christopher Larson, Khem Raj
  Cc: Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 1430 bytes --]

Good call, no idea how I missed that one.
On Nov 25, 2019, 3:28 PM -0700, Khem Raj <raj.khem@gmail.com>, wrote:
> On Mon, Nov 25, 2019 at 2:12 PM Christopher Larson <kergoth@gmail.com> wrote:
> >
> > From: Christopher Larson <chris_larson@mentor.com>
> >
> > Fix this error seen when using dosfsck -l to list fs contents:
> >
> > CP437: Invalid argument
> >
> > Signed-off-by: Christopher Larson <chris_larson@mentor.com>
> > ---
> > meta/recipes-devtools/dosfstools/dosfstools_4.1.bb | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/meta/recipes-devtools/dosfstools/dosfstools_4.1.bb b/meta/recipes-devtools/dosfstools/dosfstools_4.1.bb
> > index 69aa81af44..c99d2019c8 100644
> > --- a/meta/recipes-devtools/dosfstools/dosfstools_4.1.bb
> > +++ b/meta/recipes-devtools/dosfstools/dosfstools_4.1.bb
> > @@ -23,3 +23,6 @@ EXTRA_OECONF = "--without-udev --enable-compat-symlinks"
> > CFLAGS += "-D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
> >
> > BBCLASSEXTEND = "native"
> > +
> > +# Add codepage437 to avoid error from `dosfsck -l`
> > +RRECOMMENDS_${PN}_append_libc-glibc += "glibc-gconv-ibm437"
>
> I think += should be dropped
>
> > --
> > 2.11.1
> >
> > --
> > _______________________________________________
> > Openembedded-core mailing list
> > Openembedded-core@lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/openembedded-core

[-- Attachment #2: Type: text/html, Size: 2162 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/3] libcap-ng: fix built failure with some external toolchains due to missing pthread
  2019-11-25 22:27   ` Khem Raj
@ 2019-11-25 22:40     ` Christopher Larson
  2019-11-26 17:29     ` Christopher Larson
  1 sibling, 0 replies; 9+ messages in thread
From: Christopher Larson @ 2019-11-25 22:40 UTC (permalink / raw)
  To: Christopher Larson, Khem Raj
  Cc: Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 4539 bytes --]

It seems like libcap wants to support use of pthread by the linking application without mandating it, so we can’t pass -pthread, and I’m not sure a configure check would help, unless it wants to pull in pthread unconditionally. But I may be misunderstanding the libcap commits, and am *definitely* not a threading expert :)
On Nov 25, 2019, 3:27 PM -0700, Khem Raj <raj.khem@gmail.com>, wrote:
> On Mon, Nov 25, 2019 at 2:13 PM Christopher Larson <kergoth@gmail.com> wrote:
> >
> > From: Christopher Larson <chris_larson@mentor.com>
> >
> > The libcap-ng build doesn't pass -pthread and can fail to link.
> >
>
> perhaps, adding a configure time check for pthread.h would be possible
>
> AC_CHECK_HEADERS(pthread.h, [], [AC_MSG_WARN(pthread.h not found,
> pthread_atfork disabled.)])
>
> then include pthread.h inside conditional like below in source files.
>
> #ifdef HAVE_PTHREAD_H
> #endif
>
>
>
> > Signed-off-by: Christopher Larson <chris_larson@mentor.com>
> > ---
> > meta/recipes-support/libcap-ng/libcap-ng.inc | 1 +
> > .../libcap-ng/revert-pthread_atfork-fix.patch | 56 ++++++++++++++++++++++
> > 2 files changed, 57 insertions(+)
> > create mode 100644 meta/recipes-support/libcap-ng/libcap-ng/revert-pthread_atfork-fix.patch
> >
> > diff --git a/meta/recipes-support/libcap-ng/libcap-ng.inc b/meta/recipes-support/libcap-ng/libcap-ng.inc
> > index aec83896e4..46d37e6807 100644
> > --- a/meta/recipes-support/libcap-ng/libcap-ng.inc
> > +++ b/meta/recipes-support/libcap-ng/libcap-ng.inc
> > @@ -9,6 +9,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
> >
> > SRC_URI = "http://people.redhat.com/sgrubb/libcap-ng/libcap-ng-${PV}.tar.gz \
> > file://python.patch \
> > + file://revert-pthread_atfork-fix.patch \
> > "
> >
> > SRC_URI[md5sum] = "57dc267e2949cdecb651a929f9206572"
> > diff --git a/meta/recipes-support/libcap-ng/libcap-ng/revert-pthread_atfork-fix.patch b/meta/recipes-support/libcap-ng/libcap-ng/revert-pthread_atfork-fix.patch
> > new file mode 100644
> > index 0000000000..d3f7790b1e
> > --- /dev/null
> > +++ b/meta/recipes-support/libcap-ng/libcap-ng/revert-pthread_atfork-fix.patch
> > @@ -0,0 +1,56 @@
> > +From 81dc82393fae9851397fa5d94094434aa1d5c3d1 Mon Sep 17 00:00:00 2001
> > +From: Christopher Larson <chris_larson@mentor.com>
> > +Date: Thu, 14 Nov 2019 21:13:24 +0500
> > +Subject: [PATCH] Revert "Fix usage of pthread_atfork a whole different way"
> > +
> > +This reverts commit 08a09cba90f3d960c080a20833fb8c0908f1cea6.
> > +
> > +The fix was breaking builds with some toolchains.
> > +
> > +Signed-off-by: Christopher Larson <chris_larson@mentor.com>
> > +---
> > + src/Makefile.am | 2 +-
> > + src/cap-ng.c | 12 +++++++++++-
> > + 2 files changed, 12 insertions(+), 2 deletions(-)
> > +
> > +diff --git a/src/Makefile.am b/src/Makefile.am
> > +index 5a66d4e..d46d02b 100644
> > +--- a/src/Makefile.am
> > ++++ b/src/Makefile.am
> > +@@ -34,5 +34,5 @@ noinst_HEADERS = captab.h
> > + libcap_ng_la_SOURCES = cap-ng.c lookup_table.c
> > + libcap_ng_la_LIBADD =
> > + libcap_ng_la_DEPENDENCIES = $(libcap_ng_la_SOURCES) ../config.h
> > +-libcap_ng_la_LDFLAGS = -Wl,-z,relro
> > ++libcap_ng_la_LDFLAGS = -Wl,-z,relro -Wl,-z,nodelete
> > +
> > +diff --git a/src/cap-ng.c b/src/cap-ng.c
> > +index 35fcd7a..ed31afa 100644
> > +--- a/src/cap-ng.c
> > ++++ b/src/cap-ng.c
> > +@@ -155,6 +155,15 @@ static __thread struct cap_ng m = { 1,
> > + CAPNG_NEW,
> > + {0, 0} };
> > +
> > ++
> > ++/*
> > ++ * The pthread_atfork function is being made weak so that we can use it
> > ++ * if the program is linked with pthreads and not requiring it for
> > ++ * everything that uses libcap-ng.
> > ++ */
> > ++extern int __attribute__((weak)) pthread_atfork(void (*prepare)(void),
> > ++ void (*parent)(void), void (*child)(void));
> > ++
> > + /*
> > + * Reset the state so that init gets called to erase everything
> > + */
> > +@@ -166,7 +175,8 @@ static void deinit(void)
> > + static void init_lib(void) __attribute__ ((constructor));
> > + static void init_lib(void)
> > + {
> > +- pthread_atfork(NULL, NULL, deinit);
> > ++ if (pthread_atfork)
> > ++ pthread_atfork(NULL, NULL, deinit);
> > + }
> > +
> > + static void init(void)
> > --
> > 2.11.1
> >
> > --
> > _______________________________________________
> > Openembedded-core mailing list
> > Openembedded-core@lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/openembedded-core

[-- Attachment #2: Type: text/html, Size: 5454 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/3] libcap-ng: fix built failure with some external toolchains due to missing pthread
  2019-11-25 22:27   ` Khem Raj
  2019-11-25 22:40     ` Christopher Larson
@ 2019-11-26 17:29     ` Christopher Larson
  1 sibling, 0 replies; 9+ messages in thread
From: Christopher Larson @ 2019-11-26 17:29 UTC (permalink / raw)
  To: Christopher Larson, Khem Raj
  Cc: Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 4316 bytes --]

Testing with https://github.com/stevegrubb/libcap-ng/pull/10 + HAVE_PTHREAD_H conditional now. Thanks.
On Nov 25, 2019, 3:27 PM -0700, Khem Raj <raj.khem@gmail.com>, wrote:
> On Mon, Nov 25, 2019 at 2:13 PM Christopher Larson <kergoth@gmail.com> wrote:
> >
> > From: Christopher Larson <chris_larson@mentor.com>
> >
> > The libcap-ng build doesn't pass -pthread and can fail to link.
> >
>
> perhaps, adding a configure time check for pthread.h would be possible
>
> AC_CHECK_HEADERS(pthread.h, [], [AC_MSG_WARN(pthread.h not found,
> pthread_atfork disabled.)])
>
> then include pthread.h inside conditional like below in source files.
>
> #ifdef HAVE_PTHREAD_H
> #endif
>
>
>
> > Signed-off-by: Christopher Larson <chris_larson@mentor.com>
> > ---
> > meta/recipes-support/libcap-ng/libcap-ng.inc | 1 +
> > .../libcap-ng/revert-pthread_atfork-fix.patch | 56 ++++++++++++++++++++++
> > 2 files changed, 57 insertions(+)
> > create mode 100644 meta/recipes-support/libcap-ng/libcap-ng/revert-pthread_atfork-fix.patch
> >
> > diff --git a/meta/recipes-support/libcap-ng/libcap-ng.inc b/meta/recipes-support/libcap-ng/libcap-ng.inc
> > index aec83896e4..46d37e6807 100644
> > --- a/meta/recipes-support/libcap-ng/libcap-ng.inc
> > +++ b/meta/recipes-support/libcap-ng/libcap-ng.inc
> > @@ -9,6 +9,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
> >
> > SRC_URI = "http://people.redhat.com/sgrubb/libcap-ng/libcap-ng-${PV}.tar.gz \
> > file://python.patch \
> > + file://revert-pthread_atfork-fix.patch \
> > "
> >
> > SRC_URI[md5sum] = "57dc267e2949cdecb651a929f9206572"
> > diff --git a/meta/recipes-support/libcap-ng/libcap-ng/revert-pthread_atfork-fix.patch b/meta/recipes-support/libcap-ng/libcap-ng/revert-pthread_atfork-fix.patch
> > new file mode 100644
> > index 0000000000..d3f7790b1e
> > --- /dev/null
> > +++ b/meta/recipes-support/libcap-ng/libcap-ng/revert-pthread_atfork-fix.patch
> > @@ -0,0 +1,56 @@
> > +From 81dc82393fae9851397fa5d94094434aa1d5c3d1 Mon Sep 17 00:00:00 2001
> > +From: Christopher Larson <chris_larson@mentor.com>
> > +Date: Thu, 14 Nov 2019 21:13:24 +0500
> > +Subject: [PATCH] Revert "Fix usage of pthread_atfork a whole different way"
> > +
> > +This reverts commit 08a09cba90f3d960c080a20833fb8c0908f1cea6.
> > +
> > +The fix was breaking builds with some toolchains.
> > +
> > +Signed-off-by: Christopher Larson <chris_larson@mentor.com>
> > +---
> > + src/Makefile.am | 2 +-
> > + src/cap-ng.c | 12 +++++++++++-
> > + 2 files changed, 12 insertions(+), 2 deletions(-)
> > +
> > +diff --git a/src/Makefile.am b/src/Makefile.am
> > +index 5a66d4e..d46d02b 100644
> > +--- a/src/Makefile.am
> > ++++ b/src/Makefile.am
> > +@@ -34,5 +34,5 @@ noinst_HEADERS = captab.h
> > + libcap_ng_la_SOURCES = cap-ng.c lookup_table.c
> > + libcap_ng_la_LIBADD =
> > + libcap_ng_la_DEPENDENCIES = $(libcap_ng_la_SOURCES) ../config.h
> > +-libcap_ng_la_LDFLAGS = -Wl,-z,relro
> > ++libcap_ng_la_LDFLAGS = -Wl,-z,relro -Wl,-z,nodelete
> > +
> > +diff --git a/src/cap-ng.c b/src/cap-ng.c
> > +index 35fcd7a..ed31afa 100644
> > +--- a/src/cap-ng.c
> > ++++ b/src/cap-ng.c
> > +@@ -155,6 +155,15 @@ static __thread struct cap_ng m = { 1,
> > + CAPNG_NEW,
> > + {0, 0} };
> > +
> > ++
> > ++/*
> > ++ * The pthread_atfork function is being made weak so that we can use it
> > ++ * if the program is linked with pthreads and not requiring it for
> > ++ * everything that uses libcap-ng.
> > ++ */
> > ++extern int __attribute__((weak)) pthread_atfork(void (*prepare)(void),
> > ++ void (*parent)(void), void (*child)(void));
> > ++
> > + /*
> > + * Reset the state so that init gets called to erase everything
> > + */
> > +@@ -166,7 +175,8 @@ static void deinit(void)
> > + static void init_lib(void) __attribute__ ((constructor));
> > + static void init_lib(void)
> > + {
> > +- pthread_atfork(NULL, NULL, deinit);
> > ++ if (pthread_atfork)
> > ++ pthread_atfork(NULL, NULL, deinit);
> > + }
> > +
> > + static void init(void)
> > --
> > 2.11.1
> >
> > --
> > _______________________________________________
> > Openembedded-core mailing list
> > Openembedded-core@lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/openembedded-core

[-- Attachment #2: Type: text/html, Size: 5301 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-11-26 17:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-25 22:13 [PATCH 1/3] acpica: correct flex/bison deps, add explicit m4-native dep Christopher Larson
2019-11-25 22:13 ` [PATCH 2/3] dosfstools: fix CP437 error from `dosfsck -l` Christopher Larson
2019-11-25 22:28   ` Khem Raj
2019-11-25 22:38     ` Christopher Larson
2019-11-25 22:13 ` [PATCH 3/3] libcap-ng: fix built failure with some external toolchains due to missing pthread Christopher Larson
2019-11-25 22:27   ` Khem Raj
2019-11-25 22:40     ` Christopher Larson
2019-11-26 17:29     ` Christopher Larson
2019-11-25 22:32 ` ✗ patchtest: failure for "acpica: correct flex/bison dep..." and 2 more Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.