[GHC] #10237: compiler/ghci/LibFFI.hsc:42 sizeof(ffi_cif) is not an integer

#10237: compiler/ghci/LibFFI.hsc:42 sizeof(ffi_cif) is not an integer -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.11 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Building GHC Unknown/Multiple | failed Test Case: | Blocked By: Blocking: | Related Tickets: Differential Revisions: | -------------------------------------+------------------------------------- Cross-compiling from linux-amd64 to linux-armhf and I get the above error message. The command (after removing a bunhc of irrelevant command line flags) is: {{{ inplace/bin/hsc2hs --cc=/usr/bin/aarch64-linux-gnu-gcc \ --ld=/usr/bin/aarch64-linux-gnu-gcc \ --cross-safe --cflag=-fno-stack-protector --cross-compile \ --cflag=-Daarch64_HOST_ARCH=1 \ --cflag=-Dlinux_HOST_OS=1 --cflag=-D__GLASGOW_HASKELL__=711 \ --cflag=-Icompiler/../rts/dist/build \ --cflag=-Werror=unused-but-set-variable \ --cflag=-include \ --cflag=compiler/stage2/build/autogen/cabal_macros.h \ compiler/ghci/LibFFI.hsc -o compiler/stage2/build/LibFFI.hs }}} The command `grep 'sizeof(ffi_cif)' compiler/ghci/LibFFI.hsc` finds: {{{#!hs cif <- mallocBytes (#const sizeof(ffi_cif)) }}} Native compile on this system works fine. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10237 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10237: compiler/ghci/LibFFI.hsc:42 sizeof(ffi_cif) is not an integer -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Description changed by erikd: Old description:
Cross-compiling from linux-amd64 to linux-armhf and I get the above error message. The command (after removing a bunhc of irrelevant command line flags) is:
{{{ inplace/bin/hsc2hs --cc=/usr/bin/aarch64-linux-gnu-gcc \ --ld=/usr/bin/aarch64-linux-gnu-gcc \ --cross-safe --cflag=-fno-stack-protector --cross-compile \ --cflag=-Daarch64_HOST_ARCH=1 \ --cflag=-Dlinux_HOST_OS=1 --cflag=-D__GLASGOW_HASKELL__=711 \ --cflag=-Icompiler/../rts/dist/build \ --cflag=-Werror=unused-but-set-variable \ --cflag=-include \ --cflag=compiler/stage2/build/autogen/cabal_macros.h \ compiler/ghci/LibFFI.hsc -o compiler/stage2/build/LibFFI.hs }}}
The command `grep 'sizeof(ffi_cif)' compiler/ghci/LibFFI.hsc` finds:
{{{#!hs cif <- mallocBytes (#const sizeof(ffi_cif)) }}}
Native compile on this system works fine.
New description: Cross-compiling git HEAD from linux-amd64 to linux-aarch64 and I get the above error message. The command (after removing a bunhc of irrelevant command line flags) is: {{{ inplace/bin/hsc2hs --cc=/usr/bin/aarch64-linux-gnu-gcc \ --ld=/usr/bin/aarch64-linux-gnu-gcc \ --cross-safe --cflag=-fno-stack-protector --cross-compile \ --cflag=-Daarch64_HOST_ARCH=1 \ --cflag=-Dlinux_HOST_OS=1 --cflag=-D__GLASGOW_HASKELL__=711 \ --cflag=-Icompiler/../rts/dist/build \ --cflag=-Werror=unused-but-set-variable \ --cflag=-include \ --cflag=compiler/stage2/build/autogen/cabal_macros.h \ compiler/ghci/LibFFI.hsc -o compiler/stage2/build/LibFFI.hs }}} The command `grep 'sizeof(ffi_cif)' compiler/ghci/LibFFI.hsc` finds: {{{#!hs cif <- mallocBytes (#const sizeof(ffi_cif)) }}} Native compile on this system works fine. Checking out an older revision that was know to compile correctly also fails. That suggests that something in the tool chain has changed. My GHC is still 7.8.3, but `aarch64-linux-gnu-gcc` was recently updated. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10237#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10237: compiler/ghci/LibFFI.hsc:42 sizeof(ffi_cif) is not an integer -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by erikd): Nope, `aarch64-linux-gnu-gcc` was changed over a month ago and this was working much more recently than that. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10237#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10237: compiler/ghci/LibFFI.hsc:42 sizeof(ffi_cif) is not an integer -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by erikd): Ok, here's the problem: {{{ LibFFI.hsc: In function ‘_hsc2hs_test’: LibFFI.hsc:11:14: error: variable ‘test_array’ set but not used [-Werror =unused-but-set-variable] cc1: some warnings being treated as errors }}} It seems `hsc2hs` generates some test files to measure the size of values that looks like this: {{{ void _hsc2hs_test() { static int test_array[1 - 2 * !((long long)(sizeof(ffi_cif)) == (sizeof(ffi_cif)))]; test_array[0] = 0; } }}} The value of `test_array[0]` is set but not used. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10237#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10237: compiler/ghci/LibFFI.hsc:42 sizeof(ffi_cif) is not an integer -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by erikd): Ah, the code path is different for the native compiler case. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10237#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10237: compiler/ghci/LibFFI.hsc:42 sizeof(ffi_cif) is not an integer -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: patch Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by erikd): * status: new => patch Comment: Patch attached. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10237#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10237: hsc2hs : compiler/ghci/LibFFI.hsc:42 sizeof(ffi_cif) is not an integer -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: patch Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10237#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10237: hsc2hs : compiler/ghci/LibFFI.hsc:42 sizeof(ffi_cif) is not an integer -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: closed Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.11 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by rwbarton): * status: patch => closed * resolution: => fixed Comment: I pushed this for now but it would be good to have something that is more robust to changes in warnings. See #9457. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10237#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC