Skip to contentSkip to conversation

package/libtalloc: update to add libtalloc

PATCH New jared.bents at rockwellcollins.com 2 participants 3 messages Jan 29, 2020 – Feb 7, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/libtalloc: update to add libtalloc

From: Jared Bents <[email protected]>

update to add libtalloc as a package

---
 package/Config.in                |  1 +
 package/libtalloc/Config.in      |  8 ++++
 package/libtalloc/libtalloc.hash |  2 +
 package/libtalloc/libtalloc.mk   | 74 ++++++++++++++++++++++++++++++++
 4 files changed, 85 insertions(+)
 create mode 100644 package/libtalloc/Config.in
 create mode 100644 package/libtalloc/libtalloc.hash
 create mode 100644 package/libtalloc/libtalloc.mk
package/Config.in +1 -0
index 091f5d39f7..37c2c3df12 100644
@@ -1769,6 +1769,7 @@ menu "Other"
 	source "package/libsigc/Config.in"
 	source "package/libsigsegv/Config.in"
 	source "package/libspatialindex/Config.in"
+	source "package/libtalloc/Config.in"
 	source "package/libtasn1/Config.in"
 	source "package/libtommath/Config.in"
 	source "package/libtpl/Config.in"
package/libtalloc/Config.in new file +8 -0
new file mode 100644
index 0000000000..168d367793
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_LIBTALLOC
+	bool "libtalloc"
+	help
+	  talloc is a hierarchical, reference counted memory pool
+	  system with destructors. It is the core memory allocator
+	  used in Samba.
+
+	  https://talloc.samba.org/talloc/doc/html/index.html
package/libtalloc/libtalloc.hash new file +2 -0
new file mode 100644
index 0000000000..ff1df0f8a9
@@ -0,0 +1,2 @@
+# Locally calculated after checking pgp signature
+sha256 ef4822d2fdafd2be8e0cabc3ec3c806ae29b8268e932c5e9a4cd5585f37f9f77  talloc-2.3.1.tar.gz
package/libtalloc/libtalloc.mk new file +74 -0

74 lines not on this page · raw message

Signature · 1 line
2.18.0
#1 lore raw

PATCH 1/1 package/libtalloc: update to add libtalloc

Hello Jared,

Thanks for your contribution. A number of comments/questions below.

Quoted 5 lines · On Wed, 29 Jan 2020 09:08:41 -0600 jared.bents at rockwellcollins.com wrote:
 package/Config.in                |  1 +
 package/libtalloc/Config.in      |  8 ++++
 package/libtalloc/libtalloc.hash |  2 +
 package/libtalloc/libtalloc.mk   | 74 ++++++++++++++++++++++++++++++++
 4 files changed, 85 insertions(+)

Entry missing in the DEVELOPERS file.

package/libtalloc/Config.in line 2

Quoted 8 lines
package/libtalloc/Config.in new file +2 -0
new file mode 100644
index 0000000000..168d367793
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_LIBTALLOC
+	bool "libtalloc"

Really no toolchain dependencies at all? Did you test this package with test-pkg ?

package/libtalloc/libtalloc.hash line 2

Quoted 8 lines
package/libtalloc/libtalloc.hash new file +2 -0
new file mode 100644
index 0000000000..ff1df0f8a9
@@ -0,0 +1,2 @@
+# Locally calculated after checking pgp signature
+sha256 ef4822d2fdafd2be8e0cabc3ec3c806ae29b8268e932c5e9a4cd5585f37f9f77  talloc-2.3.1.tar.gz

We will need a license file hash. See below.

Quoted 6 lines
package/libtalloc/libtalloc.mk new file +0 -0
new file mode 100644
index 0000000000..82a5bcb45e

package/libtalloc/libtalloc.mk line 10

Quoted 10 lines
package/libtalloc/libtalloc.mk new file +10 -0
@@ -0,0 +1,74 @@
+################################################################################
+#
+# libtalloc
+#
+################################################################################
+
+LIBTALLOC_VERSION = 2.3.1
+LIBTALLOC_SITE = https://www.samba.org/ftp/talloc
+LIBTALLOC_SOURCE = talloc-$(LIBTALLOC_VERSION).tar.gz
+LIBTALLOC_LICENSE = LGPL-3.0+

