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

an alternate "indirect" way to find "stack_sizes" is necessary for xip #2316

Closed
yamt opened this issue Jun 26, 2023 · 9 comments · Fixed by #2322
Closed

an alternate "indirect" way to find "stack_sizes" is necessary for xip #2316

yamt opened this issue Jun 26, 2023 · 9 comments · Fixed by #2322

Comments

@yamt
Copy link
Collaborator

yamt commented Jun 26, 2023

No description provided.

yamt added a commit to yamt/wasm-micro-runtime that referenced this issue Jun 27, 2023
yamt added a commit to yamt/wasm-micro-runtime that referenced this issue Jun 27, 2023
yamt added a commit to yamt/wasm-micro-runtime that referenced this issue Jun 28, 2023
wenyongh pushed a commit that referenced this issue Jun 29, 2023
@yamt
Copy link
Collaborator Author

yamt commented Jul 3, 2023

"spec test on nuttx" seems still failing. @wenyongh can you reopen this?

@wenyongh wenyongh reopened this Jul 3, 2023
@yamt
Copy link
Collaborator Author

yamt commented Jul 3, 2023

============> run br_table failed with a non-zero return code 101

==================== LAST LOG of br_table ====================

  expected: 'SystemExit(1)'
  got: 'iwasm --heap-size=0 -v=0 --repl /tmp/tmprdma9ep7.aot
AOT module load failed: cannot apply relocation to text section for aot file generated with "--enable-indirect-mode" flag

br_table test case has a large br_table, which happens to be translated into relocations like:

000003dc R_RISCV_HI20             .Lswitch.table.aot_func_internal#15
000003e0 R_RISCV_LO12_I           .Lswitch.table.aot_func_internal#15

i'm not sure why it was not a problem in the previous code.

i'm not sure how to fix either.
maybe we can disable switch lowering as a workaround?

any idea?

@wenyongh
Copy link
Contributor

wenyongh commented Jul 3, 2023

Maybe it is due to some passes added for XIP mode don't work again with LLVM-15.0, as issue #2328 reported by @no1wudi, and he is working on PR #2334 to fix it, I think we can wait until the PR is merged.

@no1wudi
Copy link
Collaborator

no1wudi commented Jul 3, 2023

i'm not sure how to fix either. maybe we can disable switch lowering as a workaround?

We should enable switch lowering to fix this problem, as @wenyongh mentioned, LowerSwitch pass is not actually working now with LLVM 15.

I'll fix it in #2334.

@yamt
Copy link
Collaborator Author

yamt commented Jul 4, 2023

i'm not sure how to fix either. maybe we can disable switch lowering as a workaround?

We should enable switch lowering to fix this problem, as @wenyongh mentioned, LowerSwitch pass is not actually working now with LLVM 15.

I'll fix it in #2334.

i meant something like #2339
i understand your approach can fix it too.
i'm not sure which is a better approach.

@no1wudi
Copy link
Collaborator

no1wudi commented Jul 4, 2023

Maybe we should try #2339, LowerSwitch is alwasy convert switch to if ... else group, but not all switch will create jump table, this attribute seems keep small switch, which has less impact for performance and code size.

@wenyongh
Copy link
Contributor

wenyongh commented Jul 4, 2023

So let's merge #2339 first and then #2334?

@no1wudi
Copy link
Collaborator

no1wudi commented Jul 4, 2023

So let's merge #2339 first and then #2334?

Yes, I guess it's OK.

wenyongh pushed a commit that referenced this issue Jul 4, 2023
Because it involves relocations for the table. (.Lswitch.table.XXX)

Discussions: #2316
@yamt
Copy link
Collaborator Author

yamt commented Jul 6, 2023

@yamt yamt closed this as completed Jul 6, 2023
victoryang00 pushed a commit to victoryang00/wamr-aot-gc-checkpoint-restore that referenced this issue May 27, 2024
victoryang00 pushed a commit to victoryang00/wamr-aot-gc-checkpoint-restore that referenced this issue May 27, 2024
Because it involves relocations for the table. (.Lswitch.table.XXX)

Discussions: bytecodealliance#2316
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

Successfully merging a pull request may close this issue.

3 participants