【发布时间】:2026-02-11 09:55:02
【问题描述】:
我正在尝试在 AIX 上构建 gccgo (9.2),但现在遇到了一个我无法解决的问题。
机器:AIX 7.1,处理器类型:PowerPC_POWER7,CPU 类型:64 位,内核类型:64 位
错误:“./sync/atomic.gox 存在但不包含任何 Go 导出数据”。
所以我查看了 atomic.gox,它是空的。 (所有 .gox 文件都是空的)。
所以接下来我看看 atomic.gox 是如何创建的。该文件由objcopy -j .go_export sync/.libs/atomic.o 创建。所以 atomic.o 的 .go_export 部分用于创建 atomic.gox。通过objdump -s atomic.o,我发现 atomic.o 没有任何 .go_export 部分,只有“.text、.data 和 .debug”。因此,错误行为位于 .o 文件的创建处。为了创建 atomic.o 文件,我找到了以下行:
libtool:编译:/OS/COMPSRV/trunk/user1/src/gccgo-obj/./gcc/gccgo -B/OS/COMPSRV/trunk/user1/src/gccgo-obj/./gcc/ -B/opt/freeware/gcc9/powerpc-ibm-aix7.1.5.0/bin/ -B/opt/freeware/gcc9 /powerpc-ibm-aix7.1.5.0/lib/ -isystem /opt/freeware/gcc9/powerpc-ibm-aix7.1.5.0/include -isystem /opt/freeware/gcc9/powerpc-ibm-aix7.1.5.0/sys-include -O2 -g -I 。 -C -fgo-pkgpath=sync/atomic ../.././../gccgo-src/libgo/go/sync/atomic/doc.go ../.././../gccgo-src/libgo/go/sync/atomic/value.go -fPIC -o 同步/.libs/atomic.o
这些是我的配置参数:
languages="--enable-languages=go,c,c++"
options="CC=/opt/freeware/bin/gcc --without-gnu-ar --without-gnu-as --with-gnu-ld --with-gmp-include=/usr/include/gmp --disable-bootstrap --with-gmp-lib=/usr/lib --with-mpfr-include=/usr/include /mpfr --with-mpfr-lib=/usr/lib --with-mpfr=/usr/include --with-mpc=/usr/include --disable-nls --disable-libquadmath --disable-libssp - -disable-lto --disable-libgomp"
multilib="--enable-multilib"
shared="--enable-shared"
static="--enable-static"
更多信息: 我正在使用 gcc 8.3
编辑:
建议的解决方案:
- 我添加了--enable-libgo,但错误依旧存在
【问题讨论】:
-
也许这是 AIX 链接器 (
ld) 的限制?