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

Issue 741507 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
User never visited
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

EC doesn't build by LLVM

Project Member Reported by cheyuw@google.com, Jul 12 2017

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36

Steps to reproduce the problem:
1. Apply CL https://chromium-review.googlesource.com/c/567941/
2. make BOARD=elm board/elm/board.o

What is the expected behavior?
The step 2 only reports warnings, no errors

What went wrong?
Clang doesn't support the operand constraint "b".

The following is the error message:

In file included from board/elm/board.c:10:
core/cortex-m0/atomic.h:32:2: error: invalid output constraint '=&b' in asm
        ATOMIC_OP(bic, addr, bits);
        ^
core/cortex-m0/atomic.h:26:11: note: expanded from macro 'ATOMIC_OP'
                             : "=&b" (reg0)                     \
                               ^
core/cortex-m0/atomic.h:37:2: error: invalid output constraint '=&b' in asm
        ATOMIC_OP(orr, addr, bits);
        ^
core/cortex-m0/atomic.h:26:11: note: expanded from macro 'ATOMIC_OP'
                             : "=&b" (reg0)                     \
                               ^
core/cortex-m0/atomic.h:42:2: error: invalid output constraint '=&b' in asm
        ATOMIC_OP(add, addr, value);
        ^
core/cortex-m0/atomic.h:26:11: note: expanded from macro 'ATOMIC_OP'
                             : "=&b" (reg0)                     \
                               ^
core/cortex-m0/atomic.h:47:2: error: invalid output constraint '=&b' in asm
        ATOMIC_OP(sub, addr, value);
        ^
core/cortex-m0/atomic.h:26:11: note: expanded from macro 'ATOMIC_OP'
                             : "=&b" (reg0)                     \
                               ^
core/cortex-m0/atomic.h:59:11: error: invalid output constraint '=&b' in asm
                             : "=&b" (ret)
                               ^

Did this work before? N/A 

Chrome version: 59.0.3071.115  Channel: stable
OS Version: 
Flash Version:
 

Comment 1 by cheyuw@google.com, Jul 12 2017

According to https://chromium.googlesource.com/chromiumos/platform/ec/+/ba98b92bbb03a62a466a36fbb50843a37602d98d, we want to restrict operands to low registers (r0..r7).

If change operand constraint from "b" to "l", according to
1. https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/config/arm/constraints.md;h=aa3faaa970a1f762d2752e712545fccf79093aaf;hb=d3191480f376c78031aa1ca0f6a54f4cf67f4268#l61
2. http://llvm.org/docs/LangRef.html#supported-constraint-code-list

It means use low register (r0..r7) under thumb mode in both gcc and clang, which should satisfy the requirement here.
Cc: drinkcat@chromium.org
Components: OS>Firmware>EC
Project Member

Comment 3 by sheriffbot@chromium.org, Jul 12 2017

Labels: Hotlist-Google
Labels: TE-NeedsTriageHelp
The issue seems to out of TE-scope. Hence, adding label TE-NeedsTriageHelp for further investigation.

Thanks...!!
Labels: -Hotlist-Google -TE-NeedsTriageHelp -Via-Wizard-Other
Owner: cheyuw@google.com
Status: Assigned (was: Unconfirmed)
Project Member

Comment 6 by sheriffbot@chromium.org, Jul 21 2017

Labels: Hotlist-Google
Project Member

Comment 7 by sheriffbot@chromium.org, Sep 13 2017

Labels: Hotlist-Recharge-BouncingOwner
Owner: ----
Status: Untriaged (was: Assigned)
The assigned owner "cheyuw@google.com" is not able to receive e-mails, please re-triage.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: -OS-Linux OS-Chrome
Owner: quasisec@chromium.org
Status: Assigned (was: Untriaged)

Sign in to add a comment