Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gccgo: producing wrong objectfiles on AIX 7.1 #38043

Closed
ken997 opened this issue Mar 24, 2020 · 4 comments
Closed

gccgo: producing wrong objectfiles on AIX 7.1 #38043

ken997 opened this issue Mar 24, 2020 · 4 comments

Comments

@ken997
Copy link

@ken997 ken997 commented Mar 24, 2020

What version of Go are you using (go version)?

I want to use go 1.13

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

AIX 7.1, Processor Type: PowerPC_POWER7, CPU Type: 64-bit, Kernel Type: 64-bit

What did you do?

I tried to build Gccgo on AIX 7.1. Within the build, Gccgo is building object files, which usually include .go_export sections. Out of these object files .gox files (for example atomic.gox) are created with the command "objcopy -j .go_export sync/.libs/atomic.o"

What did you expect to see?

I checked the object files and expected to see the .go_export section.

What did you see instead?

Only 3 sections: .text, .data and .debug. The build of gccgo fails with the Error "./sync/atomic.gox exists but does not contain any Go export data".

This is where object files are created inside the build

libtool: compile: /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 sync/.libs/atomic.o

The configure options to reproduce

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"
$srcdir/configure --prefix=$prefix "$languages" $options $shared $static $multilib "$version" && gmake -j$jobs

Further Informations

I am using gcc 8.3 and building the gccgo 9.2

Sorry if this isn't an issue and AIX 7.1 is just not supported. But I hope somebody can help me.

@dmitshur dmitshur added the OS-AIX label Mar 24, 2020
@dmitshur dmitshur added this to the Gccgo milestone Mar 24, 2020
@dmitshur

This comment has been minimized.

Copy link
Member

@dmitshur dmitshur commented Mar 24, 2020

@dmitshur dmitshur changed the title Gccgo producing wrong objectfiles on AIX 7.1 gccgo: producing wrong objectfiles on AIX 7.1 Mar 24, 2020
@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Mar 24, 2020

@Helflym

This comment has been minimized.

Copy link
Contributor

@Helflym Helflym commented Mar 25, 2020

I think the problem comes from "objcopy". It doesn't work as expected on AIX.
Therefore, we (BullFreeware) have created a special RPM binutils-gccgov1, which provides a better tool for .go_export named "copycsect".
Our GccGo RPM have a patch gcc-9.1.0-libgo-configure-use-copycsect-instead-of-objcopy.patch.txt to replace "objcopy" by "copycsect" in libgo's Makefile.
Tell me if it does fix your problem.

Is there any reason you need 9.2 over 9.1 ?

@ken997

This comment has been minimized.

Copy link
Author

@ken997 ken997 commented Mar 25, 2020

Thank you very much for helping me Helflym. This fixes my problem. I installed the binutils-gccgov1 and changed the configure and configure ac as described in the patch. I only chose a new gccgo version to use go modules, but I think it is also available at 9.1.

@ken997 ken997 closed this Mar 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.