Skip to content

RISC-V -- error: fixup value out of range #451

Open

Description

@brad0

CompCert 3.11
Clang / LLD 13.0.0
OpenBSD/riscv64 -current

When trying to build CompCert 3.11 on RISC-V 64-bit the compiler builds Ok. When building the tests the build has an error like so..

../../ccomp   -stdlib ../../runtime -dparse -dclight -dasm -fstruct-return   -c -o eval.o eval.c
eval.s:579:2: error: fixup value out of range
        bge     x23, x14, .L101
        ^
eval.s:586:2: error: fixup value out of range
        bgeu    x6, x31, .L102
        ^
eval.s:626:2: error: fixup value out of range
        bne     x12, x0, .L102
        ^
eval.s:638:2: error: fixup value out of range
        bltu    x21, x6, .L168
        ^
ccomp: error: assembler command failed with exit code 1 (use -v to see invocation)

1 error detected.

Activity

  1. xavierleroy commented on Aug 16, 2022

    @xavierleroy
    Contributor

    It looks like the assembler you use does not perform branch relaxation. With the GNU assembler, the first bge is turned into blt .. pc+4; j .L101, avoiding the out-of-range issue.

  2. brad0 commented on Aug 16, 2022

    @brad0
    ContributorAuthor

    Ah, thanks. This is currently an issue with Clang on RISC-V that should be resolved soon.

    The relaxation support is currently disabled on OpenBSD's Clang since we're using LLD for the linker and there isn't any relaxation support within LLD until 15.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions