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

#14064: Compiling problem on FreeBSD 11 ("failed in phase") -------------------------------------+------------------------------------- Reporter: ohho | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 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: -------------------------------------+------------------------------------- The scenario showed as below: {{{ # This is a FreeBSD Jail for testing $ freebsd-version 11.1-RELEASE $ pkg info # (related packages only) binutils-2.28,1 GNU binary tools gcc-ecj-4.5 Eclipse Java Compiler used to build GCC Java gcc5-5.4.0_2 GNU Compiler Collection 5 gmake-4.2.1_1 GNU version of 'make' utility gmp-6.1.2 Free library for arbitrary precision arithmetic libiconv-1.14_10 Character set conversion library libunistring-0.9.7 Unicode string library mpc-1.0.3 Library of complex numbers with arbitrarily high precision mpfr-3.1.5_1 Library for multiple-precision floating- point computations perl5-5.24.1_1 Practical Extraction and Report Language $ ls -l /usr/local/lib/lib{iconv,charset,gmp}.* -rw-r--r-- 1 root wheel 6864 Jul 13 09:10 /usr/local/lib/libcharset.a lrwxr-xr-x 1 root wheel 19 Jul 13 09:10 /usr/local/lib/libcharset.so -> libcharset.so.1.0.0 lrwxr-xr-x 1 root wheel 19 Jul 13 09:10 /usr/local/lib/libcharset.so.1 -> libcharset.so.1.0.0 -rw-r--r-- 1 root wheel 10733 Jul 13 09:10 /usr/local/lib/libcharset.so.1.0.0 -rw-r--r-- 1 root wheel 1252196 Jul 13 09:23 /usr/local/lib/libgmp.a lrwxr-xr-x 1 root wheel 16 Jul 13 09:23 /usr/local/lib/libgmp.so -> libgmp.so.10.3.2 lrwxr-xr-x 1 root wheel 16 Jul 13 09:23 /usr/local/lib/libgmp.so.10 -> libgmp.so.10.3.2 -rwxr-xr-x 1 root wheel 531728 Jul 13 09:23 /usr/local/lib/libgmp.so.10.3.2 -rw-r--r-- 1 root wheel 1110392 Jul 13 09:10 /usr/local/lib/libiconv.a lrwxr-xr-x 1 root wheel 17 Jul 13 09:10 /usr/local/lib/libiconv.so -> libiconv.so.2.5.1 lrwxr-xr-x 1 root wheel 17 Jul 13 09:10 /usr/local/lib/libiconv.so.2 -> libiconv.so.2.5.1 -rw-r--r-- 1 root wheel 1076449 Jul 13 09:10 /usr/local/lib/libiconv.so.2.5.1 # installed using # env CC=/usr/local/bin/gcc5 LDFLAGS='-Wl,-rpath=/usr/local/lib/gcc5' ./configure --prefix=/home/ghc $ /home/ghc/bin/ghc --numeric-version 8.2.1 $ cat /home/ghc/lib/ghc-8.2.1/settings [("GCC extra via C opts", " -fwrapv -fno-builtin"), ("C compiler command", "/usr/local/bin/gcc5"), ("C compiler flags", " -fno-stack-protector"), ("C compiler link flags", " -fuse-ld=gold"), ("C compiler supports -no-pie", "NO"), ("Haskell CPP command","/usr/local/bin/gcc5"), ("Haskell CPP flags","-E -undef -traditional"), ("ld command", "ld.gold"), ("ld flags", ""), ("ld supports compact unwind", "YES"), ("ld supports build-id", "YES"), ("ld supports filelist", "NO"), ("ld is GNU ld", "YES"), ("ar command", "/usr/local/bin/ar"), ("ar flags", "q"), ("ar supports at file", "YES"), ("touch command", "touch"), ("dllwrap command", "/bin/false"), ("windres command", "/bin/false"), ("libtool command", "libtool"), ("perl command", "/usr/local/bin/perl"), ("cross compiling", "NO"), ("target os", "OSFreeBSD"), ("target arch", "ArchX86_64"), ("target word size", "8"), ("target has GNU nonexec stack", "True"), ("target has .ident directive", "True"), ("target has subsections via symbols", "False"), ("target has RTS linker", "@HaskellHaveRTSLinker@"), ("Unregisterised", "NO"), ("LLVM llc command", "llc"), ("LLVM opt command", "opt") ] $ /home/ghc/bin/ghci GHCi, version 8.2.1: http://www.haskell.org/ghc/ :? for help Prelude> (!!6) $ scanl (*) 1 [1..] 720 $ cat Main.hs module Main (main) where main :: IO () main = putStrLn "hello world" $ /home/ghc/bin/ghc -O0 --make Main.hs [1 of 1] Compiling Main ( Main.hs, Main.o ) Linking Main ... In file included from /home/ghc/lib/ghc-8.2.1/include/rts/Threads.h:19:0: error: 0, from /home/ghc/lib/ghc-8.2.1/include/Rts.h:173, from /tmp/ghc28144_0/ghc_4.c:1: /usr/local/lib/gcc5/gcc/x86_64-portbld-freebsd11.0/5.4.0/include- fixed/sys/types.h:266:9: error: error: unknown type name '__vm_ooffset_t' typedef __vm_ooffset_t vm_ooffset_t; ^ | 266 | typedef __vm_ooffset_t vm_ooffset_t; | ^ /usr/local/lib/gcc5/gcc/x86_64-portbld-freebsd11.0/5.4.0/include- fixed/sys/types.h:268:9: error: error: unknown type name '__vm_pindex_t' typedef __vm_pindex_t vm_pindex_t; ^ | 268 | typedef __vm_pindex_t vm_pindex_t; | ^ `gcc5' failed in phase `C Compiler'. (Exit code: 1) }}} On my FreeBSD 10.3 box: {{{ $ freebsd-version 10.3-STABLE $ pkg info binutils-2.28,1 GNU binary tools gcc-5.4.0_2 Meta-port for the default version of the GNU Compiler Collection gcc-ecj-4.5 Eclipse Java Compiler used to build GCC Java gcc5-5.4.0_3 GNU Compiler Collection 5 gmake-4.2.1_1 GNU version of 'make' utility gmp-6.1.2 Free library for arbitrary precision arithmetic libffi-3.2.1 Foreign Function Interface libiconv-1.14_10 Character set conversion library perl5-5.24.1_1 Practical Extraction and Report Language $ cat ./ghc-8.2.1-bin/lib/ghc-8.2.1/settings [("GCC extra via C opts", " -fwrapv -fno-builtin"), ("C compiler command", "gcc"), ("C compiler flags", " -fno-stack-protector"), ("C compiler link flags", " -fuse-ld=gold"), ("C compiler supports -no-pie", "NO"), ("Haskell CPP command","gcc"), ("Haskell CPP flags","-E -undef -traditional"), ("ld command", "ld.gold"), ("ld flags", ""), ("ld supports compact unwind", "YES"), ("ld supports build-id", "YES"), ("ld supports filelist", "NO"), ("ld is GNU ld", "YES"), ("ar command", "/usr/bin/ar"), ("ar flags", "clqs"), ("ar supports at file", "NO"), ("touch command", "touch"), ("dllwrap command", "/bin/false"), ("windres command", "/bin/false"), ("libtool command", "libtool"), ("perl command", "/usr/local/bin/perl"), ("cross compiling", "NO"), ("target os", "OSFreeBSD"), ("target arch", "ArchX86_64"), ("target word size", "8"), ("target has GNU nonexec stack", "True"), ("target has .ident directive", "True"), ("target has subsections via symbols", "False"), ("target has RTS linker", "@HaskellHaveRTSLinker@"), ("Unregisterised", "NO"), ("LLVM llc command", "llc"), ("LLVM opt command", "opt") ] $ ./ghc-8.2.1-bin/bin/ghc -O0 --make Main.hs [1 of 1] Compiling Main ( Main.hs, Main.o ) Linking Main ... $ ./Main hello, world! }}} I also noticed that using FreeBSD's strip (from elftoolchain), the {{{ Installing library in /home/ghc/lib/ghc-8.2.1/ghc-prim-0.5.1.0 "utils/ghc-cabal/dist-install/build/tmp/ghc-cabal-bindist" copy libraries /integer-gmp dist-install "strip" '' '/home/ghc' '/home/ghc/lib/ghc-8.2.1' '/home/ghc/share/doc/ghc- 8.2.1/html/libraries' 'v p dyn' }}} phase will be a bit longer than GNU's strip. (Tested by put my $LOCALBASE/bin ahead in $PATH). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14064 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => infoneeded Comment: I believe this is actually a [[https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221111|FreeBSD issue]]. Can you confirm that the fix proposed on that ticket resolves the issue? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14064#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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): Replying to [comment:1 bgamari]:
I believe this is actually a [[https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221111|FreeBSD issue]]. Can you confirm that the fix proposed on that ticket resolves the issue?
Yes, it was due to the package was built unpatched.\\ I reinstalled gcc5 from the ports collection, it did solve the problem. However, the [https://www.reddit.com/r/haskell/comments/6oz5q3/announce_ghc_821_available/... ld.gold error] I posted on reddit remained the same. Check this out: {{{ $ /home/ghc/bin/ghc -O0 --make Main.hs [1 of 1] Compiling Main ( Main.hs, Main.o ) Linking Main ... /usr/local/bin/ld.gold: error: cannot find -liconv /usr/local/bin/ld.gold: error: cannot find -lcharset /usr/local/bin/ld.gold: error: cannot find -lgmp /home/ghc/lib/ghc-8.2.1/base-4.10.0.0/libHSbase-4.10.0.0.a(PrelIOUtils.o):function localeEncoding: error: undefined reference to 'locale_charset' /home/ghc/lib/ghc-8.2.1/base-4.10.0.0/libHSbase-4.10.0.0.a(iconv.o):function hs_iconv_open: error: undefined reference to 'libiconv_open' /home/ghc/lib/ghc-8.2.1/base-4.10.0.0/libHSbase-4.10.0.0.a(iconv.o):function hs_iconv: error: undefined reference to 'libiconv' /home/ghc/lib/ghc-8.2.1/base-4.10.0.0/libHSbase-4.10.0.0.a(iconv.o):function hs_iconv_close: error: undefined reference to 'libiconv_close' collect2: error: ld returned 1 exit status `gcc5' failed in phase `Linker'. (Exit code: 1) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14064#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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

#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 bgamari): Hmm, this is quite odd; I have no such problem while compiling `lens` with `-fuse-ld=gold` on FreeBSD 11.0 (amd64) (although with gcc 4.8.5), {{{ $ freebsd-version 11.0-RELEASE-p1 $ pkg info gcc-4.8.5_2 GNU Compiler Collection 4.8 libiconv-1.14_9 Character set conversion library gmp-5.1.3_3 Free library for arbitrary precision arithmetic binutils-2.27_4,1 GNU binary tools ... $ ghc -V The Glorious Glasgow Haskell Compilation System, version 8.2.1 $ ghc --info [("Project name","The Glorious Glasgow Haskell Compilation System") ,("GCC extra via C opts"," -fwrapv -fno-builtin") ,("C compiler command","gcc") ,("C compiler flags"," -std=gnu99 -fno-stack-protector") ,("C compiler link flags"," -fuse-ld=gold") ,("C compiler supports -no-pie","NO") ... }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14064#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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): Replying to [comment:4 bgamari]:
Hmm, this is quite odd; I have no such problem while compiling `lens` with `-fuse-ld=gold` on FreeBSD 11.0 (amd64) (although with gcc 4.8.5)
This is probably because gcc48 didn't invoke ld.gold as the linker. {{{ 5225 ghc GIO fd 16 read 866 bytes "COLLECT_GCC=/usr/local/bin/gcc48 COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc48/gcc/x86_64-portbld- freebsd11.1/4.8.5/lto-wrapper Target: x86_64-portbld-freebsd11.1 Configured with: /var/ports/basejail/usr/ports/lang/gcc48/work/gcc-4.8.5/configure --with- build-config=bootstrap-debug -\ -disable-nls --enable-gnu-indirect-function --libdir=/usr/local/lib/gcc48 --libexecdir=/usr/local/libexec/gcc48 --progra\ m-suffix=48 --with-as=/usr/local/bin/as --with-gmp=/usr/local --with-gxx-include-dir=/usr/local/lib/gcc48/include/c++/ -\ -with-ld=/usr/local/bin/ld --with-pkgversion='FreeBSD Ports Collection' --with-system-zlib --disable-libgcj --enable-lan\ guages=c,c++,objc,fortran --prefix=/usr/local --localstatedir=/var --mandir=/usr/local/man --infodir=/usr/local/info/gcc\ 48 --build=x86_64-portbld-freebsd11.1 Thread model: posix gcc version 4.8.5 (FreeBSD Ports Collection) " }}} Notice that line `--with-ld=...` above, if you installed gcc48 from ports, \\ then it's configured with `--with-ld=/usr/local/bin/ld`. Also, {{{ 5225 ghc RET kevent 1 5225 ghc CALL read(0x10,0x80d541010,0x2000) 5225 ghc GIO fd 16 read 608 bytes "collect2 version 4.8.5 /usr/local/bin/ld --eh-frame-hdr -dynamic-linker /libexec/ld- elf.so.1 /usr/lib/crt1.o /usr/lib/crti.o /usr/local/lib/gcc\ 48/gcc/x86_64-portbld-freebsd11.1/4.8.5/crtbegin.o -L/usr/local/lib/gcc48/gcc/x86_64-portbld-freebsd11.1/4.8.5 -L/usr/lo\ cal/lib/gcc48/gcc/x86_64-portbld- freebsd11.1/4.8.5/../../../../../x86_64-portbld-freebsd11.1/lib -L/usr/local/lib/gcc48/\ gcc/x86_64-portbld-freebsd11.1/4.8.5/../../.. --version -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -\ lgcc_s --no-as-needed /usr/local/lib/gcc48/gcc/x86_64-portbld- freebsd11.1/4.8.5/crtend.o /usr/lib/crtn.o " }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14064#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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 rebuilt GHC 8.2.1 from source, it worked.\\ So I guess there might be some problem in the released binary package. Since it's an unofficial build, I am not sure if I could use it in production, especial after seeing some test failures. (I am fairly new to GHC building & testing) {{{ Unexpected results from: TEST="T3807 T5975a outofmem T9203 T11627b scc001 conc038 MultiLayerModules scc003 T5205 T2615 haddock.Cabal haddock.base fdReadBuf001 T1969 T5631 ffi014 T4850 linkwhole T13035 cgrun057 T5975b T12227 T10296a determ021 ffishutdown parsing001" SUMMARY for test run started at Tue Aug 1 18:52:08 2017 CST 0:12:51 spent to go through 5890 total tests, which gave rise to 26738 test cases, of which 20498 were skipped 70 had missing libraries 6063 expected passes 78 expected failures 3 caused framework failures 0 caused framework warnings 0 unexpected passes 17 unexpected failures 10 unexpected stat failures Unexpected failures: codeGen/should_run/cgrun057.run cgrun057 [bad stderr] (profasm) concurrent/should_run/conc038.run conc038 [exit code non-0] (threaded1) determinism/determ021/determ021.run determ021 [bad stdout] (normal) driver/linkwhole/linkwhole.run linkwhole [bad exit code] (normal) dynlibs/T3807.run T3807 [bad exit code] (normal) ffi/should_run/ffi014.run ffi014 [exit code non-0] (threaded1) profiling/should_run/scc001.run scc001 [bad profile] (profasm) profiling/should_run/scc003.run scc003 [bad profile] (profasm) profiling/should_run/scc003.run scc003 [bad profile] (prof) profiling/should_run/T11627b.run T11627b [bad heap profile] (profasm) profiling/should_run/T11627b.run T11627b [bad heap profile] (prof_hd) rts/T2615.run T2615 [bad stdout] (normal) rts/T4850.run T4850 [bad exit code] (normal) rts/ffishutdown.run ffishutdown [exit code non-0] (threaded1) rts/T10296a.run T10296a [bad exit code] (normal) rts/outofmem.run outofmem [bad exit code] (normal) ../../libraries/unix/tests/fdReadBuf001.run fdReadBuf001 [bad exit code] (ghci) Unexpected stat failures: perf/compiler/parsing001.run parsing001 [stat too good] (normal) perf/compiler/T1969.run T1969 [stat too good] (normal) perf/compiler/T5631.run T5631 [stat too good] (normal) perf/compiler/T12227.run T12227 [stat too good] (normal) perf/compiler/T13035.run T13035 [stat too good] (normal) perf/compiler/MultiLayerModules.run MultiLayerModules [stat too good] (normal) perf/haddock/haddock.base.run haddock.base [stat too good] (normal) perf/haddock/haddock.Cabal.run haddock.Cabal [stat too good] (normal) perf/should_run/T5205.run T5205 [stat too good] (normal) perf/should_run/T9203.run T9203 [stat too good] (normal) Framework failures: ghci/scripts/T5975a.run T5975a [ghci] ('ascii' codec can't encode characters in position 41-42: ordinal not in range(128)) ghci/scripts/T5975b.run T5975b [ghci] ('ascii' codec can't encode characters in position 41-42: ordinal not in range(128)) perf/compiler/MultiLayerModules.run MultiLayerModules [normal] (pre_cmd failed: 127) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14064#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

Notice that line `--with-ld=...` above, if you installed gcc48 from
Since it's an unofficial build, I am not sure if I could use it in
#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 bgamari): ports, then it's configured with `--with-ld=/usr/local/bin/ld`. Sure, but my understanding is that `-fuse-ld=gold` (which I have confirmed does get passed to `gcc`) should override this default. production, especial after seeing some test failures. (I am fairly new to GHC building & testing) For better or worse this looks relatively "normal" for a FreeBSD build, * The "stat too good" errors can be safely ignored. These are merely due to how we track performance metrics (which is currently being reworked; see #12758) * The profile errors (`cgrun057`, `ssc001`, `ssc003`, `T11627b`) are a known issue which I've been meaning to look into. * The two `'ascii' code can't encode character` issues are because you have `LANG` set to a non-UTF-8 locale (which is really a GHC dbug; I've opened #14073 to track this). * IIRC the `outofmem` error is due to `--disable-large-address-space` * The `ffishutdown` issue is a bit surprising; I can't reproduce that one * `fdReadBuf001` seems to fail non-deterministically, which is a bit concerning; I'll need to look into this. Tracked as #14074 * I can't reproduce the `conc038` failure * `T3807` depends upon `libdl` which doesn't exist on FreeBSD; this is a bug in the test. * `determ021` seems to be merely a library version mismatch * There appears to be some linkage issues on FreeBSD that we need to look into; namely `linkwhole` and `T2615` -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14064#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

Notice that line `--with-ld=...` above, if you installed gcc48 from
#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): Replying to [comment:7 bgamari]: ports, then it's configured with `--with-ld=/usr/local/bin/ld`.
Sure, but my understanding is that `-fuse-ld=gold` (which I have
confirmed does get passed to `gcc`) should override this default.
Since it's an unofficial build, I am not sure if I could use it in
Yes, that's what I thought, too.\\ My experience was, `ld` was called instead of `ld.gold`. I'll make further sure of that later.\\ Could you please also confirm that `ld.gold` do get called? production, especial after seeing some test failures. (I am fairly new to GHC building & testing)
For better or worse this looks relatively "normal" for a FreeBSD build,
''... ...''
Thank you very much for the detailed reply to the test results. Again, I'll tweak, build & test later, and keep an eye on those tickets. If there's anything I can help, please count me in. :-) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14064#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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 bgamari):
Yes, that's what I thought, too. My experience was, ld was called instead of ld.gold. I'll make further sure of that later. Could you please also confirm that ld.gold do get called?
Wow, indeed you are right. The `-fuse-ld=gold` seems to be ignored entirely (determined by passing `-optl-v` to `ghc`.). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14064#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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): Replying to [comment:7 bgamari]:
* I can't reproduce the `conc038` failure
I rebuilt GHC 8.2.1 today with ld override disabled, tested again and it's gone.\\ So I guess this is also caused by the linker problem. Without `--disable-ld-override`, I actually got the following error during the compiling phase: {{{ HC [stage 1] compiler/stage2/build/SysTools/Terminal.p_o HC [stage 1] iserv/stage2_p/build/GHCi/Utils.p_o HC [stage 1] libraries/time/dist-install/build/Data/Time/Format/Locale.o HC [stage 1] libraries/time/dist- install/build/Data/Time/LocalTime/Internal/TimeOfDay.o /usr/local/bin/ld.gold: fatal error: cannot mix -r with dynamic object /usr/lib/libthr.so collect2: error: ld returned 1 exit status `gcc5' failed in phase `Linker'. (Exit code: 1) gmake[1]: *** [iserv/ghc.mk:93: iserv/stage2_p/build/GHCi/Utils.p_o] Error 1 gmake[1]: *** Waiting for unfinished jobs.... gmake: *** [Makefile:127: all] Error 2 }}} Also, in rts/dist/build, `ffi.h` and `ffitarget.h` were reported missing during `make binary-dist`.\\ I'm not sure if these headers are needed, the ones in /usr/local/include (installed by libffi) are identical to what were packed in the official tarball.\\ (Did I miss some steps in the building process?) I've tried 3 different ways to bootstrap the build: * GHC 7.10.2 from ports * GHC 8.0.2 official binary distribution * GHC 8.2.1 itself It seemed that using 8.0.2 I could get the best test result. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14064#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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 mboes): On FreeBSD 10.1-RELEASE-p1, I get a bunch of e.g. {{{ ... ld.lld: error: Section has flags incompatible with others with the same name libraries/ghc-prim/dist-install/build/GHC/CString.o:(.text.sFl_info) ... }}} errors and the build fails. Passing `--disable-ld-override` fixes this. It should probably be added automatically on this platform through auto configuration (hard for users to guess upfront what combination of `./configure` flags will make the build succeed). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14064#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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 bgamari): Note that this issue is addressed in #14300; the rationale for this issue is also discussed in ticket:14300#comment:5. In short, the issue is that the platform toolchain is buggy due to tiresome licensing issue. Note that GHC builds without any trouble on FreeBSD 11. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14064#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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 arrowd): As of now, GHC port (8.4.3) builds fine on 10.3 too using GCC toolchain. This may be closed, probably. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14064#comment:13 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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: | -------------------------------------+------------------------------------- Changes (by arrowd): * cc: arrowd@… (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14064#comment:14 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC