[GHC] #14300: FreeBSD 10.3 toolchain is terribly broken

GHC ghc-devs at haskell.org
Tue Oct 3 15:04:13 UTC 2017


#14300: FreeBSD 10.3 toolchain is terribly broken
---------------------------------+----------------------------------------
        Reporter:  bgamari       |                Owner:  (none)
            Type:  bug           |               Status:  closed
        Priority:  normal        |            Milestone:
       Component:  Compiler      |              Version:  8.2.1
      Resolution:  fixed         |             Keywords:
Operating System:  FreeBSD       |         Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown  |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:  #13974        |  Differential Rev(s):
       Wiki Page:                |
---------------------------------+----------------------------------------
Changes (by bgamari):

 * status:  new => closed
 * resolution:   => fixed


Old description:

> == `clang`, `ld.bfd` with `SplitSections=NO`
>
> Fails in the final bindist test with,
> {{{
> /usr/bin/install -c -m 755  libraries/gen_contents_index "/usr/home/ben
> /bin-
> dist-8.2.1.20170929-FreeBSD/test/inst/share/doc/ghc-8.2.1.20170929/html/libraries/"
> [1 of 1] Compiling Main             ( /usr/home/ben/bin-
> dist-8.2.1.20170929-FreeBSD/test/hi.hs, /usr/home/ben/bin-
> dist-8.2.1.20170929-FreeBSD/test/hi.o )
> Linking /usr/home/ben/bin-dist-8.2.1.20170929-FreeBSD/test/hi ...
> /usr/bin/ld: Base__199.o: access beyond end of merged section (-24)
> /usr/bin/ld: Base__201.o: access beyond end of merged section (-24)
> ...
> }}}
>
> == `clang`, `ld.bfd` with `SplitSections=YES`
>
> fails with,
> {{{
> bindisttest/"install   dir"/bin/ghc --make bindisttest/HelloWorld
> [1 of 1] Compiling Main             ( bindisttest/HelloWorld.lhs,
> bindisttest/HelloWorld.o )
> Linking bindisttest/HelloWorld ...
> /usr/home/ben/bin-dist-8.2.1.20170929-FreeBSD/ghc/bindisttest/install
> dir/lib/ghc-8.2.1.20170929/base-4.10.0.0/libHSbase-4.10.0.0.a(Base.o):base_ControlziExceptionziBase_absentError_info:
> warning: relocation refers to discarded section
> /usr/home/ben/bin-dist-8.2.1.20170929-FreeBSD/ghc/bindisttest/install
> dir/lib/ghc-8.2.1.20170929/base-4.10.0.0/libHSbase-4.10.0.0.a(Base.o)(.text.r3zN_info+0x44):
> warning: relocation refers to discarded section
> /usr/home/ben/bin-dist-8.2.1.20170929-FreeBSD/ghc/bindisttest/install
> dir/lib/ghc-8.2.1.20170929/base-4.10.0.0/libHSbase-4.10.0.0.a(Base.o)(.text.r3zP_info+0x44):
> warning: relocation refers to discarded section
> /usr/home/ben/bin-dist-8.2.1.20170929-FreeBSD/ghc/bindisttest/install
> dir/lib/ghc-8.2.1.20170929/base-4.10.0.0/libHSbase-4.10.0.0.a(Base.o)(.text.r3zR_info+0x44):
> warning: relocation refers to discarded section
> ...
> }}}
>
> == `clang`, `ld.gold`, `SplitSections=NO`
>
> {{{
> ...
> }}}

New description:

 == `clang`, `ld.bfd` with `SplitSections=NO`

 Fails in the final bindist test with,
 {{{
 /usr/bin/install -c -m 755  libraries/gen_contents_index "/usr/home/ben
 /bin-
 dist-8.2.1.20170929-FreeBSD/test/inst/share/doc/ghc-8.2.1.20170929/html/libraries/"
 [1 of 1] Compiling Main             ( /usr/home/ben/bin-
 dist-8.2.1.20170929-FreeBSD/test/hi.hs, /usr/home/ben/bin-
 dist-8.2.1.20170929-FreeBSD/test/hi.o )
 Linking /usr/home/ben/bin-dist-8.2.1.20170929-FreeBSD/test/hi ...
 /usr/bin/ld: Base__199.o: access beyond end of merged section (-24)
 /usr/bin/ld: Base__201.o: access beyond end of merged section (-24)
 ...
 }}}

 == `clang`, `ld.bfd` with `SplitSections=YES`

 fails with,
 {{{
 bindisttest/"install   dir"/bin/ghc --make bindisttest/HelloWorld
 [1 of 1] Compiling Main             ( bindisttest/HelloWorld.lhs,
 bindisttest/HelloWorld.o )
 Linking bindisttest/HelloWorld ...
 /usr/home/ben/bin-dist-8.2.1.20170929-FreeBSD/ghc/bindisttest/install
 dir/lib/ghc-8.2.1.20170929/base-4.10.0.0/libHSbase-4.10.0.0.a(Base.o):base_ControlziExceptionziBase_absentError_info:
 warning: relocation refers to discarded section
 /usr/home/ben/bin-dist-8.2.1.20170929-FreeBSD/ghc/bindisttest/install
 dir/lib/ghc-8.2.1.20170929/base-4.10.0.0/libHSbase-4.10.0.0.a(Base.o)(.text.r3zN_info+0x44):
 warning: relocation refers to discarded section
 /usr/home/ben/bin-dist-8.2.1.20170929-FreeBSD/ghc/bindisttest/install
 dir/lib/ghc-8.2.1.20170929/base-4.10.0.0/libHSbase-4.10.0.0.a(Base.o)(.text.r3zP_info+0x44):
 warning: relocation refers to discarded section
 /usr/home/ben/bin-dist-8.2.1.20170929-FreeBSD/ghc/bindisttest/install
 dir/lib/ghc-8.2.1.20170929/base-4.10.0.0/libHSbase-4.10.0.0.a(Base.o)(.text.r3zR_info+0x44):
 warning: relocation refers to discarded section
 ...
 }}}

 == `clang`, `ld.gold`, `SplitSections=NO`

 {{{
 ...
 }}}

 == `gcc`, `ld.gold`, `SplitSections=NO`

 {{{
 /usr/local/bin/ld.gold: fatal error: cannot mix -r with dynamic object
 /usr/lib/libthr.so
 collect2: error: ld returned 1 exit status
 `gcc' failed in phase `Linker'. (Exit code: 1)
 gmake[1]: *** [iserv/ghc.mk:93: iserv/stage2_p/build/GHCi/Utils.p_o] Error
 1
 }}}

--

Comment:

 Indeed `gcc5` and `ld.gold` with `SplitSections=NO` appears to work. I
 didn't try `SplitSections=YES`.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14300#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list