Hello,
For Android, we do not support the gcc compiler, Android does have an internal gcc compiler. However, this kind of support is out of our scope. To run a simple hello world example in Android I suggest you use Java. However, this is also not supported by us.
On Linux, you can use the gcc compiler and create a c code for a "hello world" example. To make that you can use the gcc compiler that is already in our end Yocto image. Or, you can create a recipe with the "hello world" example. Please see the below web-pages.
http://www.linfo.org/create_c1.html
https://community.nxp.com/docs/DOC-331917
In the second web-page, please go to the "Adding an empty layer and a new recipe" part. At the time you are creating the new layer, it will say if you want to add the hello world example, just say yes, and after that, you will have the hello world example natively in your end Yocto image.
For more detailed information, you can see the below web-page:
https://community.nxp.com/docs/DOC-95333
And to know more about Yocto, you can see the below training.
https://community.nxp.com/docs/DOC-94849
Hope this information could help you.
Best regards,
Diego.