运行hello_word遇到GLIBC_2.29 not defined in file libc.so.6改怎么办
-
如题,请问各位大佬,在D1运行hello_word看到
./hello_word: relocation error: ./hello_word: symbol __libc_start_main version GLIBC_2.29 not defined in file libc.so.6 with link time reference
这种情况该如何解决呢?
-
是不是用哪吒tina的SDK呢?如果用里面同一个gcc编译的话,libc.so.6 应该是 不会出这个错误提示的。
-
用编译rootfs的编译器编译
-
@tigger @YuzukiTsuru 大佬们,我用的官网提供的链接(如下说明),下载下来是一个叫riscv64-linux-x86_64-20210329.tar.gz的工具
如果您只是想先试玩一下,还没下载完整源码,可以单独下载编译工具链: riscv64-glibc-gcc-thead_20200702下载
另外我检查了开发板的Glibc版本发现就是2.29啊,看不懂了
root@TinaLinux:/# /lib/libc.so.6 GNU C Library (GNU libc) stable release version 2.29. Copyright (C) 2019 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Compiled by GNU CC version 8.1.0. libc ABIs: UNIQUE ABSOLUTE For bug reporting instructions, please see: <http://www.gnu.org/software/libc/bugs.html>.
-
@yuzukitsuru 大佬这个编译器是指那个,是官网那个吗链接,我下载拿到的是riscv64-linux-x86_64-20210329.tar.gz
-
@oiouou123 tina源码里的编译器,应该就是那个
Using built-in specs. COLLECT_GCC=./riscv64-unknown-linux-gnu-gcc COLLECT_LTO_WRAPPER=/home/yuzuki/WorkSpace/tina-d1-h/prebuilt/gcc/linux-x86/riscv/toolchain-thead-glibc/riscv64-glibc-gcc-thead_20200702/bin/../libexec/gcc/riscv64-unknown-linux-gnu/8.1.0/lto-wrapper Target: riscv64-unknown-linux-gnu Configured with: /ldhome/software/toolsbuild/slave/workspace/riscv64_build_linux_x86_64/build/../source/riscv/riscv-gcc/configure --target=riscv64-unknown-linux-gnu --with-mpc=/ldhome/software/toolsbuild/slave/workspace/riscv64_build_linux_x86_64/lib-for-gcc-x86_64-linux/ --with-mpfr=/ldhome/software/toolsbuild/slave/workspace/riscv64_build_linux_x86_64/lib-for-gcc-x86_64-linux/ --with-gmp=/ldhome/software/toolsbuild/slave/workspace/riscv64_build_linux_x86_64/lib-for-gcc-x86_64-linux/ --prefix=/ldhome/software/toolsbuild/slave/workspace/riscv64_build_linux_x86_64/install --with-sysroot=/ldhome/software/toolsbuild/slave/workspace/riscv64_build_linux_x86_64/install/sysroot --with-system-zlib --enable-shared --enable-tls --enable-languages=c,c++,fortran --disable-libmudflap --disable-libssp --disable-libquadmath --disable-nls --disable-bootstrap --src=../../source/riscv/riscv-gcc --enable-checking=yes --with-pkgversion='C-SKY RISCV Tools V1.8.4 B20200702' --enable-multilib --with-abi=lp64d --with-arch=rv64gcxthead 'CFLAGS_FOR_TARGET=-O2 -mcmodel=medany' 'CXXFLAGS_FOR_TARGET=-O2 -mcmodel=medany' CC=gcc CXX=g++ Thread model: posix gcc version 8.1.0 (C-SKY RISCV Tools V1.8.4 B20200702)
-
@yuzukitsuru 大佬,我看了一眼发现版本不一样,我找找源码里的,感谢!
Using built-in specs. COLLECT_GCC=./riscv64-unknown-linux-gnu-gcc COLLECT_LTO_WRAPPER=/mnt/f/riscv/bin/../libexec/gcc/riscv64-unknown-linux-gnu/10.2.0/lto-wrapper Target: riscv64-unknown-linux-gnu Configured with: /ldhome/software/toolsbuild/slave2/workspace/Toolchain/release-riscv-0/build/../source/riscv/riscv-gcc/configure --target=riscv64-unknown-linux-gnu --with-gmp=/ldhome/software/toolsbuild/slave2/workspace/Toolchain/release-riscv-0/lib-for-gcc-x86_64-linux/ --with-mpfr=/ldhome/software/toolsbuild/slave2/workspace/Toolchain/release-riscv-0/lib-for-gcc-x86_64-linux/ --with-mpc=/ldhome/software/toolsbuild/slave2/workspace/Toolchain/release-riscv-0/lib-for-gcc-x86_64-linux/ --with-libexpat-prefix=/ldhome/software/toolsbuild/slave2/workspace/Toolchain/release-riscv-0/lib-for-gcc-x86_64-linux/ --with-pkgversion='T-HEAD RISCV Tools V2.0.0.10 B20210329' --prefix=/ldhome/software/toolsbuild/slave2/workspace/Toolchain/release-riscv-0/install --with-sysroot=/ldhome/software/toolsbuild/slave2/workspace/Toolchain/release-riscv-0/install/sysroot --with-system-zlib --enable-shared --enable-tls --enable-languages=c,c++,fortran --disable-libmudflap --disable-libssp --disable-libquadmath --disable-libsanitizer --disable-nls --disable-bootstrap --src=../../source/riscv/riscv-gcc --enable-multilib --with-abi=lp64d --with-arch=rv64gcxthead 'CFLAGS_FOR_TARGET=-O2 -mcmodel=medany' 'CXXFLAGS_FOR_TARGET=-O2 -mcmodel=medany' Thread model: posix Supported LTO compression algorithms: zlib gcc version 10.2.0 (T-HEAD RISCV Tools V2.0.0.10 B20210329)
-
@yuzukitsuru 谢谢大佬,直接装D1源码,用
/tina-d1-h/prebuilt/gcc/linux-x86/riscv/toolchain-thead-glibc/riscv64-glibc-gcc-thead_20200702/bin
底下的./riscv64-unknown-linux-gnu-gcc编译,可以看到结果root@TinaLinux:/# ./hello Hello NeZha
-
@oiouou123 恭喜跑通hellow world!下一步 改变世界!
Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号