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

sjson module causes unresolved symbols #2023

Closed
jmattsson opened this issue Jul 3, 2017 · 4 comments
Closed

sjson module causes unresolved symbols #2023

jmattsson opened this issue Jul 3, 2017 · 4 comments
Assignees

Comments

@jmattsson
Copy link
Member

Expected behavior

  • No unresolved symbols after linking the firmware ELF.
  • Firmware build should fail if there are unresolved symbols.

Initially observed by @dnc40085 over in #1755. Historically esptool.py has bailed out if there are undefined symbols, but clearly the current version we have in our tree does not.

I have no idea why this wasn't failing horribly for @pjsg during testing...

Actual behavior

../tools/esptool.py elf2image --flash_mode dio --flash_freq 40m .output/eagle/debug/image/eagle.app.v6.out -o ../bin/
esptool.py v1.2-dev
Warning: ELF binary has undefined symbol calloc
Warning: ELF binary has undefined symbol free

Test code

Include the SJSON module in the build.

NodeMCU version

Which branch are you on? If you know the Git revision then add it here as well.
dev

Hardware

n/a

@jmattsson jmattsson self-assigned this Jul 3, 2017
@jmattsson
Copy link
Member Author

So it seems none of the functions which use calloc/free aren't actually used by the Lua module, and thus haven't caused actual problems. Now to work out why those functions are even included in the ELF after the linking...

@jmattsson
Copy link
Member Author

Erk, why did we end up #includeing a .c file here?

@jmattsson
Copy link
Member Author

Okay, I'm getting an appreciation for why a harsh #include was picked... curse the NON-OS SDK's non-standard include files to Hel and back sigh

@jmattsson
Copy link
Member Author

jmattsson commented Jul 3, 2017

Fascinating. If I build jsonsl.c into a library like everything else, things break at runtime.
Edit: Oh wait, I see why. Whoops.

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