2013-04-03 111 views
2

我的主機系統是Linux debian 2.6.32-5-amd64#1 SMP Mon Feb 25 00:26:11 UTC 2013 x86_64 GNU/Linux。 我想要構建一個LFS,並且glibc編譯現在停止。 以下是錯誤提示,謝謝。lfs glibc編譯ld錯誤

 
/mnt/lfs/sources/glibc-build/resolv/libresolv_pic.a(gethnamaddr.os): In function `getanswer': 
/mnt/lfs/sources/glibc-2.17/resolv/gethnamaddr.c:180: undefined reference to `__stack_chk_guard' 
/mnt/lfs/sources/glibc-2.17/resolv/gethnamaddr.c:483: undefined reference to `__stack_chk_guard' 
/mnt/lfs/sources/glibc-build/resolv/libresolv_pic.a(gethnamaddr.os): In function `res_gethostbyaddr': 
/mnt/lfs/sources/glibc-2.17/resolv/gethnamaddr.c:644: undefined reference to `__stack_chk_guard' 
/mnt/lfs/sources/glibc-2.17/resolv/gethnamaddr.c:783: undefined reference to `__stack_chk_guard' 
/mnt/lfs/sources/glibc-build/resolv/libresolv_pic.a(gethnamaddr.os): In function `__GI_res_gethostbyname2': 
/mnt/lfs/sources/glibc-2.17/resolv/gethnamaddr.c:510: undefined reference to `__stack_chk_guard' 
/mnt/lfs/sources/glibc-build/resolv/libresolv_pic.a(gethnamaddr.os):/mnt/lfs/sources/glibc-2.17/resolv/gethnamaddr.c:636: more undefined references to `__stack_chk_guard' follow 
collect2: error: ld returned 1 exit status 
make[2]: *** [/mnt/lfs/sources/glibc-build/resolv/libresolv.so] Error 1 
make[2]: Leaving directory `/mnt/lfs/sources/glibc-2.17/resolv' 
make[1]: *** [resolv/others] Error 2 
make[1]: Leaving directory `/mnt/lfs/sources/glibc-2.17' 
make: *** [all] Error 2 

回答

0

您的gcc啓用了堆棧保護。

爲了突破這個錯誤:

CFLAGS = 「 - FNO堆棧保護器-02」 的./configure --prefix =/somepath

我的系統我跑:

的mkdir建立

CD建立

CFLAGS = 「 - FNO堆疊保護器-O2」 ../configure前綴=的/ usr/test_glibc

2

我找到了一個解決方案來解決這個問題:

這個海灣合作委員會的第一次通過之前的GCC源sed的修正:

sed -i '/k prot/agcc_cv_libc_provides_ssp=yes' gcc/configure 

和:

sed -i 's/if \((code.*))\)/if (\1 \&\& \!DEBUG_INSN_P (insn))/' gcc/sched-deps.c 

但這些已經在LFS手冊中提到。我不知道爲什麼我沒有看到他們時 我開始與LFS:D

+0

謝謝!在即將開始使用binutils之前發現您的帖子。 – crodjer