[GHC] #8361: hsc2hs error: sizeof/offsetof during solaris2 target compile

#8361: hsc2hs error: sizeof/offsetof during solaris2 target compile ----------------------------------+---------------------------------------- Reporter: leroux | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: None | Version: 7.6.3 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Building GHC failed Unknown/Multiple | Test Case: Difficulty: Unknown | Blocking: Blocked By: | Related Tickets: | ----------------------------------+---------------------------------------- I'm trying to cross-(compile/build?) ghc for SmartOS (target) from Mac OS X (host). I used https://gist.github.com/leroux/6680744#file- setup_cross_gcc_linux_illumos-sh to build the gcc cross-compiler (where target is solaris and host is os x) and https://gist.github.com/leroux/6710457 to kickoff the ghc build process. Details {{{ ("Build platform","x86_64-apple-darwin") ("Host platform","x86_64-apple-darwin") ("Target platform","x86_64-sun-solaris2") }}} ---- The error {{{ "inplace/bin/hsc2hs" '--cc=/Users/leroux/Documents/gcc/cross/x86_64-sun- solaris2.11/bin/x86_64-sun-solaris2.11-gcc' '-- ld=/Users/leroux/Documents/gcc/cross/x86_64-sun-solaris2.11/bin/x86_64 -sun-solaris2.11-gcc' --cross-safe --cflag=-fno-stack-protector --cross-compile --cflag=-Dx86_64_HOST_ARCH=1 --cflag=-Dsolaris2_HOST_OS=1 --cflag=-D__GLASGOW_HASKELL__=707 '--cflag=-fno-stack-protector' '-- cflag=-Ilibraries/haskeline/includes' '--cflag=-DUSE_GHC_ENCODINGS' '-- cflag=-DTERMINFO' '--cflag=-I/Users/leroux/ghc/ghc- solaris/ghc/libraries/directory/include' '--cflag=-I/Users/leroux/ghc/ghc- solaris/ghc/libraries/unix/include' '--cflag=-I/Users/leroux/ghc/ghc- solaris/ghc/libraries/time/include' '--cflag=-I/Users/leroux/ghc/ghc- solaris/ghc/libraries/containers/include' '--cflag=-I/Users/leroux/ghc /ghc-solaris/ghc/libraries/bytestring/include' '-- cflag=-I/Users/leroux/ghc/ghc-solaris/ghc/libraries/base/include' '-- cflag=-I/Users/leroux/ghc/ghc-solaris/ghc/rts/dist/build' '-- cflag=-I/Users/leroux/ghc/ghc-solaris/ghc/includes' '-- cflag=-I/Users/leroux/ghc/ghc-solaris/ghc/includes/dist- derivedconstants/header' '--lflag=-L/Users/leroux/ghc/ghc- solaris/ghc/libraries/transformers/dist-install/build' '-- lflag=-L/Users/leroux/ghc/ghc-solaris/ghc/libraries/terminfo/dist- install/build' '--lflag=-L/Users/leroux/ghc/ghc- solaris/ghc/libraries/directory/dist-install/build' '-- lflag=-L/Users/leroux/ghc/ghc-solaris/ghc/libraries/unix/dist- install/build' '--lflag=-L/Users/leroux/ghc/ghc-solaris/ghc/libraries/time /dist-install/build' '--lflag=-L/Users/leroux/ghc/ghc- solaris/ghc/libraries/old-locale/dist-install/build' '-- lflag=-L/Users/leroux/ghc/ghc-solaris/ghc/libraries/filepath/dist- install/build' '--lflag=-L/Users/leroux/ghc/ghc- solaris/ghc/libraries/containers/dist-install/build' '-- lflag=-L/Users/leroux/ghc/ghc-solaris/ghc/libraries/bytestring/dist- install/build' '--lflag=-L/Users/leroux/ghc/ghc- solaris/ghc/libraries/deepseq/dist-install/build' '-- lflag=-L/Users/leroux/ghc/ghc-solaris/ghc/libraries/array/dist- install/build' '--lflag=-L/Users/leroux/ghc/ghc-solaris/ghc/libraries/base /dist-install/build' '--lflag=-L/Users/leroux/ghc/ghc- solaris/ghc/libraries/integer-simple/dist-install/build' '-- lflag=-L/Users/leroux/ghc/ghc-solaris/ghc/libraries/ghc-prim/dist- install/build' '--lflag=-L/Users/leroux/ghc/ghc- solaris/ghc/rts/dist/build' '--lflag=-lcurses' '--lflag=-lrt' '-- lflag=-ldl' '--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 ‘_hsc2hs_test15’: Posix.hsc:75:39: error: invalid application of ‘sizeof’ to incomplete type ‘struct winsize’ Posix.hsc: In function ‘_hsc2hs_test17’: Posix.hsc:77:32: error: ‘TIOCGWINSZ’ undeclared (first use in this function) Posix.hsc:77:32: note: each undeclared identifier is reported only once for each function it appears in In file included from /Users/leroux/ghc/ghc-solaris/ghc/inplace/lib /template-hsc.h:4:0, from libraries/haskeline/dist- install/build/System/Console/Haskeline/Backend/Posix_hsc_test0.c:1: Posix.hsc: In function ‘_hsc2hs_test19’: Posix.hsc:78:48: error: invalid use of undefined type ‘struct winsize’ Posix.hsc: In function ‘_hsc2hs_test21’: Posix.hsc:79:48: error: invalid use of undefined type ‘struct winsize’ compilation failed make[1]: *** [libraries/haskeline/dist- install/build/System/Console/Haskeline/Backend/Posix.hs] Error 1 make: *** [all] Error 2 }}} ---- I attempted to remedy this issue by replacing all occurrences of `offsetof` with `__builtin_offsetof` which was suggested by http://web.archiveorange.com/archive/v/j7U5dymASw992FJprhK7, but it didn't have any apparent affects. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8361 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8361: hsc2hs error: sizeof/offsetof during solaris2 target compile ----------------------------------------+---------------------------------- Reporter: leroux | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: None | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Building GHC failed | Unknown/Multiple Test Case: | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: ----------------------------------------+---------------------------------- Changes (by leroux): * cc: leroux@… (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8361#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8361: hsc2hs error: sizeof/offsetof during solaris2 target compile ----------------------------------------+---------------------------------- Reporter: leroux | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: None | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Building GHC failed | Unknown/Multiple Test Case: | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: ----------------------------------------+---------------------------------- Changes (by oddsignals): * cc: kjetil@… (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8361#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8361: hsc2hs error: sizeof/offsetof during solaris2 target compile ----------------------------------------+---------------------------------- Reporter: leroux | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: None | Version: 7.6.3 Resolution: duplicate | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Building GHC failed | Unknown/Multiple Test Case: | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: ----------------------------------------+---------------------------------- Changes (by leroux): * status: new => closed * resolution: => duplicate Comment: #8366 has resolves this. Closing as dupe. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8361#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC