#1730·cross

sparcv9-sun-solaris 链接错误 '未定义 `__sysconf_xpg7`'

作者: Wyvern创建于 2025年12月21日更新于 2026年7月4日

sparcv9-sun-solaris 交叉编译出现链接错误: error: linking with 'sparcv9-sun-solaris2.10-gcc' failed: exit status: 1 note: "sparcv9-sun-solaris2.10-gcc" "-m64" "<1 object files omitted>" "-Wl,-z,ignore" "-Wl,-Bstatic" "/project/build-dir/sparcv9-sun-solaris/src/build/compiler_builtins/1cba6cf8fd5c5c75/deps/libcompiler_builtins-1cba6cf8fd5c5c75.rlib" "-Wl,-Bdynamic" "-lsendfile" "-llgrp" "-lsocket" "-lposix4" "-lpthread" "-lresolv" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lsendfile" "-llgrp" "-L" "/tmp<sysroot>cJ0efRX/raw-dylibs" "-o" "/project/build-dir/sparcv9-sun-solaris/src/build/Img/26156b48f1a83f81/deps/Img" "-Wl,--strip-all" "-nodefaultlibs" note: some arguments are omitted. use `--verbose` to show all linker arguments note: /usr/local/lib/gcc/sparcv9-sun-solaris2.10/8.4.0/../../../../sparcv9-sun-solaris2.10/bin/ld: warning: -z ignore ignored. /project/build-dir/sparcv9-sun-solaris/src/build/Img/26156b48f1a83f81/deps/Img.Img.f3822acec0a0948b-cgu.0.rcgu.o: In function `_RNxC3Img12H8lQSjiMX4h2`: Img.f3822acec0a0948b-cgu.0:(.text._RNxC3Img12H8lQSjiMX4h2+0x65c): undefined reference to `__sysconf_xpg7` /project/build-dir/sparcv9-sun-solaris/src/build/Img/26156b48f1a83f81/deps/Img.Img.f3822acec0a0948b-cgu.0.rcgu.o: In function `main`: Img.f3822acec0a0948b-cgu.0:(.text.main+0x214): undefined reference to `__sysconf_xpg7` collect2: error: ld returned 1 exit status note: some 'extern' functions couldn't be found; some native libraries may need to be installed or have their path specified note: use the `-l` flag to specify native libraries to link note: use the 'cargo:rustc-link-lib' directive to specify the native libraries to link with Cargo (see https://doc.Rust-lang.org/cargo/reference/build-scripts.html#rustc-link-lib) I think 'sparcv9-sun-solaris2.10' should be upgraded to 'sparcv9-sun-solaris2.11' to fix this problem.