Skip to contentSkip to conversation

package/eudev: add libselinux dependency

PATCH New Romain Naour 2 participants 4 messages Jul 30, 2015 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/eudev: add libselinux dependency

Disable libselinux support with musl toolchains which doesn't have struct mallinfo.

selinux-util.c: In function ?mac_selinux_init?:
selinux-util.c:70:25: error: storage size of ?before_mallinfo? isn?t known

         struct mallinfo before_mallinfo, after_mallinfo;
Cc Clayton Shotwell <[email protected]>
---
 package/eudev/eudev.mk | 9 +++++++++
 1 file changed, 9 insertions(+)
package/eudev/eudev.mk +9 -0
index 87bce3e..f904cdd 100644
@@ -44,6 +44,15 @@ else
 EUDEV_CONF_OPTS += --disable-gudev
 endif
 
+# Disable selinux support with musl toolchains which doesn't have
+# struct mallinfo.
+ifeq ($(BR2_PACKAGE_LIBSELINUX)x$(BR2_TOOLCHAIN_USES_MUSL),yx)
+EUDEV_CONF_OPTS += --enable-selinux
+EUDEV_DEPENDENCIES += libselinux
+else
+EUDEV_CONF_OPTS += --disable-selinux
+endif
+
 define EUDEV_INSTALL_INIT_SYSV
 	$(INSTALL) -m 0755 package/eudev/S10udev $(TARGET_DIR)/etc/init.d/S10udev
 endef
Signature · 1 line
2.4.3
#1 lore raw

PATCH 1/1 package/eudev: add libselinux dependency

Dear Romain Naour,

Quoted 9 lines · Romain Naour

Disable libselinux support with musl toolchains which doesn't have struct mallinfo.

selinux-util.c: In function ?mac_selinux_init?:
selinux-util.c:70:25: error: storage size of ?before_mallinfo? isn?t known

         struct mallinfo before_mallinfo, after_mallinfo;
Cc Clayton Shotwell <[email protected]>

Thanks for the patch, however I am not sure this is really the right fix. mallinfo() is only used to display some statistics about the heap consumption of the SELinux database, so it could be disabled.

So the right fix would be to add a configure.ac check for mallinfo(), and if available, use it, and if not, remove this useless debug message.

Like in configure.ac:

AC_CHECK_FUNCS([mallinfo])

and then use #ifdef HAVE_MALLINFO in the code.

Now the question is whether something like that would be accepted upstream. If eudev accepts its own patches that are not in systemd, then I'd say yes. If however they are really only a copy of the udev sources from systemd, we would have to get this upstream in systemd, which has no chance to happen.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#2 lore raw

PATCH 1/1 package/eudev: add libselinux dependency

Hi Thomas, All,

Le 30/07/2015 15:48, Thomas Petazzoni a ?crit :

Quoted 17 lines

Dear Romain Naour,

Quoted 9 lines · Romain Naour

Disable libselinux support with musl toolchains which doesn't have struct mallinfo.

selinux-util.c: In function ?mac_selinux_init?:
selinux-util.c:70:25: error: storage size of ?before_mallinfo? isn?t known

         struct mallinfo before_mallinfo, after_mallinfo;
Cc Clayton Shotwell <[email protected]>

Thanks for the patch, however I am not sure this is really the right fix. mallinfo() is only used to display some statistics about the heap consumption of the SELinux database, so it could be disabled.

Quoted 8 lines

So the right fix would be to add a configure.ac check for mallinfo(), and if available, use it, and if not, remove this useless debug message.

Like in configure.ac:

AC_CHECK_FUNCS([mallinfo])

and then use #ifdef HAVE_MALLINFO in the code.

Ok, I'll try that.
It's true that my patch is a bit rude... ;-)

Quoted 6 lines

Now the question is whether something like that would be accepted upstream. If eudev accepts its own patches that are not in systemd, then I'd say yes. If however they are really only a copy of the udev sources from systemd, we would have to get this upstream in systemd, which has no chance to happen.

I don't know, I'm adding Anthony G. Basile in Cc. Anthony, what do you think about Thomas's proposal ?

Best regards,
Romain

Quoted 3 lines

Thomas

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw

PATCH 1/1 package/eudev: add libselinux dependency

Hi,

Le 30/07/2015 20:23, Anthony G. Basile a ?crit :

Quoted 2 lines · Romain Naour
Quoted 1 line

Hi Thomas, All,

[snip]

Quoted 4 lines
Quoted 1 line
Quoted 1 line

Yeah something like that would be acceptable. I definitely support musl. Submit it and we'll work at getting it in.

Done, see the pull request on github:
https://github.com/gentoo/eudev/pull/122

Thanks!

Best regards,
Romain Naour