-
Hi, Thanks a lot for your great works at Rusty. I compile an example code by rustyc, and run it, but failed with 'Segmentation fault'. the code is same as: https://github.com/PLC-lang/rusty/blob/master/examples/while_loop_with_continue.st and I compile it with commond line: ./rustyc --target x86_64-unknown-linux-musl --static test.st and I got a file named test at x86_64-unknown-linux-musl, it's fine. But when I run it with ./test I got a 'Segmentation fault ' always. How to address this, I try to solve it but failed. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hello, thank you for your interest in Rusty!
You can see both compiled files' differences by running nm on them. The first file will only show Hope this helps |
Beta Was this translation helpful? Give feedback.
-
Thanks a lot! |
Beta Was this translation helpful? Give feedback.
Hello, thank you for your interest in Rusty!
In order to run the test file, you will need to link it with the
crt
from musl. The Clang compiler usually does this, but our embedded linker cannot.You have two ways of doing this:
--linker=clang-13
You can see both compiled files' differences by running nm on them. The first file will only show
main
while the second one will have additional symbols that get added from including thecrt
Hope this helps