Search notes:

gcc -shared

Instruct the linker to create a shared object.
Although -shared is an option for the linker, it does not need to be passed with -Wl.

See also

Creating a shared and static library with the gnu compiler (gcc)
-fpic, -fPIC
GCC options

Index