The python bindings are under GPL-3.0+

package/libtalloc/libtalloc.mk line 11

Quoted 1 line
package/libtalloc/libtalloc.mk new file +1 -0
+# no license file but available in source at man/talloc.3.xml

I suggest using talloc.h as the license file for LGPL-3.0+ and pytalloc.h as the license file for GPL-3.0+.

package/libtalloc/libtalloc.mk line 14

Quoted 3 lines
package/libtalloc/libtalloc.mk new file +3 -0
+LIBTALLOC_INSTALL_STAGING = YES
+LIBTALLOC_CFLAGS = $(TARGET_CFLAGS)
+LIBTALLOC_LDFLAGS = $(TARGET_LDFLAGS) $(TARGET_NLS_LIBS)

If you use TARGET_NLS_LIBS here, then you need $(TARGET_NLS_DEPENDENCIES) in the <pkg>_DEPENDENCIES variable. Make sure it is really needed though.

package/libtalloc/libtalloc.mk line 25

Quoted 11 lines
package/libtalloc/libtalloc.mk new file +11 -0
+LIBTALLOC_CONF_ENV = \
+	CFLAGS="$(LIBTALLOC_CFLAGS)" \
+	LDFLAGS="$(LIBTALLOC_LDFLAGS)" \
+	XSLTPROC=false \
+	WAF_NO_PREFORK=1
+
+ifeq ($(BR2_PACKAGE_LIBTIRPC),y)
+LIBTALLOC_CFLAGS += `$(PKG_CONFIG_HOST_BINARY) --cflags libtirpc`
+LIBTALLOC_LDFLAGS += `$(PKG_CONFIG_HOST_BINARY) --libs libtirpc`
+LIBTALLOC_DEPENDENCIES += libtirpc host-pkgconf
+endif

Are you sure libtirpc is really used by libtalloc ? I know it is checked in lib/replace/wscript, but I don't see where it gets used, and I don't see why a memory allocator library would care about RPC support. Could you comment on this ?

package/libtalloc/libtalloc.mk line 30

Quoted 5 lines
package/libtalloc/libtalloc.mk new file +5 -0
+
+ifeq ($(BR2_PACKAGE_PYTHON3),y)
+LIBTALLOC_PYTHON = \
+	PYTHON="$(HOST_DIR)/bin/python3" \
+	PYTHON_CONFIG="$(STAGING_DIR)/usr/bin/python3-config"

I'm not sure we need this LIBTALLOC_PYTHON variable, just put these variables in LIBTALLOC_MAKE_ENV, which itself is initially set to TARGET_MAKE_ENV, and then used in the commands.

package/libtalloc/libtalloc.mk line 35

Quoted 5 lines
package/libtalloc/libtalloc.mk new file +5 -0
+LIBTALLOC_DEPENDENCIES += host-python3 python3
+LIBTALLOC_CONF_ENV += \
+	$(LIBTALLOC_PYTHON) \
+	python_LDFLAGS="" \
+	python_LIBDIR=""

Setting these python_LDFLAGS and python_LIBDIR to empty values looks weird. Why do you need that? Aren't they empty by default anyway?

Quoted 8 lines
package/libtalloc/libtalloc.mk new file +8 -0
+define LIBTALLOC_CONFIGURE_CMDS
+	$(INSTALL) -m 0644 package/samba4/samba4-cache.txt $(@D)/cache.txt;
+	echo 'Checking uname machine type: $(BR2_ARCH)' >>$(@D)/cache.txt;
+	(cd $(@D); \
+		$(TARGET_CONFIGURE_OPTS) \
+		$(LIBTALLOC_CONF_ENV) \
+		./buildtools/bin/waf configure \
+			--prefix=/usr \

package/libtalloc/libtalloc.mk line 58

Quoted 10 lines
package/libtalloc/libtalloc.mk new file +10 -0
+			--sysconfdir=/etc \
+			--localstatedir=/var \
+			--with-libiconv=$(STAGING_DIR)/usr \
+			--cross-compile \
+			--cross-answers=$(@D)/cache.txt \
+			--hostcc=gcc \
+			--disable-rpath \
+			--disable-rpath-install \
+			--bundled-libraries='!asn1_compile,!compile_et' \
+			$(LIBTALLOC_CONF_OPTS) \

Why don't you use the waf-package infrastructure if this is a waf package ? Hm, I see samba4 is also not using the waf package infrastructure for some reason.

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw

PATCH 1/1 package/libtalloc: update to add libtalloc

Hi Thomas,

Quoted 8 lines · Thomas Petazzoni

Hello Jared,

Thanks for your contribution. A number of comments/questions below.

On Wed, 29 Jan 2020 09:08:41 -0600
jared.bents at rockwellcollins.com wrote:

Quoted 7 lines
Quoted 5 lines
 package/Config.in                |  1 +
 package/libtalloc/Config.in      |  8 ++++
 package/libtalloc/libtalloc.hash |  2 +
 package/libtalloc/libtalloc.mk   | 74 ++++++++++++++++++++++++++++++++
 4 files changed, 85 insertions(+)

Entry missing in the DEVELOPERS file.

Will include in v2

Quoted 12 lines

package/libtalloc/Config.in line 2

Quoted 9 lines
package/libtalloc/Config.in new file +2 -0
new file mode 100644
index 0000000000..168d367793
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_LIBTALLOC
+     bool "libtalloc"

Really no toolchain dependencies at all? Did you test this package with test-pkg ?

I missed the toolchain dependencies. Will add those in v2

Quoted 11 lines

package/libtalloc/libtalloc.hash line 2

Quoted 9 lines
package/libtalloc/libtalloc.hash new file +2 -0
new file mode 100644
index 0000000000..ff1df0f8a9
@@ -0,0 +1,2 @@
+# Locally calculated after checking pgp signature
+sha256 ef4822d2fdafd2be8e0cabc3ec3c806ae29b8268e932c5e9a4cd5585f37f9f77  talloc-2.3.1.tar.gz

We will need a license file hash. See below.

I'll add both files as license files and get them included in the .hash

Quoted 25 lines
Quoted 7 lines
package/libtalloc/libtalloc.mk new file +0 -0
new file mode 100644
index 0000000000..82a5bcb45e

package/libtalloc/libtalloc.mk line 10

Quoted 10 lines
package/libtalloc/libtalloc.mk new file +10 -0
@@ -0,0 +1,74 @@
+################################################################################
+#
+# libtalloc
+#
+################################################################################
+
+LIBTALLOC_VERSION = 2.3.1
+LIBTALLOC_SITE = https://www.samba.org/ftp/talloc
+LIBTALLOC_SOURCE = talloc-$(LIBTALLOC_VERSION).tar.gz
+LIBTALLOC_LICENSE = LGPL-3.0+

The python bindings are under GPL-3.0+

package/libtalloc/libtalloc.mk line 11

Quoted 1 line
package/libtalloc/libtalloc.mk new file +1 -0
+# no license file but available in source at man/talloc.3.xml

I suggest using talloc.h as the license file for LGPL-3.0+ and pytalloc.h as the license file for GPL-3.0+.

Quoted 7 lines

package/libtalloc/libtalloc.mk line 14

Quoted 3 lines
package/libtalloc/libtalloc.mk new file +3 -0
+LIBTALLOC_INSTALL_STAGING = YES
+LIBTALLOC_CFLAGS = $(TARGET_CFLAGS)
+LIBTALLOC_LDFLAGS = $(TARGET_LDFLAGS) $(TARGET_NLS_LIBS)

If you use TARGET_NLS_LIBS here, then you need $(TARGET_NLS_DEPENDENCIES) in the <pkg>_DEPENDENCIES variable. Make sure it is really needed though.

It appears it is not needed, will remove

Quoted 17 lines

package/libtalloc/libtalloc.mk line 25

Quoted 12 lines
package/libtalloc/libtalloc.mk new file +11 -0
+LIBTALLOC_CONF_ENV = \
+     CFLAGS="$(LIBTALLOC_CFLAGS)" \
+     LDFLAGS="$(LIBTALLOC_LDFLAGS)" \
+     XSLTPROC=false \
+     WAF_NO_PREFORK=1
+
+ifeq ($(BR2_PACKAGE_LIBTIRPC),y)
+LIBTALLOC_CFLAGS += `$(PKG_CONFIG_HOST_BINARY) --cflags libtirpc`
+LIBTALLOC_LDFLAGS += `$(PKG_CONFIG_HOST_BINARY) --libs libtirpc`
+LIBTALLOC_DEPENDENCIES += libtirpc host-pkgconf
+endif

Are you sure libtirpc is really used by libtalloc ? I know it is checked in lib/replace/wscript, but I don't see where it gets used, and I don't see why a memory allocator library would care about RPC support. Could you comment on this ?

I see an undef happening related to RPC in lib/replace/system/nis.h. It is refering to a conflict for AUTH_ERROR with rpc/rpc.h. However, that is the only reference I am seeing as nettype.h is not used anywhere.

Quoted 11 lines

package/libtalloc/libtalloc.mk line 30

Quoted 6 lines
package/libtalloc/libtalloc.mk new file +5 -0
+
+ifeq ($(BR2_PACKAGE_PYTHON3),y)
+LIBTALLOC_PYTHON = \
+     PYTHON="$(HOST_DIR)/bin/python3" \
+     PYTHON_CONFIG="$(STAGING_DIR)/usr/bin/python3-config"

I'm not sure we need this LIBTALLOC_PYTHON variable, just put these variables in LIBTALLOC_MAKE_ENV, which itself is initially set to TARGET_MAKE_ENV, and then used in the commands.

I can't seem to get the build to work by switching to using LIBTALLOC_MAKE_ENV but if I can get it working, I'll include in v2

Quoted 8 lines

package/libtalloc/libtalloc.mk line 35

Quoted 5 lines
package/libtalloc/libtalloc.mk new file +5 -0
+LIBTALLOC_DEPENDENCIES += host-python3 python3
+LIBTALLOC_CONF_ENV += \
+     $(LIBTALLOC_PYTHON) \
+     python_LDFLAGS="" \
+     python_LIBDIR=""

Setting these python_LDFLAGS and python_LIBDIR to empty values looks weird. Why do you need that? Aren't they empty by default anyway?

Yeah they appear to not be needed. I had incorrectly assumed they were needed while basing off of samba4 since libtalloc is included in samba4

Quoted 20 lines
Quoted 9 lines
package/libtalloc/libtalloc.mk new file +8 -0
+define LIBTALLOC_CONFIGURE_CMDS
+     $(INSTALL) -m 0644 package/samba4/samba4-cache.txt $(@D)/cache.txt;
+     echo 'Checking uname machine type: $(BR2_ARCH)' >>$(@D)/cache.txt;
+     (cd $(@D); \
+             $(TARGET_CONFIGURE_OPTS) \
+             $(LIBTALLOC_CONF_ENV) \
+             ./buildtools/bin/waf configure \
+                     --prefix=/usr \

package/libtalloc/libtalloc.mk line 58

Quoted 10 lines
package/libtalloc/libtalloc.mk new file +10 -0
+                     --sysconfdir=/etc \
+                     --localstatedir=/var \
+                     --with-libiconv=$(STAGING_DIR)/usr \
+                     --cross-compile \
+                     --cross-answers=$(@D)/cache.txt \
+                     --hostcc=gcc \
+                     --disable-rpath \
+                     --disable-rpath-install \
+                     --bundled-libraries='!asn1_compile,!compile_et' \
+                     $(LIBTALLOC_CONF_OPTS) \
Quoted 3 lines

Why don't you use the waf-package infrastructure if this is a waf package ? Hm, I see samba4 is also not using the waf package infrastructure for some reason.

I'll investigate using the waf-package infrastructure for v2

Quoted 8 lines

Thanks,

Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

Thank you for the review,
Jared

Signature · 4 lines
Jared M. Bents | Sr. Software Engineer | Commercial Avionics
COLLINS AEROSPACE
400 Collins Road NE, Cedar Rapids, Iowa 52498 USA
jared.bents at collins.com | collinsaerospace.com