[GHC] #14064: Compiling problem on FreeBSD 11 ("failed in phase")

GHC ghc-devs at haskell.org
Mon Jul 31 07:46:52 UTC 2017


#14064: Compiling problem on FreeBSD 11 ("failed in phase")
-------------------------------------+-------------------------------------
        Reporter:  ohho              |                Owner:  (none)
            Type:  bug               |               Status:  infoneeded
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.1
      Resolution:                    |             Keywords:
Operating System:  FreeBSD           |         Architecture:  x86_64
 Type of failure:  GHC doesn't work  |  (amd64)
  at all                             |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by ohho):

 I have tried various link options in `settings` file.

 It seemed that, set an empty "C compiler link flags", i.e., remove "`
 -fuse-ld=gold`", it fell back to the plain-old `/usr/local/bin/ld`, then
 the whole thing worked without any problem.

 I don't know which side to blame, GHC or GCC?

 P./S. I ktrace'd both settings to make sure:

 {{{
 # -fuse-ld=gold
  52022 ghc      CALL  read(0x10,0x80d50d010,0x2000)
  52022 ghc      GIO   fd 16 read 880 bytes
        "collect2 version 5.4.0
         /usr/local/bin/ld.gold -plugin /usr/local/libexec/gcc5/gcc/x86_64
 -portbld-freebsd11.1/5.4.0/liblto_plugin.so -plugin-
 opt=/usr/local/libexec/gcc5/gcc/x86_64-portbld\
         -freebsd11.1/5.4.0/lto-wrapper -plugin-
 opt=-fresolution=/tmp//cc5NWh3O.res -plugin-opt=-pass-through=-lgcc
 -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-thro\
         ugh=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-
 through=-lgcc_s --eh-frame-hdr -dynamic-linker /libexec/ld-elf.so.1
 /usr/lib/crt1.o /usr/lib/crti.o /usr/\
         local/lib/gcc5/gcc/x86_64-portbld-freebsd11.1/5.4.0/crtbegin.o
 -L/usr/local/lib/gcc5/gcc/x86_64-portbld-freebsd11.1/5.4.0
 -L/usr/local/lib/gcc5/gcc/x86_64-portbld-\
         freebsd11.1/5.4.0/../../.. --version -lgcc --as-needed -lgcc_s
 --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed
 /usr/local/lib/gcc5/gcc/x86_64-portbld-f\
         reebsd11.1/5.4.0/crtend.o /usr/lib/crtn.o
 ...
  52022 ghc      RET   fstat 0
  52022 ghc      CALL  ftruncate(0xc,0)
  52022 ghc      RET   ftruncate 0
  52022 ghc      CALL  ioctl(0xc,TIOCGETA,0x7fffffffa860)
  52022 ghc      RET   ioctl -1 errno 25 Inappropriate ioctl for device
  52022 ghc      CALL  write(0xc,0x80d507010,0xd06)
  52022 ghc      GIO   fd 12 wrote 3334 bytes
        ""-fno-stack-protector"
         "-DTABLES_NEXT_TO_CODE"
         "-fuse-ld=gold"
         "-Wl,--no-as-needed"
         "-o"
         "Main"
         "-Wl,--gc-sections"
         "Main.o"
         "-L/home/ghc/lib/ghc-8.2.1/base-4.10.0.0"
         "-L/home/ghc/lib/ghc-8.2.1/integer-gmp-1.0.1.0"
         "-L/home/ghc/lib/ghc-8.2.1/ghc-prim-0.5.1.0"
         "-L/home/ghc/lib/ghc-8.2.1/rts"
         "/tmp/ghc52022_0/ghc_5.o"
         "/tmp/ghc52022_0/ghc_8.o"
         "-Wl,-u,base_GHCziInt_I16zh_con_info"
 ...
  52022 ghc      GIO   fd 14 read 276 bytes
        "GNU gold (GNU Binutils 2.28) 1.14
 ...

 # ld
  52060 ghc      RET   kevent 1
  52060 ghc      CALL  read(0x10,0x80d76c010,0x2000)
  52060 ghc      GIO   fd 16 read 875 bytes
        "collect2 version 5.4.0
         /usr/local/bin/ld -plugin /usr/local/libexec/gcc5/gcc/x86_64
 -portbld-freebsd11.1/5.4.0/liblto_plugin.so -plugin-
 opt=/usr/local/libexec/gcc5/gcc/x86_64-portbld-free\
         bsd11.1/5.4.0/lto-wrapper -plugin-
 opt=-fresolution=/tmp//ccIy1yIG.res -plugin-opt=-pass-through=-lgcc
 -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-\
         lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-
 through=-lgcc_s --eh-frame-hdr -dynamic-linker /libexec/ld-elf.so.1
 /usr/lib/crt1.o /usr/lib/crti.o /usr/local\
         /lib/gcc5/gcc/x86_64-portbld-freebsd11.1/5.4.0/crtbegin.o
 -L/usr/local/lib/gcc5/gcc/x86_64-portbld-freebsd11.1/5.4.0
 -L/usr/local/lib/gcc5/gcc/x86_64-portbld-freeb\
         sd11.1/5.4.0/../../.. --version -lgcc --as-needed -lgcc_s --no-as-
 needed -lc -lgcc --as-needed -lgcc_s --no-as-needed
 /usr/local/lib/gcc5/gcc/x86_64-portbld-freebs\
         d11.1/5.4.0/crtend.o /usr/lib/crtn.o
 ...
  52060 ghc      RET   kevent 1
  52060 ghc      CALL  read(0xe,0x80d772010,0x2000)
  52060 ghc      GIO   fd 14 read 269 bytes
        "GNU ld (GNU Binutils) 2.28
 ...
 }}}

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


More information about the ghc-tickets mailing list