A bunch of linux fixes

A bunch of fixes to make crossbridge much more linux friendly. Still fails while building tr target. Feel free to share your opinion about code changes.