我正在尝试编译 binutils 以设置 GNU 工具链,以便在 linux x86 架构上为 ARM 进行交叉编译。
为此,我从以下网址下载了 GNU 工具链:http: //lejosrt.org/tuto/install-gnu-arm-toolchain-under-linux
这需要运行一个脚本来安装和编译所有内容。但是,在运行脚本时,会出现以下错误:
make[2]: 进入目录libiberty.a' make[2]: 离开目录/home/GNU_Toolchain/src/binutils-2.20.51.0.1' make: * [all] Error 2/home/GNU_Toolchain/src/binutils-2.20.51.0.1/libiberty'
rm -f ./libiberty.a pic/./libiberty.a
ar rc ./libiberty.a \
./regex.o ./cplus-dem.o ./cp-demangle.o ./md5.o ./sha1.o ./alloca.o ./argv.o ./choose-temp.o ./concat.o ./cp-demint.o ./crc32.o ./dyn-string.o ./fdmatch.o ./fibheap.o ./filename_cmp.o ./floatformat.o ./fnmatch.o ./fopen_unlocked.o ./getopt.o ./getopt1.o ./getpwd.o ./getruntime.o ./hashtab.o ./hex.o ./lbasename.o ./lrealpath.o ./make-relative-prefix.o ./make-temp-file.o ./objalloc.o ./obstack.o ./partition.o ./pexecute.o ./physmem.o ./pex-common.o ./pex-one.o ./pex-unix.o ./safe-ctype.o ./sort.o ./spaces.o ./splay-tree.o ./strerror.o ./strsignal.o ./unlink-if-ordinary.o ./xatexit.o ./xexit.o ./xmalloc.o ./xmemdup.o ./xstrdup.o ./xstrerror.o ./xstrndup.o
*** buffer overflow detected ***: ar terminated
======= Backtrace: =========
/lib/i386-linux-gnu/libc.so.6(__fortify_fail+0x50)[0x40117df0]
/lib/i386-linux-gnu/libc.so.6(+0xe4cca)[0x40116cca]
/lib/i386-linux-gnu/libc.so.6(+0xe43c8)[0x401163c8]
/lib/i386-linux-gnu/libc.so.6(_IO_default_xsputn+0x95)[0x4009b7e5]
/lib/i386-linux-gnu/libc.so.6(_IO_padn+0xc8)[0x4008f598]
/lib/i386-linux-gnu/libc.so.6(_IO_vfprintf+0x1cd5)[0x40070e35]
/lib/i386-linux-gnu/libc.so.6(__vsprintf_chk+0xad)[0x4011647d]
/lib/i386-linux-gnu/libc.so.6(__sprintf_chk+0x2d)[0x401163bd]
ar[0x804ec04]
ar[0x8050d38]
ar[0x80585c2]
ar[0x804b452]
ar[0x804c3fd]
/lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x40048e37]
ar[0x80494c1]
======= Memory map: ========
08048000-080b5000 r-xp 00000000 08:01 3940915 /usr/local/bin/ar
080b5000-080b6000 r--p 0006c000 08:01 3940915 /usr/local/bin/ar
080b6000-080b7000 rw-p 0006d000 08:01 3940915 /usr/local/bin/ar
080b7000-080bb000 rw-p 00000000 00:00 0
08efe000-08f9d000 rw-p 00000000 00:00 0 [heap]
40000000-4001c000 r-xp 00000000 08:01 3670837 /lib/i386-linux-gnu/ld-2.13.so
4001c000-4001d000 r--p 0001b000 08:01 3670837 /lib/i386-linux-gnu/ld-2.13.so
4001d000-4001e000 rw-p 0001c000 08:01 3670837 /lib/i386-linux-gnu/ld-2.13.so
4001e000-4001f000 r-xp 00000000 00:00 0 [vdso]
4001f000-40021000 rw-p 00000000 00:00 0
40021000-40022000 r--p 0065c000 08:01 3544340 /usr/lib/locale/locale-archive
40032000-4018c000 r-xp 00000000 08:01 3670850 /lib/i386-linux-gnu/libc-2.13.so
4018c000-4018d000 ---p 0015a000 08:01 3670850 /lib/i386-linux-gnu/libc-2.13.so
4018d000-4018f000 r--p 0015a000 08:01 3670850 /lib/i386-linux-gnu/libc-2.13.so
4018f000-40190000 rw-p 0015c000 08:01 3670850 /lib/i386-linux-gnu/libc-2.13.so
40190000-40195000 rw-p 00000000 00:00 0
40195000-40395000 r--p 00000000 08:01 3544340 /usr/lib/locale/locale-archive
403a6000-403c0000 r-xp 00000000 08:01 3670878 /lib/i386-linux-gnu/libgcc_s.so.1
403c0000-403c1000 r--p 00019000 08:01 3670878 /lib/i386-linux-gnu/libgcc_s.so.1
403c1000-403c2000 rw-p 0001a000 08:01 3670878 /lib/i386-linux-gnu/libgcc_s.so.1
bff19000-bff3b000 rw-p 00000000 00:00 0 [stack]
make[2]: *** [libiberty.a] Aborted
make[2]: *** Deleting file/home/GNU_Toolchain/src/binutils-2.20.51.0.1/libiberty'
make[1]: *** [all-libiberty] Error 2
make[1]: Leaving directory
我尝试升级 binutils 包但徒劳无功。
有任何想法吗?提前致谢。