-lgcc_s 和 gcc 之间的区别
通过 LDFLAGS
链接到 gcc_s
和 gcc
之间有什么区别?
gcc_s
是静态库和gcc
共享库吗?
因为我正在寻找一个解决方案,其中提到链接到 gcc
而只有 gcc_s
在我的情况下有效。我想知道真正的区别。
<<hidden symbol `__name_here' in /some/library/path.a(_filename.o) is referenced by DSO
在这种情况下,通常通过将“-l gcc”或“gcc -print-libgcc-file-name
”添加到链接标志 (LDFLAGS) 来解决问题。然而,与我的其他常规平台(i386、amd64、sparc64)不同,这还不够。经过大量的头脑风暴(公平地说,它也来自音乐),我意识到这个标志在链接 libc 和最终可执行文件时都是必要的。 链接:http://people.defora.org/~khorben/200903.html
what is the difference between linking against gcc_s
and gcc
by means of LDFLAGS
?
Is gcc_s
a static library and gcc
shared library?
Because I was looking for a solution where it is mentioned to link against gcc
whereas only gcc_s
works in my case. I wish to know the real difference.
<<hidden symbol `__name_here' in /some/library/path.a(_filename.o) is referenced by DSO
In this case, the problem is usually solved by adding either "-l gcc" or "gcc -print-libgcc-file-name
" to the linking flags (LDFLAGS). However, unlike my other regular platforms (i386, amd64, sparc64) here it wasn't enough. After a lot of head-banging (to be fair, it also comes from the music) I realized that this flag is necessary both when linking the libc and the final executable file.
link: http://people.defora.org/~khorben/200903.html
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
libgcc_s.so
是共享库,libgcc.a
是静态库。它们并不等同;可能有必要将两者联系起来。 libgcc_s 包含全局变量,在一个进程中不得有多个副本; libgcc 中的代码可以安全地链接多次。libgcc_s.so
is a shared library,libgcc.a
is a static library. They are not equivalent; it may be necessary to link both. libgcc_s contains global variables which must not have multiple copies in a process; the code in libgcc is safe to link multiple times.