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

Linking fails for wasm32 example in README #66

Open
Vectornaut opened this issue Jul 20, 2024 · 0 comments
Open

Linking fails for wasm32 example in README #66

Vectornaut opened this issue Jul 20, 2024 · 0 comments

Comments

@Vectornaut
Copy link

Vectornaut commented Jul 20, 2024

I'm trying to build the wasm32 example from the README, but linking fails. The error message suggests that wasm-ld isn't receiving the --no-entry flag. I'm using commit 3fbef59 of nlvm.

Reproduction

Following the read-me, I put the following files in a directory.

panicoverride.nim

proc rawoutput(s: string) = discard
proc panic(s: string) {.noreturn.} = discard

myfile.nim

proc adder*(v: int): int {.exportc.} =
  v + 4

Then I ran nlvm.

nlvm c --cpu:wasm32 --os:standalone --gc:none --passl:--no-entry myfile.nim

Even though I passed the --passl:--no-entry flag, linking failed with the message "entry symbol not defined."

Hint: used config file '[NLVM PATH]/nlvm/Nim/config/nim.cfg' [Conf]
Hint: used config file '[NLVM PATH]/nlvm/Nim/config/config.nims' [Conf]
.............................................
Hint: @["wasm-ld", "-o", "/[SOURCE PATH]/myfile.wasm", "/[HOME PATH]/.cache/nim/myfile_d/myfile.o", "--export-dynamic"] [Link]
wasm-ld: error: entry symbol not defined (pass --no-entry to suppress): _start
Error: linking failed
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

1 participant