I started off copying the x86_64 port, getting static build to work and then iteratively fixing problems detected by libc-testsuite. currently not containing any of the optimized math and string asm. at this point all tests except math pass, and both static and dynamic linking work. there are a couple of intrusive changes into non-arch specific headers, caused by mismatch of 32bit longs to "kernel" longs (64bit) used in some structures and as syscall arguments. especially the current changes to src/internal/syscall.h are very ugly. discussion is open for better/cleaner ways to get the same functionality. something that didn't make it into this patch is that the arch triple "x86_64-x32-..." should also be detected by the configure script, because this is a triple that magically let's binutils and gcc build the right thing (gcc needs an additional multilib setting to work tho, --with-multilib-list=mx32). having the arch name itself be x32 seems cleaner though, especially with regard to the musl-gcc patches in Gregor's repo that already have ld-musl-x32.so.1 hardcoded as dynlinker.