Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
brad0 opened this issue Aug 15, 2022 · 2 comments
Open

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

brad0 opened this issue Aug 15, 2022 · 2 comments

Comments

@brad0
Copy link
Contributor

brad0 commented Aug 15, 2022

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.
@xavierleroy
Copy link
Contributor

xavierleroy commented Aug 16, 2022

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.

@brad0
Copy link
Contributor Author

brad0 commented Aug 16, 2022

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants