Difference between -shared and -Wl,-shared of the GCC options

后端 未结 2 1091
遇见更好的自我
遇见更好的自我 2020-12-29 10:43

I know -Wl,-shared is a option of ld. I\'ve seen some person compile like this,

$ gcc -shared -Wl,-soname,libtest.so -o libtest         


        
2条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-29 11:20

    I don't think there is any difference. -shared is not a supported option of gcc and it is passed to linker whether you specify it with -Wl or not. -Wl option of gcc is used to specify that a comma separated list of options is to be passed to linker for further processing.

提交回复
热议问题