Skip to content

symbol '.LCPI0_0' is already defined (LLVM-442) #112

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

Open
3 tasks done
yamt opened this issue May 1, 2025 · 0 comments
Open
3 tasks done

symbol '.LCPI0_0' is already defined (LLVM-442) #112

yamt opened this issue May 1, 2025 · 0 comments

Comments

@yamt
Copy link

yamt commented May 1, 2025

Checklist

  • Checked the issue tracker for similar issues to ensure this is not a duplicate
  • Read the documentation to confirm the issue is not addressed there and your configuration is set correctly
  • Tested with the latest version to ensure the issue hasn't been fixed

How often does this bug occurs?

always

Expected behavior

no errors

Actual behavior (suspected bug)

while i'm upgrading llvm version for wamr, (bytecodealliance/wasm-micro-runtime#4213)
i observed errors like:

spacetanuki% ./wamrc --target=xtensa   --mllvm=-mtext-section-literals --disable
-llvm-lto --bounds-checks=1 -o a ~/git/toywasm/.wasm-spec-test/test/core/address
.3.wasm
Create AoT compiler with:
  target:        xtensa
  target cpu:
  target triple: xtensa-pc-linux-gnu
  cpu features:
  opt level:     3
  size level:    3
  output format: AoT file
error: <unknown>:0: symbol '.LCPI0_0' is already defined

Error logs or terminal output

Steps to reproduce the behavior

a.ll.zip
unzip the attached file.
llc -mtext-section-literals -o a.s a.ll
llvm-mc --filetype=obj -o a.o a.s

Project release version

xtensa_release_19.1.2

System architecture

Intel/AMD 64-bit (modern PC, older Mac)

Operating system

MacOS

Operating system version

15.4.1

Shell

ZSH

Additional context

No response

@github-actions github-actions bot changed the title symbol '.LCPI0_0' is already defined symbol '.LCPI0_0' is already defined (LLVM-442) May 1, 2025
yamt added a commit to yamt/wasm-micro-runtime that referenced this issue May 8, 2025
cf. bytecodealliance#4210

why not 20?
because, as of writing this, 19 is the latest released version for
the xtensa fork of llvm: https://github.com/espressif/llvm-project

why not 19?
because of a bug in the xtensa fork of llvm:
espressif/llvm-project#112

while we can use different versions for different targets,
it's nicer to use the same version everywhere when possible.
lum1n0us pushed a commit to bytecodealliance/wasm-micro-runtime that referenced this issue May 9, 2025
* build-scripts/build_llvm.py: bump to llvm 18

cf. #4210

why not 20?
because, as of writing this, 19 is the latest released version for
the xtensa fork of llvm: https://github.com/espressif/llvm-project

why not 19?
because of a bug in the xtensa fork of llvm:
espressif/llvm-project#112

while we can use different versions for different targets,
it's nicer to use the same version everywhere when possible.

* spec-test-script/runtest.py: --size-level=0 for x86-64

with the recent version of LLVM, wamrc --size-level=1 often
generates R_X86_64_32S relocations which fail on load with
the infamous error:

"relocation truncated to fit R_X86_64_32S failed"

it seems that these relocations are often for jump tables.

this commit workarounds it with --size-level=0.

an alternative is to disable jump tables. (although it seems that
jump tables are not the only source of these relocations.)

cf. #3035

it might be better to do this in wamrc itself. however, currently
target info is not available there in case of native compilation.
related: #3356

* wamr-compiler: size_level=0 for sgx mode

cf. #3035
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants