[GHC] #7620: Via-C unregistered QNX ARM build fails

#7620: Via-C unregistered QNX ARM build fails --------------------------------+------------------------------------------- Reporter: singpolyma | Owner: Type: bug | Status: new Priority: normal | Component: Compiler Version: 7.7 | Keywords: qnx unregistered via-c integer-simple Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: Building GHC failed | Blockedby: Blocking: | Related: --------------------------------+------------------------------------------- The cross-compiling toolchain I used can be had from https://developer.blackberry.com/develop/platform_choice/ndk.html {{{ ./configure --target=arm-unknown-nto-qnx8.0.0eabi --enable-unregistered }}} I will attach my build.mk to this ticket, but I did *not* set it to use LLVM for this attempt. I have also attached two make.log files. One that succeeds up to #7490, and another quite short one that fails very fast with: {{{ when making flags consistent: Warning: Compiler unregisterised, so compiling via C /tmp/ghc25531_0/ghc25531_0.hc: In function 'c2pA_entry': /tmp/ghc25531_0/ghc25531_0.hc:3691:1: warning: this decimal constant is unsigned only in ISO C90 [enabled by default] /tmp/ghc25531_0/ghc25531_0.hc:3691:17: error: expected ')' before numeric constant }}} Can current `integer-simple` not be compiled via-C for unregistered? -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7620 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7620: Via-C unregistered QNX ARM build fails ------------------------------------------------------+--------------------- Reporter: singpolyma | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.7 Keywords: qnx unregistered via-c integer-simple | Os: QNX Architecture: arm | Failure: Building GHC failed Difficulty: Unknown | Testcase: Blockedby: | Blocking: 7623 Related: | ------------------------------------------------------+--------------------- Changes (by simonmar): * difficulty: => Unknown * os: Unknown/Multiple => QNX * architecture: Unknown/Multiple => arm -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7620#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7620: Via-C unregistered QNX ARM build fails ------------------------------------------------------+--------------------- Reporter: singpolyma | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.7 Keywords: qnx unregistered via-c integer-simple | Os: QNX Architecture: arm | Failure: Building GHC failed Difficulty: Unknown | Testcase: Blockedby: | Blocking: 7623 Related: | ------------------------------------------------------+--------------------- Comment(by psycotica0): Running {{{ "inplace/bin/ghc-stage1" -static -H64m -O0 -fasm -package-name integer-simple-0.1.1.0 \ -hide-all-packages -i -ilibraries/integer-simple/. -ilibraries/integer- simple/dist-install/build \ -ilibraries/integer-simple/dist-install/build/autogen -Ilibraries/integer- simple/dist-install/build \ -Ilibraries/integer-simple/dist-install/build/autogen -Ilibraries/integer- simple/. -optP-include \ -optPlibraries/integer-simple/dist-install/build/autogen/cabal_macros.h -package ghc-prim-0.3.1.0 \ -package-name integer-simple -Wall -XHaskell98 -XCPP -XMagicHash -XBangPatterns -XUnboxedTuples \ -XForeignFunctionInterface -XUnliftedFFITypes -XNoImplicitPrelude -O -fasm -no-user-package-db \ -rtsopts -odir libraries/integer-simple/dist-install/build -hidir libraries/integer-simple/dist-install/build \ -stubdir libraries/integer-simple/dist-install/build -hisuf hi -osuf o -hcsuf hc \ -c libraries/integer-simple/./GHC/Integer/Type.hs \ -o libraries/integer-simple/dist-install/build/GHC/Integer/Type.o }}} Which is what make runs, gives me the same error. Adding -keep-hc-file allows one to inspect the generated C-Code. The problem line looks like: {{{ _s1ny = (_s1nj--2147483648) + (_s1nk + _s1ns); }}} Which is not valid. A few of the lines around use 0x80000000U, which happens to be the same binary value on 32-bit systems. It also corresponds to "half_bound_up" in the Type.hs that generated this bad C. So, I don't know if this issue is that the code generator should spit out (_s1nj-0x80000000U) like it does in other places, or if the issue is that it should spit out (_s1nj-(-2147483648)), but I don't know enough about the Code Generator to find it myself right now. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7620#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7620: Via-C unregisterised ARM build fails ------------------------------------------------------+--------------------- Reporter: singpolyma | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.7 Keywords: qnx unregistered via-c integer-simple | Os: Unknown/Multiple Architecture: arm | Failure: Building GHC failed Difficulty: Unknown | Testcase: Blockedby: | Blocking: 7623 Related: | ------------------------------------------------------+--------------------- Changes (by psycotica0): * os: QNX => Unknown/Multiple Comment: Oh, also, this was just on arm-linux-gnueabi unregisterised, so QNX is not to blame, it just doesn't generate valid C right now. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7620#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7620: Via-C unregisterised ARM build fails ------------------------------------------------------+--------------------- Reporter: singpolyma | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.7 Keywords: qnx unregistered via-c integer-simple | Os: Unknown/Multiple Architecture: arm | Failure: Building GHC failed Difficulty: Unknown | Testcase: Blockedby: | Blocking: 7623 Related: | ------------------------------------------------------+--------------------- Changes (by psycotica0): * cc: 0@… (added) -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7620#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7620: Via-C unregisterised ARM build fails ------------------------------------------------------+--------------------- Reporter: singpolyma | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.7 Keywords: qnx unregistered via-c integer-simple | Os: Unknown/Multiple Architecture: arm | Failure: Building GHC failed Difficulty: Unknown | Testcase: Blockedby: | Blocking: 7623 Related: | ------------------------------------------------------+--------------------- Comment(by psycotica0): Ok, so, as I expected, I just confirmed that on my computer, even without ARM, just with unregisterised and my local i386, it fails with the same error. The code generator just spits out bad C. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7620#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7620: Via-C unregisterised ARM build fails --------------------------------------------------+------------------------- Reporter: singpolyma | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.7 Keywords: unregistered via-c integer-simple | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: Building GHC failed Difficulty: Unknown | Testcase: Blockedby: | Blocking: 7623 Related: | --------------------------------------------------+------------------------- Changes (by singpolyma): * keywords: qnx unregistered via-c integer-simple => unregistered via-c integer-simple * architecture: arm => Unknown/Multiple -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7620#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7620: Via-C unregisterised build fails for integer-simple --------------------------------------------------+------------------------- Reporter: singpolyma | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.7 Keywords: unregistered via-c integer-simple | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: Building GHC failed Difficulty: Unknown | Testcase: Blockedby: | Blocking: 7623 Related: | --------------------------------------------------+------------------------- -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7620#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7620: Via-C unregisterised build fails for integer-simple --------------------------------------------------+------------------------- Reporter: singpolyma | Owner: Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.7 Keywords: unregistered via-c integer-simple | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: Building GHC failed Difficulty: Unknown | Testcase: Blockedby: | Blocking: 7623 Related: | --------------------------------------------------+------------------------- Changes (by singpolyma): * status: new => patch -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7620#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7620: Via-C unregisterised build fails for integer-simple --------------------------------------------------+------------------------- Reporter: singpolyma | Owner: Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.7 Keywords: unregistered via-c integer-simple | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: Building GHC failed Difficulty: Unknown | Testcase: Blockedby: | Blocking: 7623 Related: | --------------------------------------------------+------------------------- Comment(by igloo): The patch looks right to me, but I think there might be a larger problem here. `halfBoundUp` and `fullBound` are of type `Digit`, which is a synonym for `Word#`, so why do we end up representing them with `Int`? -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7620#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7620: Via-C unregisterised build fails for integer-simple --------------------------------------------------+------------------------- Reporter: singpolyma | Owner: Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.7 Keywords: unregistered via-c integer-simple | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: Building GHC failed Difficulty: Unknown | Testcase: Blockedby: | Blocking: 7623 Related: | --------------------------------------------------+------------------------- Comment(by simonmar): The patch is a bit heavy-handed - the special case for negative offsets is not an optimisation, it's there to make the generated C easier to read, and it's pretty important (IMHO). It would be good to look into @igloo's concerns too while we're here. I'm also wondering why my unregisterised builds using `integer-simple` didn't run into this... -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7620#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7620: Via-C unregisterised build fails for integer-simple --------------------------------------------------+------------------------- Reporter: singpolyma | Owner: Type: bug | Status: patch Priority: high | Milestone: 7.8.1 Component: Compiler | Version: 7.7 Keywords: unregistered via-c integer-simple | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: Building GHC failed Difficulty: Unknown | Testcase: Blockedby: | Blocking: 7623 Related: | --------------------------------------------------+------------------------- Changes (by simonmar): * priority: normal => high * milestone: => 7.8.1 Comment: I attached another patch, if someone experiencing the problem could verify that it works, that would be great. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7620#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7620: Via-C unregisterised build fails for integer-simple --------------------------------------------------+------------------------- Reporter: singpolyma | Owner: Type: bug | Status: patch Priority: high | Milestone: 7.8.1 Component: Compiler | Version: 7.7 Keywords: unregistered via-c integer-simple | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: Building GHC failed Difficulty: Unknown | Testcase: Blockedby: | Blocking: 7623 Related: | --------------------------------------------------+------------------------- Comment(by psycotica0): This patch seems to work as well as mine. For the line in question it provides the same output, but I can understand not wanting to have every negative number be represented as _blah+-number. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7620#comment:13 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7620: Via-C unregisterised build fails for integer-simple
--------------------------------------------------+-------------------------
Reporter: singpolyma | Owner:
Type: bug | Status: patch
Priority: high | Milestone: 7.8.1
Component: Compiler | Version: 7.7
Keywords: unregistered via-c integer-simple | Os: Unknown/Multiple
Architecture: Unknown/Multiple | Failure: Building GHC failed
Difficulty: Unknown | Testcase:
Blockedby: | Blocking: 7623
Related: |
--------------------------------------------------+-------------------------
Comment(by marlowsd@…):
commit b91f3d260f3ccb57e8fcd61f943c6fadf26391c8
{{{
Author: Simon Marlow

#7620: Via-C unregisterised build fails for integer-simple ----------------------------------+----------------------------------------- Reporter: singpolyma | Owner: Type: bug | Status: closed Priority: high | Milestone: 7.8.1 Component: Compiler | Version: 7.7 Resolution: fixed | Keywords: unregistered via-c integer-simple Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: Building GHC failed | Difficulty: Unknown Testcase: | Blockedby: Blocking: 7623 | Related: ----------------------------------+----------------------------------------- Changes (by simonmar): * status: patch => closed * resolution: => fixed -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7620#comment:15 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC