[GHC] #13542: Solaris build fails with collect2: execv: Arg list too long

#13542: Solaris build fails with collect2: execv: Arg list too long -------------------------------------+------------------------------------- Reporter: kgardas | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.1 Keywords: | Operating System: Solaris Architecture: | Type of failure: Building GHC Unknown/Multiple | failed Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- It looks like HEAD build is broken on Solaris and Solaris-derived OSes. It fails with: {{{ gmake --no-print-directory -f ghc.mk phase=final all "inplace/bin/ghc-stage1" -hisuf hi -osuf o -hcsuf hc -static -H32m -O -Wall -this-unit-id ghc-prim-0.5.0.0 -hide-all-packages -i -ilibraries/ghc-prim/. -ilibraries/ghc-prim/dist-install/build -Ilibraries /ghc-prim/dist-install/build -ilibraries/ghc-prim/dist- install/build/./autogen -Ilibraries/ghc-prim/dist-install/build/./autogen -Ilibraries/ghc-prim/. -optP-include -optPlibraries/ghc-prim/dist- install/build/./autogen/cabal_macros.h -package-id rts -this-unit-id ghc- prim -XHaskell2010 -O2 -no-user-package-db -rtsopts -Wno-trustworthy-safe -Wno-deprecated-flags -Wnoncanonical-monad-instances -odir libraries /ghc-prim/dist-install/build -hidir libraries/ghc-prim/dist-install/build -stubdir libraries/ghc-prim/dist-install/build -split-objs -dynamic-too -c libraries/ghc-prim/./GHC/Types.hs -o libraries/ghc-prim/dist- install/build/GHC/Types.o -dyno libraries/ghc-prim/dist- install/build/GHC/Types.dyn_o gcc: error trying to exec '/usr/gcc/4.8/lib/gcc/i386-pc- solaris2.11/4.8.2/collect2': execv: Arg list too long `gcc' failed in phase `Linker'. (Exit code: 1) gmake[1]: *** [libraries/ghc-prim/dist-install/build/GHC/Types.o] Error 1 gmake: *** [all] Error 2 }}} on Solaris 11.2 and with: {{{ "inplace/bin/ghc-stage1" -hisuf hi -osuf o -hcsuf hc -static -H32m -O -Wall -this-unit-id ghc-prim-0.5.0.0 -hide-all-packages -i -ilibraries/ghc-prim/. -ilibraries/ghc-prim/dist-install/build -Ilibraries /ghc-prim/dist-install/build -ilibraries/ghc-prim/dist- install/build/./autogen -Ilibraries/ghc-prim/dist-install/build/./autogen -Ilibraries/ghc-prim/. -optP-include -optPlibraries/ghc-prim/dist- install/build/./autogen/cabal_macros.h -package-id rts -this-unit-id ghc- prim -XHaskell2010 -O2 -no-user-package-db -rtsopts -Wno-trustworthy-safe -Wno-deprecated-flags -Wnoncanonical-monad-instances -odir libraries /ghc-prim/dist-install/build -hidir libraries/ghc-prim/dist-install/build -stubdir libraries/ghc-prim/dist-install/build -split-objs -dynamic-too -c libraries/ghc-prim/./GHC/Types.hs -o libraries/ghc-prim/dist- install/build/GHC/Types.o -dyno libraries/ghc-prim/dist- install/build/GHC/Types.dyn_o gcc: error trying to exec '/opt/local/gcc47/libexec/gcc/i486-sun- solaris2.11/4.7.4/collect2': execv: Arg list too long `gcc' failed in phase `Linker'. (Exit code: 1) libraries/ghc-prim/ghc.mk:4: recipe for target 'libraries/ghc-prim/dist- install/build/GHC/Types.o' failed gmake[1]: *** [libraries/ghc-prim/dist-install/build/GHC/Types.o] Error 1 Makefile:122: recipe for target 'all' failed gmake: *** [all] Error 2 }}} on SmartOS. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13542 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13542: Solaris build fails with collect2: execv: Arg list too long -------------------------------------+------------------------------------- Reporter: kgardas | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.1 Resolution: | Keywords: Operating System: Solaris | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by kgardas): This issue first appear on Feb 19 2017 build on SmartOS builder: http://haskell.inf.elte.hu/builders/smartos-x86_64-head/index.html -- the last working build was from Feb 18 2017. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13542#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13542: Solaris build fails with collect2: execv: Arg list too long -------------------------------------+------------------------------------- Reporter: kgardas | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.1 Resolution: | Keywords: Operating System: Solaris | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by rwbarton): The builder shows that 89168849a781626fc794ae97375da979ac83bf96 succeeded but 98e494afed3c73f88ff1d57a9ca46b1f6ddbd1b9 failed (clicking through to "8: configuring" shows the commit id). The likely culprit in that range is Type-indexed Typeable 8fa4bf9ab3f4ea4b208f4a43cc90857987e6d497 which produces many more top- level bindings, which in conjunction with `-split-objs` means many more object files to be passed to the linker. I guess it hit a limit in Solaris. I wonder whether we can simply use `-split-sections` on Solaris? It's generally preferable to `-split-objs` and won't produce long command lines. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13542#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13542: Solaris build fails with collect2: execv: Arg list too long -------------------------------------+------------------------------------- Reporter: kgardas | Owner: (none) Type: bug | Status: infoneeded Priority: normal | Milestone: Component: Compiler | Version: 8.1 Resolution: | Keywords: Operating System: Solaris | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => infoneeded Comment: I suspect we can use `split-sections`; I tried bringing up a SmartOS VM to test this but unfortunately it fought back (the USB image is inexplicably unbootable). Someone else with access to this operating system will need to look into this. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13542#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13542: Solaris build fails with collect2: execv: Arg list too long -------------------------------------+------------------------------------- Reporter: kgardas | Owner: (none) Type: bug | Status: infoneeded Priority: normal | Milestone: Component: Compiler | Version: 8.1 Resolution: | Keywords: Operating System: Solaris | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by kgardas): Just going thorough search of split-sections and SplitSection in the tree and general feeling about it is that the feature is supported only when GNU linker is used. This is unfortunately not the case on Solaris as Solaris gcc is using Solaris own linker: {{{ $ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/gcc/4.8/lib/gcc/i386-pc-solaris2.11/4.8.2/lto- wrapper Target: i386-pc-solaris2.11 Configured with: /builds/hudson/workspace/nightly- update/build/i386/components/gcc48/gcc-4.8.2/configure CC=/usr/gcc/4.7/bin/gcc CXX=/usr/gcc/4.7/bin/g++ --prefix=/usr/gcc/4.8 --mandir=/usr/gcc/4.8/share/man --bindir=/usr/gcc/4.8/bin --libdir=/usr/gcc/4.8/lib --sbindir=/usr/gcc/4.8/sbin --infodir=/usr/gcc/4.8/share/info --libexecdir=/usr/gcc/4.8/lib --enable- languages=c,c++,fortran,objc --enable-shared --with-gmp- include=/usr/include/gmp --with-mpfr-include=/usr/include/mpfr --without- gnu-ld --with-ld=/usr/bin/ld --with-gnu-as --with-as=/usr/gnu/bin/as CFLAGS='-g -O2 -mtune=opteron -march=opteron' CXXFLAGS='-g -O2 -mtune=opteron -march=opteron' Thread model: posix gcc version 4.8.2 (GCC) }}} anyway, I'll give it a try and report back. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13542#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13542: Solaris build fails with collect2: execv: Arg list too long -------------------------------------+------------------------------------- Reporter: kgardas | Owner: (none) Type: bug | Status: infoneeded Priority: normal | Milestone: Component: Compiler | Version: 8.1 Resolution: | Keywords: Operating System: Solaris | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by kgardas): I've done simple test and where the compilation failed with the error above I've replaced -split-objs with -split-sections and repeated the step and then continue with `gmake`. This way I've been able to build GHC HEAD on Solaris 11.2 but only with patch below applied. I guess nobody test on Solaris so no-flock condition is kind of broken, the error is: {{{ libraries/base/GHC/IO/Handle/Lock.hsc:159:20: error: <80>� Variable not in scope: throwIO :: FileLockingNotSupported -> IO Bool <80>� Perhaps you meant <80><98>throw<80><99> (imported from GHC.Exception) | 159 | lockImpl _ _ _ _ = throwIO FileLockingNotSupported | ^^^^^^^ gmake[1]: *** [libraries/base/dist-install/build/GHC/IO/Handle/Lock.o] Error 1 }}} and my naive patch is: {{{ diff --git a/libraries/base/GHC/IO/Handle/Lock.hsc b/libraries/base/GHC/IO/Handle/Lock.hsc index 5608c18..3ef19f7 100644 --- a/libraries/base/GHC/IO/Handle/Lock.hsc +++ b/libraries/base/GHC/IO/Handle/Lock.hsc @@ -48,6 +48,10 @@ import GHC.Ptr import GHC.Real import GHC.Windows +#else + +import Control.Exception + #endif import Data.Functor }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13542#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC