Closed shubham-1827 closed 1 year ago
Hi. It is due to iOS not supporting spawning child processes. The clang compiler tried to fork a subprocess and caused memory issues.
Here's the reference to the upstream issue: https://github.com/holzschu/a-shell/issues/225
Here's is the framework that emulates a fork and other system calls in iOS: https://github.com/holzschu/ios_system Here's the port of clang for iOS: https://github.com/holzschu/llvm-project
I have seen an issues, in which you are explaining how to fix this segmentation fault. https://github.com/thebaselab/codeapp/issues/578#issue-1383726389
But, I want the reason why this is working:
clang++ main.cpp -c
clang++ func.cpp -c
clang++ main.o func.o
a.out
and this is not working and generating a segmentation fault:
clang++ -Wall -std=c++14 -g main.cpp func.cpp
(func.cpp is a file linked to main.cpp)