Opened 3 months ago

Closed 3 months ago

#8670 closed bug (fixed)

GHC fails to build on Solaris 11

Reported by: kgardas Owned by:
Priority: normal Milestone:
Component: libraries (other) Version: 7.7
Keywords: Cabal Cc:
Operating System: Solaris Architecture: x86
Type of failure: Building GHC failed Difficulty: Easy (less than 1 hour)
Test Case: Blocked By:
Blocking: Related Tickets:

Description

Hello,
GHC HEAD fails to build on Solaris 11, the compilation fails in libraries/haskeline with:

"inplace/bin/hsc2hs" '--cc=/usr/bin/gcc' '--ld=/usr/bin/gcc'  --cross-safe -I/opt/gmp-5.1.3/include/ --cflag=-U__i686 --cflag=-fno-stack-protector   --cflag=-Di386_HOST_ARCH=1 --cflag=-Dsolaris2_HOST_OS=1 --cflag=-D__GLASGOW_HASKELL__=707 '--cflag=-U__i686' '--cflag=-fno-stack-protector' '--cflag=-Ilibraries/haskeline/includes' '--cflag=-DUSE_GHC_ENCODINGS' '--cflag=-DTERMINFO' '--cflag=-I/export/home/karel/vcs/ghc-src/ghc-sol-test/libraries/directory/include' '--cflag=-I/export/home/karel/vcs/ghc-src/ghc-sol-test/libraries/unix/include' '--cflag=-I/export/home/karel/vcs/ghc-src/ghc-sol-test/libraries/time/include' '--cflag=-I/export/home/karel/vcs/ghc-src/ghc-sol-test/libraries/containers/include' '--cflag=-I/export/home/karel/vcs/ghc-src/ghc-sol-test/libraries/bytestring/include' '--cflag=-I/export/home/karel/vcs/ghc-src/ghc-sol-test/libraries/base/include' '--cflag=-I/opt/gmp-5.1.3/include/' '--cflag=-I/export/home/karel/vcs/ghc-src/ghc-sol-test/rts/dist/build' '--cflag=-I/export/home/karel/vcs/ghc-src/ghc-sol-test/includes' '--cflag=-I/export/home/karel/vcs/ghc-src/ghc-sol-test/includes/dist-derivedconstants/header' '--lflag=-L/export/home/karel/vcs/ghc-src/ghc-sol-test/libraries/transformers/dist-install/build' '--lflag=-L/export/home/karel/vcs/ghc-src/ghc-sol-test/libraries/terminfo/dist-install/build' '--lflag=-L/export/home/karel/vcs/ghc-src/ghc-sol-test/libraries/directory/dist-install/build' '--lflag=-L/export/home/karel/vcs/ghc-src/ghc-sol-test/libraries/unix/dist-install/build' '--lflag=-L/export/home/karel/vcs/ghc-src/ghc-sol-test/libraries/time/dist-install/build' '--lflag=-L/export/home/karel/vcs/ghc-src/ghc-sol-test/libraries/old-locale/dist-install/build' '--lflag=-L/export/home/karel/vcs/ghc-src/ghc-sol-test/libraries/filepath/dist-install/build' '--lflag=-L/export/home/karel/vcs/ghc-src/ghc-sol-test/libraries/containers/dist-install/build' '--lflag=-L/export/home/karel/vcs/ghc-src/ghc-sol-test/libraries/bytestring/dist-install/build' '--lflag=-L/export/home/karel/vcs/ghc-src/ghc-sol-test/libraries/deepseq/dist-install/build' '--lflag=-L/export/home/karel/vcs/ghc-src/ghc-sol-test/libraries/array/dist-install/build' '--lflag=-L/export/home/karel/vcs/ghc-src/ghc-sol-test/libraries/base/dist-install/build' '--lflag=-L/export/home/karel/vcs/ghc-src/ghc-sol-test/libraries/integer-gmp/dist-install/build' '--lflag=-L/opt/gmp-5.1.3/lib/' '--lflag=-L/export/home/karel/vcs/ghc-src/ghc-sol-test/libraries/ghc-prim/dist-install/build' '--lflag=-L/export/home/karel/vcs/ghc-src/ghc-sol-test/rts/dist/build' '--lflag=-lcurses' '--lflag=-ldl' '--lflag=-lgmp' '--lflag=-lm' '--lflag=-lrt' '--lflag=-ldl' --cflag=-Ilibraries/haskeline/dist-install/build/autogen --cflag=-include --cflag=libraries/haskeline/dist-install/build/autogen/cabal_macros.h   libraries/haskeline/./System/Console/Haskeline/Backend/Posix.hsc -o libraries/haskeline/dist-install/build/System/Console/Haskeline/Backend/Posix.hs
Posix.hsc: In function ‘main’:
Posix.hsc:74:5: error: invalid application of ‘sizeof’ to incomplete type ‘struct winsize’ 
Posix.hsc:76:5: error: ‘TIOCGWINSZ’ undeclared (first use in this function)
Posix.hsc:76:5: note: each undeclared identifier is reported only once for each function it appears in
Posix.hsc:77:5: error: invalid use of undefined type ‘struct winsize’
Posix.hsc:78:5: error: invalid use of undefined type ‘struct winsize’
compiling libraries/haskeline/dist-install/build/System/Console/Haskeline/Backend/Posix_hsc_make.c failed (exit code 1)
command was: /usr/bin/gcc -c libraries/haskeline/dist-install/build/System/Console/Haskeline/Backend/Posix_hsc_make.c -o libraries/haskeline/dist-install/build/System/Console/Haskeline/Backend/Posix_hsc_make.o -I/opt/gmp-5.1.3/include/ -U__i686 -fno-stack-protector -Di386_HOST_ARCH=1 -Dsolaris2_HOST_OS=1 -D__GLASGOW_HASKELL__=707 -U__i686 -fno-stack-protector -Ilibraries/haskeline/includes -DUSE_GHC_ENCODINGS -DTERMINFO -I/export/home/karel/vcs/ghc-src/ghc-sol-test/libraries/directory/include -I/export/home/karel/vcs/ghc-src/ghc-sol-test/libraries/unix/include -I/export/home/karel/vcs/ghc-src/ghc-sol-test/libraries/time/include -I/export/home/karel/vcs/ghc-src/ghc-sol-test/libraries/containers/include -I/export/home/karel/vcs/ghc-src/ghc-sol-test/libraries/bytestring/include -I/export/home/karel/vcs/ghc-src/ghc-sol-test/libraries/base/include -I/opt/gmp-5.1.3/include/ -I/export/home/karel/vcs/ghc-src/ghc-sol-test/rts/dist/build -I/export/home/karel/vcs/ghc-src/ghc-sol-test/includes -I/export/home/karel/vcs/ghc-src/ghc-sol-test/includes/dist-derivedconstants/header -Ilibraries/haskeline/dist-install/build/autogen -include libraries/haskeline/dist-install/build/autogen/cabal_macros.h -I/export/home/karel/vcs/ghc-src/ghc-sol-test/inplace/lib/include/
gmake[1]: *** [libraries/haskeline/dist-install/build/System/Console/Haskeline/Backend/Posix.hs] Error 1

The reason for this can be tracked to the haskeline.cabal file code:

        if os(solaris) {
            cpp-options: -DUSE_TERMIOS_H
        }

the cpp-options are not modified on Solaris although they should. The reason for this is a bug in Cabal which does not recognize Solaris from its i386-pc-solaris2.11 triple. The bug is reported with suggested patch here: https://github.com/haskell/cabal/issues/1641
The a little extended patch is already in Cabal HEAD and it is promised to be merged into 1.18 branch by Mikhail Glushenkov here: http://www.haskell.org/pipermail/ghc-devs/2014-January/003819.html
Now, the question is if it is possible to get the fix into GHC HEAD before 7.8 RC.

Change History (6)

comment:1 Changed 3 months ago by hvr

Is this the only thing needed for fixing solaris?

comment:2 follow-up: Changed 3 months ago by kgardas

Yes, that's the only show-stopper now, since two other needed patches are already merged into GHC HEAD.

comment:3 Changed 3 months ago by Herbert Valerio Riedel <hvr@…>

In b41821b43925db46c968f1244712c78877204a9b/ghc:

Update to current Cabal 1.18 branch tip

This should contain a fix that addresses the Solaris build breakage
(see #8670)

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>

comment:4 in reply to: ↑ 2 Changed 3 months ago by hvr

Replying to kgardas:

Yes, that's the only show-stopper now, since two other needed patches are already merged into GHC HEAD.

...now that I've updated libraries/Cabal, can you verify it works for you now?

comment:5 Changed 3 months ago by kgardas

Herbert,
thanks for merging Cabal 1.18 branch. I have verified and yes, GHC HEAD builds well on my Solaris 11 using GHC 7.6.3 and other required tools. Thanks for this!

comment:6 Changed 3 months ago by kgardas

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.