Git Product home page Git Product logo

Comments (4)

infinity0 avatar infinity0 commented on July 26, 2024

This results in undefined reference later, however when I try to add the relevant musl sources into the build:

    $(LIBC_TOP_HALF_MUSL_SRC_DIR)/env/__stack_chk_fail.c \

the build complains about missing SYS_futex. Oh right, because musl's stack guard implementation is per-thread, but WASI doesn't support that at the moment. So I suppose the proper fix would be to implement a non-threaded version of this stack guard.

from wasi-libc.

sunfishcode avatar sunfishcode commented on July 26, 2024

The warning flags should work as expected.

-fstack-protector is indeed not implemented yet, and yes, you may be right that all that's needed right now is a non-threaded implementation. That said, the -fstack-protector feature is not nearly as important on wasm as it is on typilcal native platforms because wasm's callstack is outside of the program address space, so it's never possible to clobber a return address on the stack.

-Wl,-z,relro isn't yet meaningful on wasm, since we don't have dynamic linking yet, and depending on how dynamic linking ends up working, relro may not be needed.

from wasi-libc.

infinity0 avatar infinity0 commented on July 26, 2024

Thanks for confirming! For now I'll just append the -fno-stack-protector flag then, this seems to work OK and nothing is broken.

from wasi-libc.

sunfishcode avatar sunfishcode commented on July 26, 2024

Closing as answered; feel free to reopen or file a new issue if there are further questions!

from wasi-libc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.