If you have -Wl,-O1 in your CFLAGS, a lot of application will fail to compile with a simliar error: libs/fcatomic.o: relocation R_X86_64_32 can not be used when making a shared object; recompile with -fPIC That's because binutils/gcc/whatever removes -fPIC from CFLAGS if -Wl,-O1 is given.
Never stick -fPIC into your CFLAGS