Isn't cross-linker enough? My regular mingw build of ld says it supports elf64-x86-64 traget, so I assume something like this should be enough: ld -b elf64-x86-64 -L lib --dynamic-linker /lib64/ld-linux-x86-64.so.2 --as-needed --gc-sections -s lib/crt1.o lib/crti.o my.o -lc lib/crtn.o