All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] procps-ng: fix BR2_STATIC_LIBS=y build
@ 2016-08-07  9:19 Thomas Petazzoni
  2016-08-07 14:31 ` Khem Raj
  2016-08-09 13:49 ` Thomas Petazzoni
  0 siblings, 2 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2016-08-07  9:19 UTC (permalink / raw)
  To: buildroot

The procps-ng package currently fails to build on BR2_STATIC_LIBS=y
configurations. Indeed, by default NUMA support is enabled, and it
requires dlopen(). As hinted by the configure script, passing
--disable-numa allows to disable NUMA support.

However, once this is done, another issue pops up: dlopen() is also used
by the SELinux support. But even when SELinux support is disabled, the
procps-ng code incorrectly includes <dlfcn.h>. This is addressed by the
addition of a patch.

Fixes:

  http://autobuild.buildroot.net/results/b385bf435085728aece6323a5006ba9fa6631744/

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 ...put.c-include-dlfcn.h-only-when-necessary.patch | 32 ++++++++++++++++++++++
 package/procps-ng/procps-ng.mk                     |  6 ++++
 2 files changed, 38 insertions(+)
 create mode 100644 package/procps-ng/0003-ps-output.c-include-dlfcn.h-only-when-necessary.patch

diff --git a/package/procps-ng/0003-ps-output.c-include-dlfcn.h-only-when-necessary.patch b/package/procps-ng/0003-ps-output.c-include-dlfcn.h-only-when-necessary.patch
new file mode 100644
index 0000000..dca28fa
--- /dev/null
+++ b/package/procps-ng/0003-ps-output.c-include-dlfcn.h-only-when-necessary.patch
@@ -0,0 +1,32 @@
+From 4fc9a348026a945aec8eddffc7613de9cb10b10c Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Sun, 7 Aug 2016 11:08:26 +0200
+Subject: [PATCH] ps/output.c: include <dlfcn.h> only when necessary
+
+dlopen() functionality is only used when SELinux support is enabled, so
+<dlfcn.h> only needs to be included when ENABLE_LIBSELINUX is
+defined. This fixes the build in configurations where <dlfcn.h> is not
+available.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ ps/output.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/ps/output.c b/ps/output.c
+index 42c04cf..f540832 100644
+--- a/ps/output.c
++++ b/ps/output.c
+@@ -46,7 +46,9 @@
+  */
+ 
+ #include <ctype.h>
++#if ENABLE_LIBSELINUX
+ #include <dlfcn.h>
++#endif
+ #include <fcntl.h>
+ #include <grp.h>
+ #include <limits.h>
+-- 
+2.7.4
+
diff --git a/package/procps-ng/procps-ng.mk b/package/procps-ng/procps-ng.mk
index 51a70a5..ce0f68a 100644
--- a/package/procps-ng/procps-ng.mk
+++ b/package/procps-ng/procps-ng.mk
@@ -47,4 +47,10 @@ PROCPS_NG_CONF_OPTS += \
 	--enable-watch8bit
 endif
 
+# numa support requires libdl, so explicitly disable it when
+# BR2_STATIC_LIBS=y
+ifeq ($(BR2_STATIC_LIBS),y)
+PROCPS_NG_CONF_OPTS += --disable-numa
+endif
+
 $(eval $(autotools-package))
-- 
2.7.4

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

* [Buildroot] [PATCH] procps-ng: fix BR2_STATIC_LIBS=y build
  2016-08-07  9:19 [Buildroot] [PATCH] procps-ng: fix BR2_STATIC_LIBS=y build Thomas Petazzoni
@ 2016-08-07 14:31 ` Khem Raj
  2016-08-07 19:41   ` Thomas Petazzoni
  2016-08-09 13:49 ` Thomas Petazzoni
  1 sibling, 1 reply; 4+ messages in thread
From: Khem Raj @ 2016-08-07 14:31 UTC (permalink / raw)
  To: buildroot


> On Aug 7, 2016, at 2:19 AM, Thomas Petazzoni <thomas.petazzoni@free-electrons.com> wrote:
> 
> The procps-ng package currently fails to build on BR2_STATIC_LIBS=y
> configurations. Indeed, by default NUMA support is enabled, and it
> requires dlopen(). As hinted by the configure script, passing
> --disable-numa allows to disable NUMA support.
> 
> However, once this is done, another issue pops up: dlopen() is also used
> by the SELinux support. But even when SELinux support is disabled, the
> procps-ng code incorrectly includes <dlfcn.h>. This is addressed by the
> addition of a patch.
> 
> Fixes:
> 
>  http://autobuild.buildroot.net/results/b385bf435085728aece6323a5006ba9fa6631744/
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
> ...put.c-include-dlfcn.h-only-when-necessary.patch | 32 ++++++++++++++++++++++
> package/procps-ng/procps-ng.mk                     |  6 ++++
> 2 files changed, 38 insertions(+)
> create mode 100644 package/procps-ng/0003-ps-output.c-include-dlfcn.h-only-when-necessary.patch
> 
> diff --git a/package/procps-ng/0003-ps-output.c-include-dlfcn.h-only-when-necessary.patch b/package/procps-ng/0003-ps-output.c-include-dlfcn.h-only-when-necessary.patch
> new file mode 100644
> index 0000000..dca28fa
> --- /dev/null
> +++ b/package/procps-ng/0003-ps-output.c-include-dlfcn.h-only-when-necessary.patch
> @@ -0,0 +1,32 @@
> +From 4fc9a348026a945aec8eddffc7613de9cb10b10c Mon Sep 17 00:00:00 2001
> +From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> +Date: Sun, 7 Aug 2016 11:08:26 +0200
> +Subject: [PATCH] ps/output.c: include <dlfcn.h> only when necessary
> +
> +dlopen() functionality is only used when SELinux support is enabled, so
> +<dlfcn.h> only needs to be included when ENABLE_LIBSELINUX is
> +defined. This fixes the build in configurations where <dlfcn.h> is not
> +available.
> +
> +Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> +---
> + ps/output.c | 2 ++
> + 1 file changed, 2 insertions(+)
> +
> +diff --git a/ps/output.c b/ps/output.c
> +index 42c04cf..f540832 100644
> +--- a/ps/output.c
> ++++ b/ps/output.c
> +@@ -46,7 +46,9 @@
> +  */
> + 
> + #include <ctype.h>
> ++#if ENABLE_LIBSELINUX

Should this check be numa | selinux

> + #include <dlfcn.h>
> ++#endif
> + #include <fcntl.h>
> + #include <grp.h>
> + #include <limits.h>
> +-- 
> +2.7.4
> +
> diff --git a/package/procps-ng/procps-ng.mk b/package/procps-ng/procps-ng.mk
> index 51a70a5..ce0f68a 100644
> --- a/package/procps-ng/procps-ng.mk
> +++ b/package/procps-ng/procps-ng.mk
> @@ -47,4 +47,10 @@ PROCPS_NG_CONF_OPTS += \
>    --enable-watch8bit
> endif
> 
> +# numa support requires libdl, so explicitly disable it when
> +# BR2_STATIC_LIBS=y
> +ifeq ($(BR2_STATIC_LIBS),y)
> +PROCPS_NG_CONF_OPTS += --disable-numa
> +endif
> +
> $(eval $(autotools-package))
> -- 
> 2.7.4
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

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

* [Buildroot] [PATCH] procps-ng: fix BR2_STATIC_LIBS=y build
  2016-08-07 14:31 ` Khem Raj
@ 2016-08-07 19:41   ` Thomas Petazzoni
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2016-08-07 19:41 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun, 7 Aug 2016 07:31:43 -0700, Khem Raj wrote:

> > + #include <ctype.h>
> > ++#if ENABLE_LIBSELINUX  
> 
> Should this check be numa | selinux

Nope: in this file there is only one use of dlopen(), and it's related
to SELinux.

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH] procps-ng: fix BR2_STATIC_LIBS=y build
  2016-08-07  9:19 [Buildroot] [PATCH] procps-ng: fix BR2_STATIC_LIBS=y build Thomas Petazzoni
  2016-08-07 14:31 ` Khem Raj
@ 2016-08-09 13:49 ` Thomas Petazzoni
  1 sibling, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2016-08-09 13:49 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun,  7 Aug 2016 11:19:11 +0200, Thomas Petazzoni wrote:
> The procps-ng package currently fails to build on BR2_STATIC_LIBS=y
> configurations. Indeed, by default NUMA support is enabled, and it
> requires dlopen(). As hinted by the configure script, passing
> --disable-numa allows to disable NUMA support.
> 
> However, once this is done, another issue pops up: dlopen() is also used
> by the SELinux support. But even when SELinux support is disabled, the
> procps-ng code incorrectly includes <dlfcn.h>. This is addressed by the
> addition of a patch.
> 
> Fixes:
> 
>   http://autobuild.buildroot.net/results/b385bf435085728aece6323a5006ba9fa6631744/
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
>  ...put.c-include-dlfcn.h-only-when-necessary.patch | 32 ++++++++++++++++++++++
>  package/procps-ng/procps-ng.mk                     |  6 ++++
>  2 files changed, 38 insertions(+)
>  create mode 100644 package/procps-ng/0003-ps-output.c-include-dlfcn.h-only-when-necessary.patch

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

end of thread, other threads:[~2016-08-09 13:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-07  9:19 [Buildroot] [PATCH] procps-ng: fix BR2_STATIC_LIBS=y build Thomas Petazzoni
2016-08-07 14:31 ` Khem Raj
2016-08-07 19:41   ` Thomas Petazzoni
2016-08-09 13:49 ` Thomas Petazzoni

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.