交叉围栏GCC:在检查动态链接器特征时,在GCC_NO_EXECUTABLES之后不允许链接测试
Crosscompiling GCC: Link tests are not allowed after GCC_NO_EXECUTABLES when checking dynamic linker characteristics
我正在尝试通过此操作来编译LFS的gcc-4.8.3
。
使用make
时,我会收到以下错误:
checking dynamic linker characteristics... configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES.
make[1]: *** [configure-target-libstdc++-v3] Error 1
make[1]: Leaving directory `/mnt/c/Users/admin/Desktop/Projects/AssaultArchitecture/sources/gcc-4.8.3/build'
make: *** [all] Error 2
配置选项:
../configure
--target=$LFS_TGT
--prefix=/tools
--with-glibc-version=2.11
--with-sysroot=$LFS
--with-newlib
--without-headers
--with-local-prefix=/tools
--with-native-system-header-dir=/tools/include
--disable-nls
--disable-shared
--disable-multilib
--disable-decimal-float
--disable-threads
--disable-libatomic
--disable-libgomp
--disable-libmpx
--disable-libquadmath
--disable-libssp
--disable-libvtv
--disable-libstdcxx
--enable-languages=c,c++
其中 $LFS_TGT
是 x86_64-lfs-linux-gnu
。
pastebin上的 config.log
。
最后几行输出行:
checking if /mnt/c/Users/admin/Desktop/Projects/AssaultArchitecture/sources/gcc-4.8.3/build/./gcc/xgcc -B/mnt/c/Users/admin/Desktop/Projects/AssaultArchitecture/sources/gcc-4.8.3/build/./gcc/ -B/tools/x86_64-lfs-linux-gnu/bin/ -B/tools/x86_64-lfs-linux-gnu/lib/ -isystem /tools/x86_64-lfs-linux-gnu/include -isystem /tools/x86_64-lfs-linux-gnu/sys-include supports -fno-rtti -fno-exceptions... no
checking for /mnt/c/Users/admin/Desktop/Projects/AssaultArchitecture/sources/gcc-4.8.3/build/./gcc/xgcc -B/mnt/c/Users/admin/Desktop/Projects/AssaultArchitecture/sources/gcc-4.8.3/build/./gcc/ -B/tools/x86_64-lfs-linux-gnu/bin/ -B/tools/x86_64-lfs-linux-gnu/lib/ -isystem /tools/x86_64-lfs-linux-gnu/include -isystem /tools/x86_64-lfs-linux-gnu/sys-include option to produce PIC... -fPIC -DPIC
checking if /mnt/c/Users/admin/Desktop/Projects/AssaultArchitecture/sources/gcc-4.8.3/build/./gcc/xgcc -B/mnt/c/Users/admin/Desktop/Projects/AssaultArchitecture/sources/gcc-4.8.3/build/./gcc/ -B/tools/x86_64-lfs-linux-gnu/bin/ -B/tools/x86_64-lfs-linux-gnu/lib/ -isystem /tools/x86_64-lfs-linux-gnu/include -isystem /tools/x86_64-lfs-linux-gnu/sys-include PIC flag -fPIC -DPIC works... yes
checking if /mnt/c/Users/admin/Desktop/Projects/AssaultArchitecture/sources/gcc-4.8.3/build/./gcc/xgcc -B/mnt/c/Users/admin/Desktop/Projects/AssaultArchitecture/sources/gcc-4.8.3/build/./gcc/ -B/tools/x86_64-lfs-linux-gnu/bin/ -B/tools/x86_64-lfs-linux-gnu/lib/ -isystem /tools/x86_64-lfs-linux-gnu/include -isystem /tools/x86_64-lfs-linux-gnu/sys-include static flag -static works... no
checking if /mnt/c/Users/admin/Desktop/Projects/AssaultArchitecture/sources/gcc-4.8.3/build/./gcc/xgcc -B/mnt/c/Users/admin/Desktop/Projects/AssaultArchitecture/sources/gcc-4.8.3/build/./gcc/ -B/tools/x86_64-lfs-linux-gnu/bin/ -B/tools/x86_64-lfs-linux-gnu/lib/ -isystem /tools/x86_64-lfs-linux-gnu/include -isystem /tools/x86_64-lfs-linux-gnu/sys-include supports -c -o file.o... yes
checking if /mnt/c/Users/admin/Desktop/Projects/AssaultArchitecture/sources/gcc-4.8.3/build/./gcc/xgcc -B/mnt/c/Users/admin/Desktop/Projects/AssaultArchitecture/sources/gcc-4.8.3/build/./gcc/ -B/tools/x86_64-lfs-linux-gnu/bin/ -B/tools/x86_64-lfs-linux-gnu/lib/ -isystem /tools/x86_64-lfs-linux-gnu/include -isystem /tools/x86_64-lfs-linux-gnu/sys-include supports -c -o file.o... (cached) yes
checking whether the /mnt/c/Users/admin/Desktop/Projects/AssaultArchitecture/sources/gcc-4.8.3/build/./gcc/xgcc -B/mnt/c/Users/admin/Desktop/Projects/AssaultArchitecture/sources/gcc-4.8.3/build/./gcc/ -B/tools/x86_64-lfs-linux-gnu/bin/ -B/tools/x86_64-lfs-linux-gnu/lib/ -isystem /tools/x86_64-lfs-linux-gnu/include -isystem /tools/x86_64-lfs-linux-gnu/sys-include linker (/mnt/c/Users/admin/Desktop/Projects/AssaultArchitecture/sources/gcc-4.8.3/build/./gcc/collect-ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES.
make[1]: *** [configure-target-libstdc++-v3] Error 1
make[1]: Leaving directory `/mnt/c/Users/admin/Desktop/Projects/AssaultArchitecture/sources/gcc-4.8.3/build'
make: *** [all] Error 2
如果您在x86_64
机器上构建了此功能,并且将x86_64
作为目标,则实际上并没有构建交叉编译器。
您似乎正在构建隔离的stage1编译器,因此您必须添加--disable-bootstrap
标志。GCC默认情况下,如果您的构建目标平台不是本机平台(交叉编译器)。
完全相同的问题:
https://gcc.gnu.org/ml/gcc-help/2012-07/msg00018.html
建议可能缺少适当的glibc
(目标x86_64-lfs-linux-gnu
),需要安装。
hth。
如果要构建LFS,则应检查使用的用户,并确保它不是根。
您需要检查config.log
以找出命令configure
尝试运行的命令;例如:
configure:9604: checking whether the x86_64-lfs-linux-gnu-gcc linker (/usr/x86_64-lfs-linux-gnu/bin/ld -m elf_x86_64
) supports shared libraries
configure:10684: result: no
configure:10929: checking dynamic linker characteristics
configure:11375: error: Link tests are not allowed after GCC_NO_EXECUTABLES.
在这种情况下,手动运行/usr/x86_64-lfs-linux-gnu/bin/ld -m elf_x86_64
。它可能会产生类似的东西:
/usr/x86_64-lfs-linux-gnu/bin/ld: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
因此,在这种情况下,您会知道找不到libz.so.1
。
相关文章:
- 未知的 GCC 链接器错误,但已成功构建
- 微控制器的首次 gcc 链接器脚本编译但不运行
- 简单派生类上的Linux GCC链接错误
- 可能的 GCC 链接器错误会导致将弱符号和局部符号链接在一起时出错
- GCC链接器 - 将存档中的所有对象文件映射到特定部分
- 在Mac 10.9 Mavericks上,clang配置与gcc链接配置不同吗
- 使用GCC链接库中的Ubuntu中的C 代码
- GCC链接器:使用了哪些输入库
- 如何将GCC链接器固定地址添加到链接文件中
- 源代码生成的gcc链接错误
- fedora上的gcc链接器错误:未定义的引用
- GCC链接器抱怨对现有全局变量的未定义引用
- 编译静态库时出现 GCC 链接器错误
- 为什么gcc链接器对.a文件和.o文件的行为不同
- gcc链接的默认库
- 如何将C++共享库与 gcc 链接
- x86_64-pc-cygwin-gcc 链接器错误
- GCC 链接错误"__wcsrtombs: Zusicherung »data.__outbuf[-1] == '