undefined reference to `__strtof128_nan@GLIBC_PRIVATE’

huangapple go评论105阅读模式
英文:

undefined reference to `__strtof128_nan@GLIBC_PRIVATE'

问题

我正在尝试交叉编译一个打包到Debian-8(jessie)的软件包,它使用的是glibc-2.19。在交叉编译软件包时,出现了以下错误。

CMake Error at /usr/share/cmake-3.10/Modules/CMakeTestCXXCompiler.cmake:45 (message):
C++编译器
"/opt/jessiesdk-cxx/bin/i686-pc-linux-gnu-g++"
无法编译一个简单的测试程序。
它失败并显示以下输出:

Change Dir: /home/ach/ros2/ros2_core/build/ament_index_cpp/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_04f3a/fast"
/usr/bin/make -f CMakeFiles/cmTC_04f3a.dir/build.make CMakeFiles/cmTC_04f3a.dir/build
make1: 进入目录'/home/ach/ros2/ros2_core/build/ament_index_cpp/CMakeFiles/CMakeTmp'
正在构建CXX对象CMakeFiles/cmTC_04f3a.dir/testCXXCompiler.cxx.o
/opt/jessiesdk-cxx/bin/i686-pc-linux-gnu-g++ --sysroot=/opt/jessiesdk-cxx/i686-pc-linux-gnu/sysroot -o CMakeFiles/cmTC_04f3a.dir/testCXXCompiler.cxx.o -c /home/ach/ros2/ros2_core/build/ament_index_cpp/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
Linking CXX executable cmTC_04f3a
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_04f3a.dir/link.txt --verbose=1
/opt/jessiesdk-cxx/bin/i686-pc-linux-gnu-g++ --sysroot=/opt/jessiesdk-cxx/i686-pc-linux-gnu/sysroot CMakeFiles/cmTC_04f3a.dir/testCXXCompiler.cxx.o -o cmTC_04f3a
/opt/jessiesdk-cxx/lib/gcc/i686-pc-linux-gnu/7.5.0/../../../../i686-pc-linux-gnu/bin/ld: /opt/jessiesdk-cxx/i686-pc-linux-gnu/sysroot/usr/lib/i386-linux-gnu/libm.so: 对“__strtold_nan@GLIBC_PRIVATE”的引用未定义
/opt/jessiesdk-cxx/lib/gcc/i686-pc-linux-gnu/7.5.0/../../../../i686-pc-linux-gnu/bin/ld: /opt/jessiesdk-cxx/i686-pc-linux-gnu/sysroot/usr/lib/i386-linux-gnu/libm.so: 对“__strtof_nan@GLIBC_PRIVATE”的引用未定义
/opt/jessiesdk-cxx/lib/gcc/i686-pc-linux-gnu/7.5.0/../../../../i686-pc-linux-gnu/bin/ld: /opt/jessiesdk-cxx/i686-pc-linux-gnu/sysroot/usr/lib/i386-linux-gnu/libm.so: 对“__strtod_nan@GLIBC_PRIVATE”的引用未定义
/opt/jessiesdk-cxx/lib/gcc/i686-pc-linux-gnu/7.5.0/../../../../i686-pc-linux-gnu/bin/ld: /opt/jessiesdk-cxx/i686-pc-linux-gnu/sysroot/usr/lib/i386-linux-gnu/libm.so: 对“__strtof128_nan@GLIBC_PRIVATE”的引用未定义
collect2: 错误:ld 返回 1 退出状态
CMakeFiles/cmTC_04f3a.dir/build.make:97: 目标'cmTC_04f3a' 失败
make1: *** [cmTC_04f3a] 错误 1
make1: 离开目录'/home/ach/ros2/ros2_core/build/ament_index_cpp/CMakeFiles/CMakeTmp'
Makefile:126: 目标'cmTC_04f3a/fast' 失败
make: *** [cmTC_04f3a/fast] 错误 2

CMake将无法正确生成此项目。
调用堆栈(最近的调用最先):
CMakeLists.txt:3 (project)


失败 ament_index_cpp [退出代码 1]

经过一些搜索,我发现ABI实验室。这是否意味着我需要至少glibc 2.26才能编译这个软件包?
有没有办法解决这个问题?
谢谢。

英文:

I am trying to cross-compiling a packing to debian-8 (jessie), which comes with glibc-2.19. While cross-compiling the package it throwed the following error.

CMake Error at /usr/share/cmake-3.10/Modules/CMakeTestCXXCompiler.cmake:45 (message):
  The C++ compiler

    "/opt/jessiesdk-cxx/bin/i686-pc-linux-gnu-g++"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /home/ach/ros2/ros2_core/build/ament_index_cpp/CMakeFiles/CMakeTmp
    
    Run Build Command:"/usr/bin/make" "cmTC_04f3a/fast"
    /usr/bin/make -f CMakeFiles/cmTC_04f3a.dir/build.make CMakeFiles/cmTC_04f3a.dir/build
    make[1]: Entering directory '/home/ach/ros2/ros2_core/build/ament_index_cpp/CMakeFiles/CMakeTmp'
    Building CXX object CMakeFiles/cmTC_04f3a.dir/testCXXCompiler.cxx.o
    /opt/jessiesdk-cxx/bin/i686-pc-linux-gnu-g++ --sysroot=/opt/jessiesdk-cxx/i686-pc-linux-gnu/sysroot     -o CMakeFiles/cmTC_04f3a.dir/testCXXCompiler.cxx.o -c /home/ach/ros2/ros2_core/build/ament_index_cpp/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
    Linking CXX executable cmTC_04f3a
    /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_04f3a.dir/link.txt --verbose=1
    /opt/jessiesdk-cxx/bin/i686-pc-linux-gnu-g++ --sysroot=/opt/jessiesdk-cxx/i686-pc-linux-gnu/sysroot       CMakeFiles/cmTC_04f3a.dir/testCXXCompiler.cxx.o  -o cmTC_04f3a 
    /opt/jessiesdk-cxx/lib/gcc/i686-pc-linux-gnu/7.5.0/../../../../i686-pc-linux-gnu/bin/ld: /opt/jessiesdk-cxx/i686-pc-linux-gnu/sysroot/usr/lib/i386-linux-gnu/libm.so: undefined reference to `__strtold_nan@GLIBC_PRIVATE'
    /opt/jessiesdk-cxx/lib/gcc/i686-pc-linux-gnu/7.5.0/../../../../i686-pc-linux-gnu/bin/ld: /opt/jessiesdk-cxx/i686-pc-linux-gnu/sysroot/usr/lib/i386-linux-gnu/libm.so: undefined reference to `__strtof_nan@GLIBC_PRIVATE'
    /opt/jessiesdk-cxx/lib/gcc/i686-pc-linux-gnu/7.5.0/../../../../i686-pc-linux-gnu/bin/ld: /opt/jessiesdk-cxx/i686-pc-linux-gnu/sysroot/usr/lib/i386-linux-gnu/libm.so: undefined reference to `__strtod_nan@GLIBC_PRIVATE'
    /opt/jessiesdk-cxx/lib/gcc/i686-pc-linux-gnu/7.5.0/../../../../i686-pc-linux-gnu/bin/ld: /opt/jessiesdk-cxx/i686-pc-linux-gnu/sysroot/usr/lib/i386-linux-gnu/libm.so: undefined reference to `__strtof128_nan@GLIBC_PRIVATE'
    collect2: error: ld returned 1 exit status
    CMakeFiles/cmTC_04f3a.dir/build.make:97: recipe for target 'cmTC_04f3a' failed
    make[1]: *** [cmTC_04f3a] Error 1
    make[1]: Leaving directory '/home/ach/ros2/ros2_core/build/ament_index_cpp/CMakeFiles/CMakeTmp'
    Makefile:126: recipe for target 'cmTC_04f3a/fast' failed
    make: *** [cmTC_04f3a/fast] Error 2
     

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:3 (project)


---
Failed   <<< ament_index_cpp	[ Exited with code 1 ]

After a bit of googling i found ABI Laboratory. Does this mean i require a glibc at least 2.26 in order to compile the package ?

Is there a way around this ?

Thanks..

答案1

得分: 1

"Something is wrong with the way the cross-compiler has been set up.
It looks like your sysroot contains a copy of a newer libm along with the older libc for Debian jessie.

__strtof128_nan@GLIBC_PRIVATE is an internal reference in the libm library of glibc, used to call into the libc library. These internal references only work properly if libm and libc were part of the same glibc build."

英文:

Something is wrong with the way the cross-compiler has been set up.
It looks like your sysroot contains a copy of a newer libm along with the older libc for Debian jessie.

__strtof128_nan@GLIBC_PRIVATE is an internal reference in the libm library of glibc, used to call into the libc library. These internal references only work properly if libm and libc were part of the same glibc build.

huangapple
  • 本文由 发表于 2020年1月3日 19:52:34
  • 转载请务必保留本文链接:https://go.coder-hub.com/59578152.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定