首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
  • 您找到你想要的搜索结果了吗?
    是的
    没有找到

    安装gcc及其依赖

    在gcc-4.8.2和gcc-4.1.2基础上编译gcc-5.2.0,有可能会遇到一些问题。 要想成功编译gcc,则在编译之前需要安装好它的至少以下三个依赖: gmp mpfr mpc 而mpc又依赖gmp和mpfr。 1) 安装gmp ./configure --prefix=/usr/local/gmp-6.0.0 make make install 2) 安装mpfr ./configure --prefix=/usr/local/mpfr-3.1.3 make make install 3) 安装mpc ./configure --prefix=/usr/local/mpc-1.0.3 --with-gmp=/usr/local/gmp-6.0.0 --with-mpfr=/usr/local/mpfr-3.1.3 make make install 为了成功的编译gcc,建议设置环境变量: export LD_LIBRARY_PATH=/usr/local/mpc-1.0.3/lib:/usr/local/gmp-6.0.0/lib:/usr/local/mpfr-3.1.3/lib:$LD_LIBRARY_PATH 4) 安装gcc-5.2.0 ./configure --prefix=/data/gcc-5.2.0 --with-mpfr=/usr/local/mpfr-3.1.3 --with-gmp=/usr/local/gmp-6.0.0 --with-mpc=/usr/local/mpc-1.0.3 make make install 4) 安装gcc-4.8.2 ./configure --prefix=/data/gcc-4.8.2 --with-mpfr=/usr/local/mpfr-3.1.3 --with-gmp=/usr/local/gmp-6.0.0 --with-mpc=/usr/local/mpc-1.0.3 make make install 常见错误: 错误1) configure: error: C compiler cannot create executables 请尝试设置下LD_LIBRARY_PATH后,再执行configure,再make: export LD_LIBRARY_PATH=/usr/local/mpc-1.0.3/lib:/usr/local/gmp-6.0.0/lib:/usr/local/mpfr-3.1.3/lib:$LD_LIBRARY_PATH 错误2) ../.././libgcc/config/t-softfp:106: 在“else”指令之后含有不该出现的文字 ../.././libgcc/config/t-softfp:113: *** 每个条件只能有一个“else”。 停止。 首先通过find命令找到t-softfp(注意是config目录下的t-softfp): find . -name "t-softfp"  然后进入t-softfp的第106行: vi ./libgcc/config/t-softfp  98 ifeq ($(enable_shared),yes)  99     $(call softfp_set_symver,__$(*F)) 100     if grep strong_alias $(srcdir)/soft-fp/$@ > /dev/null; then \ 101       alias=`grep strong_alias $(srcdir)/soft-fp/$@ | sed -e 's/.*, *//' -e 's/).*//'`; \ 102       $(call softfp_set_symver,$$alias); \ 103     fi 104 endif 105     echo '#endif' >> $@ 106 else ifneq ($(softfp_wrap_start),) 107 softfp_file_list := $(addsuffix .c,$(softfp_func_list)) 108  109 $(softfp_file_list): 110     echo $(softfp_wrap_start) > $@ 111     echo '#include "soft-fp/$@"' >> $@ 112     echo $(softfp_wrap_end) >> $@ 113 else 114 softfp_file_list :=

    02

    当gdb看到一行行的??时,你要冷静!

    下面这段,初看一定会脑大,实际原因非常明确,所以遇到时要先观察,不一定是头大的问题。 gdb -p 1461 GNU gdb 6.6 Copyright (C) 2006 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB.  Type "show warranty" for details. This GDB was configured as "x86_64-suse-linux". Attaching to process 14614 Reading symbols from /home/zhangsan/bin/test...done. Using host libthread_db library "/lib64/libthread_db.so.1". Error while mapping shared library sections: ./libtest.so: No such file or directory. Reading symbols from /lib64/libdl.so.2...done. Loaded symbols for /lib64/libdl.so.2 Reading symbols from /lib64/libz.so.1...done. Loaded symbols for /lib64/libz.so.1 Reading symbols from /usr/lib64/libaio.so.1...done. Loaded symbols for /usr/lib64/libaio.so.1 Symbol file not found for ./libtest.so Reading symbols from /lib64/libc.so.6...done. Loaded symbols for /lib64/libc.so.6 Reading symbols from /lib64/ld-linux-x86-64.so.2...done. Loaded symbols for /lib64/ld-linux-x86-64.so.2 Reading symbols from /usr/lib64/libstdc++.so.6...done. Loaded symbols for /usr/lib64/libstdc++.so.6 Reading symbols from /lib64/libm.so.6...done. Loaded symbols for /lib64/libm.so.6 Reading symbols from /lib64/libgcc_s.so.1...done. Loaded symbols for /lib64/libgcc_s.so.1 Reading symbols from /lib64/libpthread.so.0...done. [Thread debugging using libthread_db enabled] [New Thread 47461298698832 (LWP 14614)] [New Thread 1082132800 (LWP 14618)] Symbol file not found for ./libapr-1.so.0 Reading symbols from /lib64/libcrypt.so.1...done. Loaded symbols for /lib64/libcrypt.so.1 Reading symbols from /lib64/libnss_files.so.2...done. Loaded symbols for /lib64/libnss_files.so.2 0x00002b2a709a9ec1 in free () from /lib64/libc.so.6 (gdb) t 2 [Switching to thread 2 (Thread 1082132800 (LWP 14618))]#0  0x00002b2a709cf476 in poll () from /lib64/libc.so.6 (gdb) bt #0  0x00002b2a709cf476 in poll () from

    01

    使用编译器aarch64-xilinx-linux-gcc,导致uboot编译出现错误“aarch64-xilinx-linux-ld.bfd.real: cannot find -lgcc”

    KV260 PetaLinux BSP 的environment-setup-cortexa72-cortexa53-xilinx-linux会导入aarch64-xilinx-linux系列工具,并设置CROSS_COMPILE为aarch64-xilinx-linux-。 因此使用opensource flow编译U-Boot时,U-Boot编译会默认使用aarch64-xilinx-linux-gcc。但是又找不到aarch64-xilinx-linux-gcc。 在path里添加vitis的aarch64-xilinx-linux-gcc的目录,或者petalinux工程里的aarch64-xilinx-linux-gcc的目录,能编译,但是会出现错误“aarch64-xilinx-linux-ld.bfd.real: cannot find -lgcc”。使用变量LIBRARY_PATH,添加的libgcc.a目录,也失败。 重新设置 CROSS_COMPILE为aarch64-linux-gnu- 能正常以Opensource flow编译U-Boot。

    05
    领券