在 Debian、libc6 上升级到 gcc-4.8 后 g++ 链接器错误 [英] g++ Linker errors after upgrading to gcc-4.8 on Debian, libc6

查看:47
本文介绍了在 Debian、libc6 上升级到 gcc-4.8 后 g++ 链接器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚对 Debian Weezy 机器进行了 dist 升级,以便从 gcc-4.7 运行 gcc-4.8.以前的构建环境是健全的,并且可以正常编译.现在它给出了以下链接器错误,任何程序(甚至是微不足道的 hello world):

<上一页>/usr/bin/ld:/usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): 重定位 0 有无效的符号索引 11/usr/bin/ld:/usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): 重定位 1 有无效的符号索引 12/usr/bin/ld:/usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): 重定位 2 有无效的符号索引 2/usr/bin/ld:/usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): 重定位 3 有无效的符号索引 2/usr/bin/ld:/usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): 重定位 4 有无效的符号索引 11/usr/bin/ld:/usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): 重定位 5 有无效的符号索引 13/usr/bin/ld:/usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): 重定位 6 有无效的符号索引 13/usr/bin/ld:/usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): 重定位 7 有无效的符号索引 13/usr/bin/ld:/usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): 重定位 8 有无效的符号索引 12/usr/bin/ld:/usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): 重定位 9 有无效的符号索引 13/usr/bin/ld:/usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): 重定位 10 有无效的符号索引 13/usr/bin/ld:/usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): 重定位 11 有无效的符号索引 13/usr/bin/ld:/usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): 重定位 12 有无效的符号索引 13/usr/bin/ld:/usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): 重定位 13 有无效的符号索引 13/usr/bin/ld:/usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): 重定位 14 的符号索引 13 无效/usr/bin/ld:/usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): 重定位 15 有无效的符号索引 13/usr/bin/ld:/usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): 重定位 16 的符号索引 13 无效/usr/bin/ld:/usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): 重定位 17 有无效的符号索引 13/usr/bin/ld:/usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): 重定位 18 的符号索引 13 无效/usr/bin/ld:/usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): 重定位 19 有无效的符号索引 20/usr/bin/ld:/usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_line): 重定位 0 有无效的符号索引 2/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crt1.o:在函数`_start'中:(.text+0x12): 对 `__libc_csu_fini' 的未定义引用/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crt1.o:在函数`_start'中:(.text+0x19): 对 `__libc_csu_init' 的未定义引用collect2:错误:ld 返回 1 个退出状态

我确定这是与 libc6 相关的简单内容,但我看不出是什么?看到这个错误我很惊讶,因为我假设 dpkg 会处理任何依赖项,所以我不确定这个特定系统是否有问题或 debian 包有问题(这似乎不太可能,因为似乎没有其他人有这个问题!)

有什么想法吗?:)

解决方案

啊!写完这个,作为最后的尝试,我尝试了:

apt-get install libc6-dev --reinstall

(虽然我确信我之前已经这样做了),你瞧,问题就解决了!

I have just dist-upgraded a Debian Weezy machine to run gcc-4.8 from gcc-4.7. Previously the build environment was sane and was compiling normally. Now it gives the following linker errors, with any program (even a trivial hello world):

/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 0 has invalid symbol index 11
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 1 has invalid symbol index 12
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 2 has invalid symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 3 has invalid symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 4 has invalid symbol index 11
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 5 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 6 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 7 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 8 has invalid symbol index 12
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 9 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 10 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 11 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 12 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 13 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 14 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 15 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 16 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 17 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 18 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 19 has invalid symbol index 20
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_line): relocation 0 has invalid symbol index 2
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x12): undefined reference to `__libc_csu_fini'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x19): undefined reference to `__libc_csu_init'
collect2: error: ld returned 1 exit status

I'm sure this is something simple connected with libc6, but I can't see what? I'm quite surprised to be seeing this error since I'd have assumed dpkg would have taken care of any dependencies, so I'm not sure if it's something wrong with this specific system or an issue with the debian package (which seems unlikely, since nobody else seems to have this problem!)

Any ideas? :)

解决方案

Ah! As soon as I finished typing this, as a last ditch, I tried:

apt-get install libc6-dev --reinstall

(although I was convinced I'd already done it previously), and lo and behold, the issue went away!

这篇关于在 Debian、libc6 上升级到 gcc-4.8 后 g++ 链接器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