According to your error prompts, libapr-1.a is a static library compiled with non-fPIC. So I think you need to rebuild libapr with -fPIC.