This question has originally been placed in another community .
I did read the mailing list netiquette before posting here but I was not
aware this behaviour is discouraged.
Therefore, I want to apologize. Good etiquette is important, I am
grateful for any advice on how I can make the Internet a better place.
The solution to the undefined reference errors is to set the
-specs=nosys.specs flag as mentioned here 
in combination with not using the -nostartfiles flag which made the
_exit referenced in nosys.specs not being used.
Since this is also making this question a duplicate of  I decided to
delete it in stackoverflow.
Thank you for your help.
Powered by www.kitware.com
Please keep messages on-topic and check the CMake FAQ at:
Kitware offers various services to support the CMake community. For more
information on each offering, please visit:
CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html
Visit other Kitware open-source projects at
Follow this link to subscribe/unsubscribe: