Bug 643801

Summary: Internal error: Segmentation fault (program ld) when compiling Google Go
Product: [Fedora] Fedora Reporter: Albert Strasheim <fullung>
Component: mingw32-gccAssignee: Richard W.M. Jones <rjones>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 13CC: fedora-mingw, fullung, kalevlember, rjones
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-06-28 11:29:54 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Small patch for Google Go so that build will use AR from environment none

Description Albert Strasheim 2010-10-18 07:05:29 UTC
Description of problem:

mingw32-gcc's ld segfaults when compiling Google Go.

Version-Release number of selected component (if applicable):

mingw32-gcc-4.4.2-2.fc13.x86_64

How reproducible:

Always

Steps to Reproduce:
1. Read http://golang.org/doc/install.html
2. hg clone -r release https://go.googlecode.com/hg/ go (might need tip)
3. cd go
4. hg patch --no-commit go_make_mingw.diff
5. cd src
6. AR=i686-pc-mingw32-ar GOHOSTARCH=386 CC=i686-pc-mingw32-gcc GOOS=windows GOARCH=386 ./make.bash
  
Actual results:

quietgcc -o 8g -L"/home/alberts/go"/lib ../8l/enam.o list.o galign.o gobj.o ggen.o gsubr.o cgen.o cgen64.o cplx.o peep.o reg.o  ../gc/gc.a  -lbio -l9 -lm
i686-pc-mingw32-gcc: Internal error: Segmentation fault (program ld)
Please submit a full bug report.
See <http://bugzilla.redhat.com/bugzilla> for instructions.

Expected results:

8g command should compile

Additional info:

Comment 1 Albert Strasheim 2010-10-18 07:06:06 UTC
Created attachment 454029 [details]
Small patch for Google Go so that build will use AR from environment

Comment 2 Albert Strasheim 2010-10-18 07:14:00 UTC
*** Bug 643800 has been marked as a duplicate of this bug. ***

Comment 3 Richard W.M. Jones 2010-10-18 07:48:58 UTC
I'm unclear on the bug report.  Is gcc or ld or ar segfaulting, and
what does the AR patch have to do with it?

Comment 4 Albert Strasheim 2010-10-18 07:55:33 UTC
The patch fixes the Go makefiles to use MinGW ar when one sets AR= environment variable.

This allows the build to proceed until ld segfaults while linking a Go binary called "8g".

Comment 5 Albert Strasheim 2010-10-18 07:57:05 UTC
I guess that makes this a binutils bug. I have:

mingw32-binutils-2.19.51.0.14-1.fc12.x86_64

Comment 6 Albert Strasheim 2010-11-02 09:18:05 UTC
The command that runs is:

/usr/lib64/gcc/i686-pc-mingw32/4.4.2/../../../../i686-pc-mingw32/bin/ld --sysroot=/usr/i686-pc-mingw32/sys-root -Bdynamic -o 8l /usr/i686-pc-mingw32/sys-root/mingw/lib/crt2.o /usr/lib64/gcc/i686-pc-mingw32/4.4.2/crtbegin.o -L/home/alberts/go/lib -L/usr/lib64/gcc/i686-pc-mingw32/4.4.2 -L/usr/lib64/gcc/i686-pc-mingw32/4.4.2/../../../../i686-pc-mingw32/lib -L/usr/i686-pc-mingw32/sys-root/mingw/lib asm.o data.o dwarf.o elf.o enam.o go.o lib.o list.o macho.o obj.o optab.o pass.o pe.o prof.o span.o symtab.o -lbio -l9 -lm -lmingw32 -lgcc_eh -lgcc -lmoldname -lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -lmingw32 -lgcc_eh -lgcc -lmoldname -lmingwex -lmsvcrt /usr/lib64/gcc/i686-pc-mingw32/4.4.2/crtend.o

Installed the debuginfo:

Program received signal SIGSEGV, Segmentation fault.
0x0000000000446591 in _bfd_coff_generic_relocate_section (output_bfd=<value optimized out>, info=<value optimized out>, input_bfd=0x7086d0, input_section=0x7523f0, contents=<value optimized out>, relocs=<value optimized out>,
    syms=<value optimized out>, sections=<value optimized out>) at ../../bfd/cofflink.c:2970
2970                          val = h2->root.u.def.value

Backtrace:


#0  0x0000000000446591 in _bfd_coff_generic_relocate_section (output_bfd=<value optimized out>, info=<value optimized out>, input_bfd=0x7086d0, input_section=0x7523f0, contents=<value optimized out>, relocs=<value optimized out>,
    syms=<value optimized out>, sections=<value optimized out>) at ../../bfd/cofflink.c:2970
#1  0x00000000004486fc in _bfd_coff_link_input_bfd (finfo=<value optimized out>, input_bfd=<value optimized out>) at ../../bfd/cofflink.c:2345
#2  0x000000000044a977 in _bfd_coff_final_link (abfd=<value optimized out>, info=0x6e1a80) at ../../bfd/cofflink.c:905
#3  0x000000000041614c in ldwrite () at ../../ld/ldwrite.c:567
#4  0x00000000004151ec in main (argc=47, argv=0x7fffffffe088) at ../../ld/ldmain.c:495

Comment 7 Albert Strasheim 2010-11-02 14:28:47 UTC
Upgrading to:

mingw32-binutils-2.20.1-1.fc14.x86_64
mingw32-cpp-4.5.0-1.fc14.x86_64
mingw32-gcc-4.5.0-1.fc14.x86_64

fixed the problem.

Comment 8 Bug Zapper 2011-05-31 11:09:53 UTC
This message is a reminder that Fedora 13 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 13.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '13'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 13's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 13 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 9 Bug Zapper 2011-06-28 11:29:54 UTC
Fedora 13 changed to end-of-life (EOL) status on 2011-06-25. Fedora 13 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.