libvpx FTBFS with gcc 5.3 on armhf

Bug #1528297 reported by Olivier Tilloy on 2015-12-21
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gcc
Unknown
Unknown
firefox (Ubuntu)
High
Unassigned
gcc-5 (Ubuntu)
Medium
Unassigned
libvpx (Debian)
Fix Released
Unknown
libvpx (Ubuntu)
High
Unassigned
oxide-qt (Ubuntu)
High
Olivier Tilloy

Bug Description

(originally reported as bug #1527741)

Trying to build libvpx from source in an up-to-date xenial arhmf environment, with gcc 5.3.1, fails with the following error:

gcc -marm -Wall -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -march=armv6 -DNDEBUG -O2 -fPIC -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -Wdeclaration-after-statement -Wdisabled-optimization -Wpointer-arith -Wtype-limits -Wcast-qual -Wvla -Wimplicit-function-declaration -Wuninitialized -Wunused-variable -Wunused-but-set-variable -Wno-unused-function -I. -I"/tmp/libvpx-1.4.0" -c -o vp8/common/treecoder.c.o /tmp/libvpx-1.4.0/vp8/common/treecoder.c
/tmp/libvpx-1.4.0/vp8/common/treecoder.c: In function 'tree2tok':
/tmp/libvpx-1.4.0/vp8/common/treecoder.c:32:9: error: invalid use of array with unspecified bounds
         const vp8_tree_index j = t[i++];
         ^
/tmp/libvpx-1.4.0/vp8/common/treecoder.c:32:34: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
         const vp8_tree_index j = t[i++];
                                  ^
/tmp/libvpx-1.4.0/vp8/common/treecoder.c: In function 'branch_counts':
/tmp/libvpx-1.4.0/vp8/common/treecoder.c:96:13: error: invalid use of array with unspecified bounds
             i = tree[ i + b];
             ^
/tmp/libvpx-1.4.0/vp8/common/treecoder.c:96:15: warning: assignment makes integer from pointer without a cast [-Wint-conversion]
             i = tree[ i + b];
               ^
Makefile:148: recipe for target 'vp8/common/treecoder.c.o' failed

I’m attaching a full build log. This is reproducible both on a porter box and in a armhf chroot.

Olivier Tilloy (osomon) wrote :
Changed in gcc-5 (Ubuntu):
assignee: nobody → Matthias Klose (doko)
Olivier Tilloy (osomon) wrote :

oxide-qt is also affected, as it embeds a copy of libvpx, and it fails to build in the exact same way.

Colin Watson (cjwatson) wrote :

I *think* the relevant C code is non-compliant. C99 6.7.5.2(4) "If the size is not present, the array type is an incomplete type"; 6.7.5.3(12) "If the function declarator is not part of a definition of that function, parameters may have incomplete type". That would seem to imply that in the situation where the declarator is part of a definition of the function, as in this case, parameters may not have incomplete type, although oddly I can't find an explicit statement of that. Perhaps a more awake C standards pedant could find one? :-)

The attached patch can be added to the top of the patch stack of libvpx 1.4.0-4 and avoids this construction. It at least compiles on the armhf porter box; I haven't tried doing anything with it at run-time. I assume that a similar change can be applied to oxide-qt, though I also haven't tried that.

tags: added: patch
Olivier Tilloy (osomon) wrote :

Thanks for your analysis and for the patch Colin! This kind of subtlety on standards compliance goes beyond my C knowledge.
I’ll apply the patch to oxide and will test building it. If it works it should be good enough until the situation can be clarified by someone learned in C standards.

I wonder why the same code compiles just fine on amd64 and x86 with the same compiler though?

Olivier Tilloy (osomon) wrote :

Nevermind that last comment, I’m getting the same build failure on i386.

Olivier Tilloy (osomon) on 2015-12-22
Changed in oxide-qt (Ubuntu):
assignee: nobody → Olivier Tilloy (osomon)
importance: Undecided → Critical
status: New → In Progress
Olivier Tilloy (osomon) wrote :

oxide 1.11.3-0ubuntu3 successfully built in silo 10, and tested that vp8 video playback works.
Will publish to xenial-proposed.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package oxide-qt - 1.11.3-0ubuntu3

---------------
oxide-qt (1.11.3-0ubuntu3) xenial; urgency=medium

  * Add patches/fix-libvpx-build-gcc53.patch (LP: #1528297)

 -- Olivier Tilloy <email address hidden> Tue, 22 Dec 2015 11:52:56 +0100

Changed in oxide-qt (Ubuntu):
status: In Progress → Fix Released
Sebastian Dröge (slomo) wrote :

Colin, can you forward your patch upstream? I also have a slightly rebased version for 1.5.0 here: https://anonscm.debian.org/cgit/pkg-gstreamer/libvpx.git/tree/debian/patches/fix-build.patch

Matthias Klose (doko) on 2016-01-16
Changed in gcc-5 (Ubuntu):
assignee: Matthias Klose (doko) → nobody
status: New → Invalid
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package firefox - 44.0+build3-0ubuntu2

---------------
firefox (44.0+build3-0ubuntu2) xenial; urgency=medium

  * Fix webrtc build on AArch64.

 -- Matthias Klose <email address hidden> Mon, 25 Jan 2016 16:46:34 +0100

Changed in firefox (Ubuntu):
status: New → Fix Released
Chris Coulson (chrisccoulson) wrote :

I've been able to compile Oxide with the latest gcc 5.3 without the patch in comment 3. Wasn't this bug basically https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68668? If it was, the nwe can drop this patch from libvpx, Oxide and Firefox

Mattia Rizzolo (mapreri) wrote :

libvpx just builds now, so this is fixed.

Changed in libvpx (Ubuntu):
status: New → Fix Released
no longer affects: gcc-5 (Ubuntu)
tags: added: ftbfs
Changed in firefox (Ubuntu):
importance: Undecided → High
Changed in gcc-5 (Ubuntu):
status: New → Fix Released
importance: Undecided → Medium
Changed in oxide-qt (Ubuntu):
importance: Critical → High
Changed in libvpx (Ubuntu):
importance: Undecided → High
Changed in libvpx (Debian):
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.