静态交叉编译错误

版权声明:本文为博主原创文章,未经允许,不得转载。 https://blog.csdn.net/weixin_41944449/article/details/87066895

当通过增加-static静态交叉编译的时候,编译出现以下问题:

libc.a(vfprintf.o):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
libc.a(vfprintf.o):(.ARM.exidx+0x10): undefined reference to `__aeabi_unwind_cpp_pr1'
libc.a(vfwprintf.o):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
libc.a(vfwprintf.o):(.ARM.exidx+0x18): undefined reference to `__aeabi_unwind_cpp_pr1'
libpthread.a(ptw-close.o):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
libpthread.a(ptw-close.o):(.ARM.exidx+0x10): undefined reference to `__aeabi_unwind_cpp_pr1'
libpthread.a(ptw-open.o):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
libpthread.a(ptw-open.o):(.ARM.exidx+0x10): undefined reference to `__aeabi_unwind_cpp_pr1'
libpthread.a(cancellation.o):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
libpthread.a(unwind.o): In function `unwind_stop':
unwind.c:(.text+0x28): undefined reference to `_Unwind_GetCFA'
unwind.c:(.text+0x60): undefined reference to `_Unwind_GetCFA'
libpthread.a(unwind.o): In function `__pthread_unwind':
unwind.c:(.text+0x124): undefined reference to `_Unwind_ForcedUnwind'
libpthread.a(unwind.o):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
libc.a(libc-start.o):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
libc.a(bsearch.o):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
libc.a(msort.o):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
libc.a(printf.o):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr1'
libc.a(isoc99_scanf.o): In function `__isoc99_scanf':
isoc99_scanf.c:(.text+0x184): undefined reference to `_Unwind_Resume'
libc.a(isoc99_scanf.o):(.ARM.extab+0x0): undefined reference to `__gcc_personality_v0'
libc.a(iofclose.o): In function `_IO_fclose':
iofclose.c:(.text+0x250): undefined reference to `_Unwind_Resume'
libc.a(iofclose.o):(.ARM.extab+0x0): undefined reference to `__gcc_personality_v0'
libc.a(iofflush.o): In function `fflush':
iofflush.c:(.text+0x15c): undefined reference to `_Unwind_Resume'
libc.a(iofflush.o):(.ARM.extab+0x0): undefined reference to `__gcc_personality_v0'
libc.a(iofopen.o):(.ARM.exidx+0x8): undefined reference to `__aeabi_unwind_cpp_pr0'
libc.a(iofread.o): In function `fread':
iofread.c:(.text+0x174): undefined reference to `_Unwind_Resume'
libc.a(iofread.o):(.ARM.extab+0x0): undefined reference to `__gcc_personality_v0'
libc.a(iofwrite.o): In function `fwrite':
iofwrite.c:(.text+0x1a0): undefined reference to `_Unwind_Resume'
libc.a(iofwrite.o):(.ARM.extab+0x0): undefined reference to `__gcc_personality_v0'
libc.a(ioputs.o): In function `puts':
ioputs.c:(.text+0x1c4): undefined reference to `_Unwind_Resume'
libc.a(ioputs.o):(.ARM.extab+0x0): undefined reference to `__gcc_personality_v0'
libc.a(wfileops.o): In function `_IO_wfile_underflow':
wfileops.c:(.text+0x680): undefined reference to `_Unwind_Resume'
libc.a(wfileops.o):(.ARM.extab+0x0): undefined reference to `__gcc_personality_v0'
libc.a(wfileops.o):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
libc.a(fseek.o): In function `fseek':
fseek.c:(.text+0x16c): undefined reference to `_Unwind_Resume'
libc.a(fseek.o):(.ARM.extab+0x0): undefined reference to `__gcc_personality_v0'
libc.a(getchar.o): In function `getchar':
getchar.c:(.text+0x160): undefined reference to `_Unwind_Resume'
libc.a(getchar.o):(.ARM.extab+0x0): undefined reference to `__gcc_personality_v0'
libc.a(fileops.o): In function `_IO_file_underflow':
fileops.c:(.text+0x934): undefined reference to `_Unwind_Resume'
libc.a(fileops.o):(.ARM.extab+0x0): undefined reference to `__gcc_personality_v0'
libc.a(fileops.o):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
libc.a(fileops.o):(.ARM.exidx+0x58): undefined reference to `__aeabi_unwind_cpp_pr1'
libc.a(genops.o):(.ARM.exidx+0x38): undefined reference to `__aeabi_unwind_cpp_pr0'
libc.a(sysconf.o):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
libc.a(sched_yield.o):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
libc.a(read.o):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
libc.a(read.o):(.ARM.exidx+0x10): undefined reference to `__aeabi_unwind_cpp_pr1'
libc.a(write.o):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
libc.a(write.o):(.ARM.exidx+0x10): undefined reference to `__aeabi_unwind_cpp_pr1'
libc.a(fcntl.o):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr1'
libc.a(getrlimit.o):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
libc.a(ioctl.o):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
libc.a(select.o):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
libc.a(select.o):(.ARM.exidx+0x10): undefined reference to `__aeabi_unwind_cpp_pr1'
libc.a(munmap.o):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
libc.a(mprotect.o):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
libc.a(madvise.o):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
libc.a(tsearch.o):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
libc.a(getsysstats.o):(.ARM.exidx+0x8): undefined reference to `__aeabi_unwind_cpp_pr0'
libc.a(mremap.o):(.ARM.exidx+0x0): more undefined references to `__aeabi_unwind_cpp_pr0' follow
libc.a(backtrace.o): In function `backtrace_helper':
backtrace.c:(.text+0x34): undefined reference to `_Unwind_VRS_Get'
libc.a(backtrace.o): In function `backtrace':
backtrace.c:(.text+0x94): undefined reference to `_Unwind_Backtrace'
libc.a(backtrace.o):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr1'
libc.a(sigrestorer.o):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr1'
libc.a(qsort.o):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
libc.a(fprintf.o):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr1'
libc.a(vfscanf.o):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
libc.a(vfscanf.o):(.ARM.exidx+0x8): undefined reference to `__aeabi_unwind_cpp_pr1'
libc.a(iofputs.o): In function `fputs':
iofputs.c:(.text+0x184): undefined reference to `_Unwind_Resume'
libc.a(iofputs.o):(.ARM.extab+0x0): undefined reference to `__gcc_personality_v0'
libc.a(iogetdelim.o): In function `__getdelim':
iogetdelim.c:(.text+0x2b0): undefined reference to `_Unwind_Resume'
libc.a(iogetdelim.o):(.ARM.extab+0x0): undefined reference to `__gcc_personality_v0'
libc.a(iogetline.o):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
libc.a(ioseekoff.o): In function `_IO_seekoff':
ioseekoff.c:(.text+0x25c): undefined reference to `_Unwind_Resume'
libc.a(ioseekoff.o):(.ARM.extab+0x0): undefined reference to `__gcc_personality_v0'
libc.a(wgenops.o):(.ARM.exidx+0x38): undefined reference to `__aeabi_unwind_cpp_pr0'
libc.a(ftello.o): In function `ftello':
ftello.c:(.text+0x1f4): undefined reference to `_Unwind_Resume'
libc.a(ftello.o):(.ARM.extab+0x0): undefined reference to `__gcc_personality_v0'
libc.a(uname.o):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
libc.a(getuid.o):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
libc.a(geteuid.o):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
libc.a(getgid.o):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
libc.a(getegid.o):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
libc.a(lseek.o):(.ARM.exidx+0x0): more undefined references to `__aeabi_unwind_cpp_pr0' follow
libc.a(writev.o):(.ARM.exidx+0x10): undefined reference to `__aeabi_unwind_cpp_pr1'
libc.a(dl-lookup.o):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
libc.a(dl-tlsdesc.o):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
libc.a(dl-tlsdesc.o):(.ARM.exidx+0x10): undefined reference to `__aeabi_unwind_cpp_pr1'
libc.a(dl-runtime.o):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'
libc.a(setitimer.o):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'

可通过增加编译参数-lc -lgcc_eh解决这个问题。

猜你喜欢

转载自blog.csdn.net/weixin_41944449/article/details/87066895
今日推荐