Compilation error using arduino-mk on arch Linux (undefined reference to __dso_handle)
I can't say I fully understand what is going on, but it seems that if you add:

void * __dso_handle;


You may be able to eliminate one of the problems. You might try the same trick with __cxa_atexit as well.

I found the idea by searching on:


  arduino __dso_handle


This is the webpage that I found that suggested the void * hack.