Linker error while linking static library compiled by arm-none-eabi-gcc

Hello, I am trying to use a C library compiled with arm-none-eabi-gcc and specs.nosys.
I am trying to link the compiled library into a bare metal rust executable, but I am keep getting the following error:

rust-lld: error: 
          ERROR(cortex-m-rt): .got section detected in the input object files
          Dynamic relocations are not supported. If you are linking to C code compiled using
          the 'cc' crate then modify your build script to compile the C code _without_
          the -fPIC flag. See the documentation of the `cc::Build.pic` method for details.

I have viewed the CMake invocation in build.rs, but there was no -fPIC flag passed to the compiler. Also, I have inspected the static library using objdump -h, but there were no <.got> or <plt.got> sections. Upon research, I found this thread: Exceptions not working when cross compiling for ARM Cortex M4 with clang and precompiled libraries from ARM GNU GCC Toolchain - #6 by KKoovalsky - LLVM Dev List Archives - LLVM Discussion Forums, but I am not so sure if it is related, because the same kind of error shows up when I use arm-none-eabi-ld instead of rust-lld. Are there any suggestions? Any help will be appreciated.