vsftpd移植到开发板上,交叉编译报 undefined reference to `__stack_chk_fail'和undefined reference to `__stack_错的解决办法
2017-02-09 10:22
363 查看
原本在开发版上已经移植好了vsftpd程序,不过后面因为一些原因更新了开发的sdk。之后再此编译vsftpd时就出现了编译不过的情况,交叉编译器是arm-openwrt-linux-gcc
编译出错的地方的文字提示如下:
arm-openwrt-linux-gcc -o vsftpd main.o utility.o prelogin.o ftpcmdio.o postlogin.o privsock.o tunables.o ftpdataio.o secbuf.o ls.o postprivparent.o logging.o str.o netstr.o sysstr.o strlist.o banner.o filestr.o parseconf.o secutil.o ascii.o oneprocess.o
twoprocess.o privops.o standalone.o hash.o tcpwrap.o ipaddrparse.o access.o features.o readwrite.o opts.o ssl.o sslslave.o ptracesandbox.o ftppolicy.o sysutil.o sysdeputil.o seccompsandbox.o -Wl,-s -fPIE -pie -Wl,-z,relro -Wl,-z,now `./vsf_findlibs.sh`
postlogin.o: In function `process_post_login':
postlogin.c:(.text+0x2614): undefined reference to `__stack_chk_guard'
sysutil.o: In function `vsf_sysutil_accept_timeout':
sysutil.c:(.text+0x1fa4): undefined reference to `__stack_chk_fail'
sysutil.c:(.text+0x1fac): undefined reference to `__stack_chk_guard'
sysutil.o: In function `vsf_sysutil_getsockname':
sysutil.c:(.text+0x2280): undefined reference to `__stack_chk_fail'
sysutil.c:(.text+0x2288): undefined reference to `__stack_chk_guard'
sysutil.o: In function `vsf_sysutil_getpeername':
sysutil.c:(.text+0x2358): undefined reference to `__stack_chk_fail'
sysutil.c:(.text+0x2360): undefined reference to `__stack_chk_guard'
sysutil.o: In function `vsf_sysutil_tzset':
sysutil.c:(.text+0x2e54): undefined reference to `__stack_chk_fail'
sysutil.c:(.text+0x2e5c): undefined reference to `__stack_chk_guard'
sysutil.o: In function `vsf_sysutil_parse_time':
sysutil.c:(.text+0x31e4): undefined reference to `__stack_chk_fail'
sysutil.c:(.text+0x31ec): undefined reference to `__stack_chk_guard'
sysdeputil.o: In function `vsf_sysutil_send_fd':
sysdeputil.c:(.text+0xa60): undefined reference to `__stack_chk_fail'
sysdeputil.c:(.text+0xa68): undefined reference to `__stack_chk_guard'
sysdeputil.o: In function `vsf_sysutil_recv_fd':
sysdeputil.c:(.text+0xb60): undefined reference to `__stack_chk_fail'
sysdeputil.c:(.text+0xb68): undefined reference to `__stack_chk_guard'
collect2: error: ld returned 1 exit status
make[2]: *** [vsftpd] 错误 1
make[2]: Leaving directory `/home/lee/M2_4.0/apps/netmoon/vsftpd/vsftpd-3.0.2'
make[1]: *** [all] 错误 2
make[1]: Leaving directory `/home/lee/M2_4.0/apps/netmoon/vsftpd'
make: *** [apps/netmoon/vsftpd] 错误 2
make[1]: Entering directory `/home/lee/M2_4.0'
make[1]: Leaving directory `/home/lee/M2_4.0'
make: *** [apps/netmoon/vsftpd] 错误 1
报错的提示说 postlogin.c sysutil.c sysdeputil.c中有未定义的引用。我在这些文件中看了也并没有引用名为__stack_chk_guard,__stack_chk_guard的函数。应该不是代码的问题。然后在网上看了一些资料,说的是需要在编译时加上-fno-stack-protector选项。然后去Makefile中在CFLAGS中加上了-fno-stack-protector,之后make
clean一下,再make就好了。 记住一定要make clean一下。
下面是所参考的文章连接:
http://blog.csdn.net/littlehedgehog/article/details/2242113 标题:编译出错 "undefined reference to"
http://bbs.csdn.net/topics/350133222 标题: gcc编译错误undefined reference to `__stack_chk_fail'
编译出错的地方的文字提示如下:
arm-openwrt-linux-gcc -o vsftpd main.o utility.o prelogin.o ftpcmdio.o postlogin.o privsock.o tunables.o ftpdataio.o secbuf.o ls.o postprivparent.o logging.o str.o netstr.o sysstr.o strlist.o banner.o filestr.o parseconf.o secutil.o ascii.o oneprocess.o
twoprocess.o privops.o standalone.o hash.o tcpwrap.o ipaddrparse.o access.o features.o readwrite.o opts.o ssl.o sslslave.o ptracesandbox.o ftppolicy.o sysutil.o sysdeputil.o seccompsandbox.o -Wl,-s -fPIE -pie -Wl,-z,relro -Wl,-z,now `./vsf_findlibs.sh`
postlogin.o: In function `process_post_login':
postlogin.c:(.text+0x2614): undefined reference to `__stack_chk_guard'
sysutil.o: In function `vsf_sysutil_accept_timeout':
sysutil.c:(.text+0x1fa4): undefined reference to `__stack_chk_fail'
sysutil.c:(.text+0x1fac): undefined reference to `__stack_chk_guard'
sysutil.o: In function `vsf_sysutil_getsockname':
sysutil.c:(.text+0x2280): undefined reference to `__stack_chk_fail'
sysutil.c:(.text+0x2288): undefined reference to `__stack_chk_guard'
sysutil.o: In function `vsf_sysutil_getpeername':
sysutil.c:(.text+0x2358): undefined reference to `__stack_chk_fail'
sysutil.c:(.text+0x2360): undefined reference to `__stack_chk_guard'
sysutil.o: In function `vsf_sysutil_tzset':
sysutil.c:(.text+0x2e54): undefined reference to `__stack_chk_fail'
sysutil.c:(.text+0x2e5c): undefined reference to `__stack_chk_guard'
sysutil.o: In function `vsf_sysutil_parse_time':
sysutil.c:(.text+0x31e4): undefined reference to `__stack_chk_fail'
sysutil.c:(.text+0x31ec): undefined reference to `__stack_chk_guard'
sysdeputil.o: In function `vsf_sysutil_send_fd':
sysdeputil.c:(.text+0xa60): undefined reference to `__stack_chk_fail'
sysdeputil.c:(.text+0xa68): undefined reference to `__stack_chk_guard'
sysdeputil.o: In function `vsf_sysutil_recv_fd':
sysdeputil.c:(.text+0xb60): undefined reference to `__stack_chk_fail'
sysdeputil.c:(.text+0xb68): undefined reference to `__stack_chk_guard'
collect2: error: ld returned 1 exit status
make[2]: *** [vsftpd] 错误 1
make[2]: Leaving directory `/home/lee/M2_4.0/apps/netmoon/vsftpd/vsftpd-3.0.2'
make[1]: *** [all] 错误 2
make[1]: Leaving directory `/home/lee/M2_4.0/apps/netmoon/vsftpd'
make: *** [apps/netmoon/vsftpd] 错误 2
make[1]: Entering directory `/home/lee/M2_4.0'
make[1]: Leaving directory `/home/lee/M2_4.0'
make: *** [apps/netmoon/vsftpd] 错误 1
报错的提示说 postlogin.c sysutil.c sysdeputil.c中有未定义的引用。我在这些文件中看了也并没有引用名为__stack_chk_guard,__stack_chk_guard的函数。应该不是代码的问题。然后在网上看了一些资料,说的是需要在编译时加上-fno-stack-protector选项。然后去Makefile中在CFLAGS中加上了-fno-stack-protector,之后make
clean一下,再make就好了。 记住一定要make clean一下。
下面是所参考的文章连接:
http://blog.csdn.net/littlehedgehog/article/details/2242113 标题:编译出错 "undefined reference to"
http://bbs.csdn.net/topics/350133222 标题: gcc编译错误undefined reference to `__stack_chk_fail'
相关文章推荐
- ubuntu中undefined reference to `__stack_chk_fail_local\'问题怎么解决
- gcc undefined reference to '__stack_chk_fail'【操作系统开发编译中遇到的问题】
- 编译Ralink SDK时碰到的奇怪错误(undefined reference to `main')的解决办法
- 编译Ralink SDK时碰到的奇怪错误(undefined reference to `main')的解决办法
- arm编译QT4.8.5时出现lib/libQtGui.so: undefined reference to `ts_read_raw'的解决办法
- Qt4.8.5编译qvfb出现undefined reference to `png_create_write_struct'问题解决办法
- [CentOS]CentOS下编译CPP文件时报错[undefined reference to `__gxx_personality_v0' collect2: ld]的解决办法
- 编译QT时出现lib/libQtGui.so: undefined reference to `ts_read_raw'的解决办法
- undefined reference to `clock_gettime'编译错误的解决办法
- Android之ndk编译出现"undefined reference to method"解决办法
- ubuntu build memtest86+-4.00 error: undefined reference to `__stack_chk_fail_local'
- 编译linux 内核时:decompress.c:(.text+0x25c4): undefined reference to `error'的解决办法
- undefined reference to `__stack_chk_fail'
- undefined reference to `__stack_chk_fail'
- pow函数gcc编译提示 undefined reference to `power' 的解决办法
- 编译时出现undefined reference to `libiconv_open’的解决办法
- undefined reference to `__stack_chk_fail'
- sqlite3 交叉编译 undefined reference to `fdatasync' 错误解决
- 编译Ralink SDK时碰到的奇怪错误(undefined reference to `main')的解决办法
- linux下编译C++文件(undefined reference to.....解决办法)