New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 864815 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Jul 18
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug



Sign in to add a comment

cras: Fails to build on x86

Project Member Reported by drinkcat@chromium.org, Jul 17

Issue description

In crouton, we build cras/adhd for x86 (32-bit), which fails with the following errors:

Compiling CRAS (i386)...
tests/cras_test_client.c: In function 'run_aecdump':
tests/cras_test_client.c:677:10: error: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'uint64_t {aka long long unsigned int}' [-Werror=format=]
   printf("Dumping AEC info to %s, stream %lu, fd %d\n",
          ^
tests/cras_test_client.c: In function 'main':
tests/cras_test_client.c:1545:3: error: 'stream_id' may be used uninitialized in this function [-Werror=maybe-uninitialized]
   run_aecdump(client, stream_id, 1);
   ^
tests/cras_test_client.c: At top level:
cc1: error: unrecognized command line option '-Wno-int-in-bool-context' [-Werror]
cc1: all warnings being treated as errors
/usr/lib/gcc/x86_64-linux-gnu/5/../../../i386-linux-gnu/crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: error: ld returned 1 exit status
Failed to complete chroot setup.
Unmounting /mnt/stateful_partition/crouton/chroots/xenial...

The last error can be hacked away in crouton, the first 2 should be fixed upstream.
 
Second one already fixed by https://chromium-review.googlesource.com/1125332 .
And -Wno-int-in-bool-context flag comes from crouton, not adhd.
x86-generic build is not happy about this one either:

server/cras_iodev.c: In function 'cras_iodev_put_output_buffer':
server/cras_iodev.c:1060:3: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
   for (unsigned int i = 0; i < nframes * cras_get_format_bytes(fmt); i++) {
   ^
server/cras_iodev.c:1060:3: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
make[3]: *** [Makefile:4378: server/libcrasserver_la-cras_iodev.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
Project Member

Comment 5 by bugdroid1@chromium.org, Jul 18

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/adhd/+/af6c8c49eb9df49b6b3215b7e9ce622ad8bf3259

commit af6c8c49eb9df49b6b3215b7e9ce622ad8bf3259
Author: Nicolas Boichat <drinkcat@chromium.org>
Date: Wed Jul 18 11:08:09 2018

cras: Fix x86 build

crouton wants to build libcras for x86 (32-bit), so let's fix the
build.

In passing, fix 2 issues in dsp and server code, that crouton
does not really care about.

BUG= chromium:864815 
TEST=x86-generic is fairly broken, so manual steps here:
   ./setup_board --board=x86-generic
   USE="-pam -readline -ncurses" emerge-x86-generic --nodeps -av \
       media-libs/speex media-libs/alsa-lib sys-apps/dbus sbc iniparser \
       libcap kmod acl util-linux readline udev ladspa-sdk
   USE=-cras-apm emerge-x86-generic --nodeps -av adhd

Change-Id: Ic1975ec3f503e7e484c79ab6b6d2ad05f57c3051
Reviewed-on: https://chromium-review.googlesource.com/1140341
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
Reviewed-by: Louis Collard <louiscollard@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>

[modify] https://crrev.com/af6c8c49eb9df49b6b3215b7e9ce622ad8bf3259/cras/src/dsp/dsp_util.c
[modify] https://crrev.com/af6c8c49eb9df49b6b3215b7e9ce622ad8bf3259/cras/src/server/cras_iodev.c
[modify] https://crrev.com/af6c8c49eb9df49b6b3215b7e9ce622ad8bf3259/cras/src/tests/cras_test_client.c

Status: Fixed (was: Started)

Sign in to add a comment