[GHC] #15718: Build panic on ghc-8.6.1 under FreeBSD when using -fllvm

#15718: Build panic on ghc-8.6.1 under FreeBSD when using -fllvm -------------------------------------+------------------------------------- Reporter: gwright | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.6.1 Keywords: | Operating System: FreeBSD Architecture: x86_64 | Type of failure: Compile-time (amd64) | crash or panic Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- This looks like a straightforward oversight. I am building my pure haskell LU solver under FreeBSD. I use the -fllvm compiler option because I need extra numerical performance. When I build, I get (this is the output from GitLab CI, which is in turn running 'stack build') {{{ Running with gitlab-runner 11.2.0 (35e8515d) on stacker.18clay.com a2111f63 Using Shell executor... Running on stacker.18clay.com... Fetching changes... Removing .stack-work/ HEAD is now at f8fe3b4 Use llvm60 on FreeBSD. From https://gitlab.18clay.com/software/luSolve f8fe3b4..c993a26 streamlined -> origin/streamlined Checking out c993a262 as streamlined... Skipping Git submodules setup $ stack build --pedantic luSolve-0.5: configure (lib) Configuring luSolve-0.5... luSolve-0.5: build (lib) Preprocessing library for luSolve-0.5.. Building library for luSolve-0.5.. [1 of 1] Compiling Numeric.LinearAlgebra.LUSolve ( src/Numeric/LinearAlgebra/LUSolve.hs, .stack- work/dist/x86_64-freebsd/Cabal-2.4.0.1/build/Numeric/LinearAlgebra/LUSolve.o ) ghc: panic! (the 'impossible' happened) (GHC version 8.6.1 for x86_64-portbld-freebsd): Failed to lookup the datalayout for x86_64-unknown-freebsd; available targets: ["i386-unknown-windows","i686-unknown-windows","x86_64 -unknown-windows","arm-unknown-linux-gnueabihf","armv6-unknown-linux- gnueabihf","armv6l-unknown-linux-gnueabihf","armv7-unknown-linux-gnueabihf ","armv7a-unknown-linux-gnueabi","armv7l-unknown-linux-gnueabihf","aarch64 -unknown-linux-gnu","aarch64-unknown-linux","i386-unknown-linux-gnu","i386 -unknown-linux","x86_64-unknown-linux-gnu","x86_64-unknown-linux","armv7 -unknown-linux-androideabi","aarch64-unknown-linux-android","powerpc64le- unknown-linux","amd64-portbld-freebsd","arm-unknown-nto-qnx-eabi","i386 -apple-darwin","x86_64-apple-darwin","armv7-apple-ios","aarch64-apple- ios","i386-apple-ios","x86_64-apple-ios","aarch64-unknown-freebsd","armv6 -unknown-freebsd-gnueabihf","armv7-unknown-freebsd-gnueabihf"] CallStack (from HasCallStack): error, called at compiler/llvmGen/LlvmCodeGen.hs:96:24 in ghc:LlvmCodeGen Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug -- While building custom Setup.hs for package luSolve-0.5 using: /home/gitlab-runner/.stack/setup-exe-cache/x86_64-freebsd/Cabal- simple_mPHDZzAJ_2.4.0.1_ghc-8.6.1 --builddir=.stack- work/dist/x86_64-freebsd/Cabal-2.4.0.1 build lib:luSolve --ghc-options " -ddump-hi -ddump-to-file" Process exited with code: ExitFailure 1 ERROR: Job failed: exit status 1 }}} The bug seems simple. The compiler is looking for the datalayout for x86_64-unknown-freebsd; but what is available is amd64-portbld-freebsd. Is this just a simple naming error? The stack resolver was the cutting- edge nightly-2018-10-6; if it is a problem in their packaging rather than ghc itself I will file a report with them (though ghc did panic here, and as the breath ebbed from its ASTs and light faded from the code generator, it pleaded that a bug report be filed). I've attached the .cabal file in case it helps. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15718 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15718: Build panic on ghc-8.6.1 under FreeBSD when using -fllvm -------------------------------------+------------------------------------- Reporter: gwright | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.6.1 Resolution: | Keywords: Operating System: FreeBSD | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by gwright): * Attachment "luSolve.cabal" added. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15718 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15718: Build panic on ghc-8.6.1 under FreeBSD when using -fllvm -------------------------------------+------------------------------------- Reporter: gwright | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.6.1 Resolution: | Keywords: Operating System: FreeBSD | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by gwright): The publicly accessible source code for the linear system solver is at [https://github.com/gwright83/luSolve], though that version doesn't specify building with LLVM in the .cabal file. The .cabal file attached to this ticket is the one that exhibits the failure. The build OS is FreeBSD 11.2. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15718#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15718: Build panic on ghc-8.6.1 under FreeBSD when using -fllvm -------------------------------------+------------------------------------- Reporter: gwright | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.8.1 Component: Compiler | Version: 8.6.1 Resolution: | Keywords: Operating System: FreeBSD | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * priority: normal => high * milestone: => 8.8.1 Comment: We should make sure this happens for 8.8. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15718#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15718: Build panic on ghc-8.6.1 under FreeBSD when using -fllvm -------------------------------------+------------------------------------- Reporter: gwright | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.8.1 Component: Compiler (LLVM) | Version: 8.6.1 Resolution: | Keywords: Operating System: FreeBSD | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by George): * component: Compiler => Compiler (LLVM) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15718#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15718: Build panic on ghc-8.6.1 under FreeBSD when using -fllvm -------------------------------------+------------------------------------- Reporter: gwright | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.8.1 Component: Compiler (LLVM) | Version: 8.6.1 Resolution: | Keywords: Operating System: FreeBSD | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by lelf): * cc: lelf (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15718#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15718: Build panic on ghc-8.6.1 under FreeBSD when using -fllvm -------------------------------------+------------------------------------- Reporter: gwright | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.8.1 Component: Compiler (LLVM) | Version: 8.6.1 Resolution: | Keywords: Operating System: FreeBSD | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): Hmm, there is something odd going on here. 396aac4c65a47b6252e0a73d2a3066e924d53f11 added the `amd64-portbld-freebsd` triple but this suggests that we should actually be using `x86_64-unknown-freebsd`. I guess I'll just add the missing triplet. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15718#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15718: Build panic on ghc-8.6.1 under FreeBSD when using -fllvm -------------------------------------+------------------------------------- Reporter: gwright | Owner: (none) Type: bug | Status: patch Priority: high | Milestone: 8.8.1 Component: Compiler (LLVM) | Version: 8.6.1 Resolution: | Keywords: Operating System: FreeBSD | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5448 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => patch * differential: => Phab:D5448 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15718#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15718: Build panic on ghc-8.6.1 under FreeBSD when using -fllvm
-------------------------------------+-------------------------------------
Reporter: gwright | Owner: (none)
Type: bug | Status: patch
Priority: high | Milestone: 8.8.1
Component: Compiler (LLVM) | Version: 8.6.1
Resolution: | Keywords:
Operating System: FreeBSD | Architecture: x86_64
Type of failure: Compile-time | (amd64)
crash or panic | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D5448
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#15718: Build panic on ghc-8.6.1 under FreeBSD when using -fllvm -------------------------------------+------------------------------------- Reporter: gwright | Owner: (none) Type: bug | Status: closed Priority: high | Milestone: 8.8.1 Component: Compiler (LLVM) | Version: 8.6.1 Resolution: fixed | Keywords: Operating System: FreeBSD | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5448 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15718#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC