Skip to contentSkip to conversation

package/dvblast: fix autobuild failures

GIT PULL New Yann E. MORIN 2 participants 9 messages Oct 30, 2015 – Oct 31, 2015

lore
Share & tools
lore
#0 lore raw

Hello All!

This series fixes the four types of build failures due to dvblast:
- requires libiconv, even without locales
- needs -lm because of -lev
- needs threads
- uses incorrect integer types

Regards,
Yann E. MORIN.

The following changes since commit 9cadddd0a85abdad5de799359f4ff9849d4731f2:

libv4l: bump version to 1.8.1 (2015-10-29 20:06:33 +0100)

are available in the git repository at:

git://git.busybox.net/~ymorin/git/buildroot yem/autobuild

for you to fetch changes up to a138be83167445a8f88e8b028725cf6a48d45b37:

package/dvblast: fix musl build (2015-10-30 16:42:50 +0100)

----------------------------------------------------------------
Yann E. MORIN (4):
package/dvblast: needs iconv always
package/dvblast: fix static linking
package/dvblast: needs threads
package/dvblast: fix musl build

 package/dvblast/0001-missing-lm.patch    | 29 +++++++++++++++++++++++++++++
 package/dvblast/0002-fix-int-types.patch | 22 ++++++++++++++++++++++
 package/dvblast/Config.in                |  6 ++++++
 package/dvblast/dvblast.mk               | 11 +++++++++--
 4 files changed, 66 insertions(+), 2 deletions(-)
 create mode 100644 package/dvblast/0001-missing-lm.patch
 create mode 100644 package/dvblast/0002-fix-int-types.patch
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#1 lore raw

PATCH 1/4 package/dvblast: needs iconv always

dvblast wants iconv functions even without locales.

Fixes:

    http://autobuild.buildroot.org/results/03f/03fe6dc17d7f36d9b8c7ced402850def95d8feb3/
    http://autobuild.buildroot.org/results/064/0647b0180ac9a6bf6172742e388df9a9e584d91b/
    ...
---
 package/dvblast/Config.in  |  1 +
 package/dvblast/dvblast.mk | 11 +++++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)
package/dvblast/Config.in +1 -0
index ac8b4ae..da78943 100644
@@ -2,6 +2,7 @@ config BR2_PACKAGE_DVBLAST
 	bool "dvblast"
 	select BR2_PACKAGE_BITSTREAM
 	select BR2_PACKAGE_LIBEV
+	select BR2_PACKAGE_LIBICONV if !BR2_ENABLE_LOCALE
 	depends on !BR2_bfin  # libev
 	help
 	  DVBlast is a simple and powerful MPEG-2/TS demux and
package/dvblast/dvblast.mk +9 -2
index 11a2dc8..ef9a666 100644
@@ -11,12 +11,19 @@ DVBLAST_LICENSE = GPLv2+, WTFPL
 DVBLAST_LICENSE_FILES = COPYING COPYING.WTFPL
 DVBLAST_DEPENDENCIES = bitstream libev
 
+DVBLAST_MAKE_ENV = $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS)
+
+ifeq ($(BR2_PACKAGE_LIBICONV),y)
+DVBLAST_DEPENDENCIES += libiconv
+DVBLAST_MAKE_ENV += LDLIBS=-liconv
+endif
+
 define DVBLAST_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)
+	$(DVBLAST_MAKE_ENV) $(MAKE) -C $(@D)
 endef
 
 define DVBLAST_INSTALL_TARGET_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) PREFIX=/usr install
+	$(DVBLAST_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) PREFIX=/usr install
 endef
 
 $(eval $(generic-package))
Signature · 1 line
1.9.1
#2 lore raw

PATCH 1/4 package/dvblast: needs iconv always

Dear Yann E. MORIN,

Quoted 9 lines · Yann E. MORIN

dvblast wants iconv functions even without locales.

Fixes:

    http://autobuild.buildroot.org/results/03f/03fe6dc17d7f36d9b8c7ced402850def95d8feb3/
    http://autobuild.buildroot.org/results/064/0647b0180ac9a6bf6172742e388df9a9e584d91b/
    ...

For some reason, your Cc didn't work.

I've applied after tweaking the commit title: I don't think "needs iconv always" is completely correct, so I've reworded to "always needs iconv".

Thanks!

Thomas

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

PATCH 2/4 package/dvblast: fix static linking

In reply to Yann E. MORIN

dvblast links to -lev, which calls functions from -lm, like floor().

dvblast does not use libtool, so it does not pull in the libev dependencies when doing a static link.

Fix that by always pulling in -lm after -lev. We can not do it from the .mk, because libraries passed from the .mk end up at the beginning of the list.

Fixes:

    http://autobuild.buildroot.org/results/1f0/1f02f84fb926839a1adbe3af457bb909fdc44433/
    http://autobuild.buildroot.org/results/6af/6af3abcdced1cc689a59fe11483f5cdcae0cfd38/
    ...
---
 package/dvblast/0001-missing-lm.patch | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
 create mode 100644 package/dvblast/0001-missing-lm.patch
package/dvblast/0001-missing-lm.patch new file +29 -0
new file mode 100644
index 0000000..2efbec4
@@ -0,0 +1,29 @@
+dvblast: fix static linking
+
+dvblast links to -lev, wihch uses functions from the maths library,
+like floor().
+
+When linking to a shared libev.so, that dependency is automatically
+pulled in because libev as a DT_NEEDED ELF tag on libm.so.
+
+But when lnking to the static libev.a, since there is no way to express
+such dependencies in static libraries, libm is not pulled in, which
+leads to build failures such as;
+    http://autobuild.buildroot.org/results/1f0/1f02f84fb926839a1adbe3af457bb909fdc44433/build-end.log
+
+Fix that by always linking to -lm (which must come *after* -lev).
+
+Signed-off-by: "Yann E. MORIN" <[email protected]>
+
+diff -durN dvblast-3.0.orig/Makefile dvblast-3.0/Makefile
+--- dvblast-3.0.orig/Makefile	2015-10-05 17:51:14.000000000 +0200
++++ dvblast-3.0/Makefile	2015-10-30 15:57:19.547123894 +0100
+@@ -28,7 +28,7 @@
+ LDLIBS += -lstreammaster
+ endif
+ 
+-LDLIBS_DVBLAST += -lpthread -lev
++LDLIBS_DVBLAST += -lpthread -lev -lm
+ 
+ OBJ_DVBLAST = dvblast.o util.o dvb.o udp.o asi.o demux.o output.o en50221.o comm.o mrtg-cnt.o asi-deltacast.o
+ OBJ_DVBLASTCTL = util.o dvblastctl.o
Signature · 1 line
1.9.1
#4 lore raw

PATCH 2/4 package/dvblast: fix static linking

Dear Yann E. MORIN,

Quoted 14 lines · Yann E. MORIN

dvblast links to -lev, which calls functions from -lm, like floor().

dvblast does not use libtool, so it does not pull in the libev dependencies when doing a static link.

Fix that by always pulling in -lm after -lev. We can not do it from the .mk, because libraries passed from the .mk end up at the beginning of the list.

Fixes:

    http://autobuild.buildroot.org/results/1f0/1f02f84fb926839a1adbe3af457bb909fdc44433/
    http://autobuild.buildroot.org/results/6af/6af3abcdced1cc689a59fe11483f5cdcae0cfd38/
    ...
Quoted 6 lines
---
 package/dvblast/0001-missing-lm.patch | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
 create mode 100644 package/dvblast/0001-missing-lm.patch

Applied, thanks. Please submit the patch upstream.

Thomas

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

PATCH 3/4 package/dvblast: needs threads

In reply to Yann E. MORIN
Fixes;
    http://autobuild.buildroot.org/results/c25/c25143fd1363d162de6733bc55a84289543f4da3/
    http://autobuild.buildroot.org/results/09d/09d9a962b20295d09d7777f873f7bb1c8130dbf1/
    ...
---
 package/dvblast/Config.in | 5 +++++
 1 file changed, 5 insertions(+)
package/dvblast/Config.in +5 -0
index da78943..1ea8f93 100644
@@ -4,8 +4,13 @@ config BR2_PACKAGE_DVBLAST
 	select BR2_PACKAGE_LIBEV
 	select BR2_PACKAGE_LIBICONV if !BR2_ENABLE_LOCALE
 	depends on !BR2_bfin  # libev
+	depends on BR2_TOOLCHAIN_HAS_THREADS
 	help
 	  DVBlast is a simple and powerful MPEG-2/TS demux and
 	  streaming application.
 
 	  http://www.videolan.org/projects/dvblast.html
+
+comment 'dvblast needs a toolchain w/ threads'
+	depends on !BR2_bfin  # libev
+	depends on !BR2_TOOLCHAIN_HAS_THREADS
Signature · 1 line
1.9.1
#6 lore raw

PATCH 3/4 package/dvblast: needs threads

Dear Yann E. MORIN,

Quoted 7 lines · Yann E. MORIN
Fixes;
    http://autobuild.buildroot.org/results/c25/c25143fd1363d162de6733bc55a84289543f4da3/
    http://autobuild.buildroot.org/results/09d/09d9a962b20295d09d7777f873f7bb1c8130dbf1/
    ...

I've applied but now that I'm re-reading when replying to your e-mail, I see a mistake:

Quoted 1 line

+comment 'dvblast needs a toolchain w/ threads'

We normally use double quotes, not single quotes for comments.

Thanks,

Thomas

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

PATCH 4/4 package/dvblast: fix musl build

In reply to Yann E. MORIN

Fix integer types: use intXX_t, not u_intXX_t.

Fixes:

    http://autobuild.buildroot.org/results/a43/a434372d84544116e7bb4a88c0ee437ae0578007/
    http://autobuild.buildroot.org/results/167/167efb284be47ae3e90fe7a8e6316e757b59cd3e/
    ...
---
 package/dvblast/0002-fix-int-types.patch | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 package/dvblast/0002-fix-int-types.patch
package/dvblast/0002-fix-int-types.patch new file +22 -0
new file mode 100644
index 0000000..0324f39
@@ -0,0 +1,22 @@
+Integer types are uintXX_t not u_intXX_t
+
+Signed-off-by: "Yann E. MORIN" <[email protected]>
+
+diff -durN dvblast-3.0.orig/dvblast.h dvblast-3.0/dvblast.h
+--- dvblast-3.0.orig/dvblast.h	2015-10-05 17:51:14.000000000 +0200
++++ dvblast-3.0/dvblast.h	2015-10-30 16:29:25.586125193 +0100
+@@ -49,10 +49,10 @@
+  * Raw udp packet structure with flexible-array payload
+  *****************************************************************************/
+ struct udpheader { // FAVOR_BSD hell ...
+-  u_int16_t source;
+-  u_int16_t dest;
+-  u_int16_t len;
+-  u_int16_t check;
++  uint16_t source;
++  uint16_t dest;
++  uint16_t len;
++  uint16_t check;
+ };
+ 
+ #if defined(__FreeBSD__) || defined(__APPLE__)
Signature · 1 line
1.9.1
#8 lore raw

PATCH 4/4 package/dvblast: fix musl build

Dear Yann E. MORIN,

Quoted 1 line · Yann E. MORIN

Fix integer types: use intXX_t, not u_intXX_t.

This is a bit terse as a commit log, so I've expanded the explanations a bit.

package/dvblast/0002-fix-int-types.patch line 1

Quoted 7 lines
package/dvblast/0002-fix-int-types.patch new file +1 -0
new file mode 100644
index 0000000..0324f39
@@ -0,0 +1,22 @@
+Integer types are uintXX_t not u_intXX_t

Same here.

Also, please submit the patch upstream.

Thanks!

Thomas

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