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

Issue 658436 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: Oct 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

Reef: ec-utils (usb_updater in particular) cannot build with clang

Project Member Reported by briannorris@chromium.org, Oct 21 2016

Issue description

See, for instance, this PreCQ run:

https://uberchromegw.corp.google.com/i/chromiumos.tryserver/builders/pre_cq/builds/4340

https://uberchromegw.corp.google.com/i/chromiumos.tryserver/builders/pre_cq/builds/4340/steps/BuildPackages/logs/stdio

ec-utils-0.0.1-r3361: make: Entering directory '/build/reef/tmp/portage/chromeos-base/ec-utils-0.0.1-r3361/work/ec-utils-0.0.1/extra/usb_updater'
ec-utils-0.0.1-r3361: x86_64-cros-linux-gnu-clang -std=gnu99 -g -Wall -Werror -Wpointer-arith -Wcast-align -Wcast-qual -Wundef -Wsign-compare -Wredundant-decls -Wmissing-declarations -O0 -I/build/reef/usr/include/libusb-1.0  -I../../include -I../../board/cr50 -I ../../chip/g -I../../util usb_updater.c   -lusb-1.0 -lcrypto  -o usb_updater
ec-utils-0.0.1-r3361: In file included from usb_updater.c:32:
ec-utils-0.0.1-r3361: In file included from ../../include/usb_descriptor.h:14:
ec-utils-0.0.1-r3361: ../../chip/g/usb_hw.h:29:14: error: tentative array definition assumed to have
ec-utils-0.0.1-r3361:       one element [-Werror]
ec-utils-0.0.1-r3361: static int (*usb_iface_request[]) (struct usb_setup_packet *req);
ec-utils-0.0.1-r3361:              ^
ec-utils-0.0.1-r3361: 1 error generated.
ec-utils-0.0.1-r3361: make: *** [Makefile:40: usb_updater] Error 1
ec-utils-0.0.1-r3361: make: Leaving directory '/build/reef/tmp/portage/chromeos-base/ec-utils-0.0.1-r3361/work/ec-utils-0.0.1/extra/usb_updater'
ec-utils-0.0.1-r3361:  * ERROR: chromeos-base/ec-utils-0.0.1-r3361::chromiumos failed (compile phase):
ec-utils-0.0.1-r3361:  *   emake failed


---


On a related note, why don't EC changes get built on a PreCQ or CQ run? This should have been caught earlier. (This is not the first time that EC changes have blocked the kernel preCQ.)
 
Cc: llozano@chromium.org
Owner: briannorris@chromium.org
Status: Started (was: Available)
I've got a proposal to fix this:

https://chromium-review.googlesource.com/#/c/401421/
Project Member

Comment 2 by bugdroid1@chromium.org, Oct 22 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/ec/+/c4e1a40e35a7d0f55a6a0bea55a1e325fdd41568

commit c4e1a40e35a7d0f55a6a0bea55a1e325fdd41568
Author: Brian Norris <briannorris@chromium.org>
Date: Fri Oct 21 22:48:40 2016

Fixup usb_updater for reef/clang

clang doesn't like the array here:

ec-utils-0.0.1-r3361: x86_64-cros-linux-gnu-clang -std=gnu99 -g -Wall -Werror -Wpointer-arith -Wcast-align -Wcast-qual -Wundef -Wsign-compare -Wredundant-decls -Wmissing-declarations -O0 -I/build/reef/usr/include/libusb-1.0  -I../../include -I../../board/cr50 -I ../../chip/g -I../../util usb_updater.c   -lusb-1.0 -lcrypto  -o usb_updater
ec-utils-0.0.1-r3361: In file included from usb_updater.c:32:
ec-utils-0.0.1-r3361: In file included from ../../include/usb_descriptor.h:14:
ec-utils-0.0.1-r3361: ../../chip/g/usb_hw.h:29:14: error: tentative array definition assumed to have
ec-utils-0.0.1-r3361:       one element [-Werror]
ec-utils-0.0.1-r3361: static int (*usb_iface_request[]) (struct usb_setup_packet *req);
ec-utils-0.0.1-r3361:              ^
ec-utils-0.0.1-r3361: 1 error generated.

But it's willing to forgive if this is extern. It should be extern
anyway.

BRANCH=none
BUG= chromium:658436 
TEST=reef pre-cq passes (building ec-utils)

Change-Id: I5b5f8eb8dcdc3340487b118b30469c8cee73e182
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/401421
Reviewed-by: Shawn N <shawnn@chromium.org>

[modify] https://crrev.com/c4e1a40e35a7d0f55a6a0bea55a1e325fdd41568/chip/g/usb_hw.h

Labels: -Pri-0 Pri-2
Waiting for one more change to get through the CQ (it's not currently breaking, but it has the same anti-pattern):

https://chromium-review.googlesource.com/#/c/402068/
Project Member

Comment 4 by bugdroid1@chromium.org, Oct 22 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/ec/+/5ab2ffdbe915223effa81ce8112e8636cf8c6084

commit 5ab2ffdbe915223effa81ce8112e8636cf8c6084
Author: Brian Norris <briannorris@chromium.org>
Date: Fri Oct 21 23:25:49 2016

stm32: make usb_iface_request extern

This isn't supposed to be static. And with CL:401421, we noticed that
clang doesn't like this form. So fix this one too.

BRANCH=none
BUG= chromium:658436 
TEST=build

Change-Id: Ibd0c5724d5178c5ce8fc8c1b74382aeddd8f744d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/402068
Reviewed-by: Shawn N <shawnn@chromium.org>

[modify] https://crrev.com/5ab2ffdbe915223effa81ce8112e8636cf8c6084/chip/stm32/usb_dwc_hw.h

Status: Fixed (was: Started)
Project Member

Comment 6 by bugdroid1@chromium.org, Dec 25 2016

Labels: merge-merged-factory-reef-8811.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/ec/+/23c1bea04d9320f75e71aab6bc46043d64c5c842

commit 23c1bea04d9320f75e71aab6bc46043d64c5c842
Author: Brian Norris <briannorris@chromium.org>
Date: Fri Oct 21 22:48:40 2016

Fixup usb_updater for reef/clang

clang doesn't like the array here:

ec-utils-0.0.1-r3361: x86_64-cros-linux-gnu-clang -std=gnu99 -g -Wall -Werror -Wpointer-arith -Wcast-align -Wcast-qual -Wundef -Wsign-compare -Wredundant-decls -Wmissing-declarations -O0 -I/build/reef/usr/include/libusb-1.0  -I../../include -I../../board/cr50 -I ../../chip/g -I../../util usb_updater.c   -lusb-1.0 -lcrypto  -o usb_updater
ec-utils-0.0.1-r3361: In file included from usb_updater.c:32:
ec-utils-0.0.1-r3361: In file included from ../../include/usb_descriptor.h:14:
ec-utils-0.0.1-r3361: ../../chip/g/usb_hw.h:29:14: error: tentative array definition assumed to have
ec-utils-0.0.1-r3361:       one element [-Werror]
ec-utils-0.0.1-r3361: static int (*usb_iface_request[]) (struct usb_setup_packet *req);
ec-utils-0.0.1-r3361:              ^
ec-utils-0.0.1-r3361: 1 error generated.

But it's willing to forgive if this is extern. It should be extern
anyway.

BRANCH=none
BUG= chromium:658436 
TEST=reef pre-cq passes (building ec-utils)

Change-Id: I5b5f8eb8dcdc3340487b118b30469c8cee73e182
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/401421
Reviewed-by: Shawn N <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/423288
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Queue: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
Trybot-Ready: Hung-Te Lin <hungte@chromium.org>

[modify] https://crrev.com/23c1bea04d9320f75e71aab6bc46043d64c5c842/chip/g/usb_hw.h

Comment 7 by dchan@google.com, Jan 21 2017

Labels: VerifyIn-57

Comment 8 by dchan@google.com, Mar 4 2017

Labels: VerifyIn-58

Comment 9 by dchan@google.com, Apr 17 2017

Labels: VerifyIn-59

Comment 10 by dchan@google.com, May 30 2017

Labels: VerifyIn-60
Labels: VerifyIn-61
Status: Verified (was: Fixed)
Closing. Please reopen it if its not fixed. Thanks!

Sign in to add a comment