Very slow linking performance with small library objects on GCC
I compiled C and C++ Hello World programs to benchmark the time:
user:~# time gcc -o test-c test.c
relibc getrlimit(3, 0x7ffffffffdc0): not implemented
relibc getrlimit(3, 0x7ffffffffce0): not implemented
relibc getrlimit(9, 0x7ffffffffcc0): not implemented
relibc getrlimit(9, 0x7ffffffffcf0): not implemented
relibc getrlimit(5, 0x7ffffffffcf0): not implemented
relibc getrlimit(9, 0x7ffffffffcc0): not implemented
relibc getrlimit(7, 0x7ffffffffb60): not implemented
relibc getrlimit(7, 0x7ffffffffb70): not implemented
/usr/bin/ld: warning: /usr/bin/../lib/gcc/x86_64-unknown-redox/13.2.0/crtn.o: missing .note.GNU-stack sectiok
/usr/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
real 48.304527283s
user:~# time g++ -o test-cpp test.cpp -static
relibc getrlimit(3, 0x7ffffffffdb0): not implemented
relibc getrlimit(3, 0x7ffffffffce0): not implemented
relibc getrlimit(9, 0x7ffffffffcc0): not implemented
relibc getrlimit(9, 0x7ffffffffcf0): not implemented
relibc getrlimit(5, 0x7ffffffffcf0): not implemented
relibc getrlimit(9, 0x7ffffffffcc0): not implemented
relibc madvise(0x3760000, 0x11000, 0x4): not implemented
relibc madvise(0x2f3000, 0x80000, 0x4): not implemented
relibc madvise(0x2b1000, 0x2000, 0x4): not implemented
relibc madvise(0x2f0d000, 0xf000, 0x4): not implemented
relibc madvise(0x2d0c000, 0x10000, 0x4): not implemented
relibc madvise(0x2c7000, 0x4000, 0x4): not implemented
relibc madvise(0x3b37000, 0xd4000, 0x4): not implemented
relibc madvise(0x2f1c000, 0x20000, 0x4): not implemented
relibc madvise(0x3771000, 0x40000, 0x4): not implemented
relibc madvise(0x3c0b000, 0x4000, 0x4): not implemented
relibc madvise(0x2f3c000, 0x4000, 0x4): not implemented
relibc getrlimit(7, 0x7ffffffffb60): not implemented
relibc getrlimit(7, 0x7ffffffffb60): not implemented
/usr/bin/ld: warning: /usr/bin/../lib/gcc/x86_64-unknown-redox/13.2.0/crtn.o: missing .note.GNU-stack sectiok
/usr/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
real 1m13.930763245s