Fix for linker ordering bug

r? @SimonSapin @mbrubeck

(anybody can merge, really)