GCC

g++ mylib1.cpp
g++ mylib2.cpp
 
# shared
g++ -shared -fPIC -o libmylib.so mylib1.o mylib2.o
g++ -o main main.cpp libmylib.so
LD_LIBRARY_PATH=. ./main
 
# static
ar rcs libmylib.a mylib1.o mylib2.o
g++ -o main main.cpp -L. lmylib
./main
 
# prevents linking with the shared libraries
g++ -static -o main main.cpp -L. lmylib
readelf -a [elf-bin] | grep 'VFP registers' # Hard-float
readelf -a [elf-bin] | grep 'Tag_ABI_HardFP_use' # Soft-float

https://www.cnx-software.com/2013/04/22/how-to-detect-if-an-arm-elf-binary-is-hard-float-armhf-or-soft-float-armel/