fixed linkage for use with newer gnu toolchain