Re: Compiling natively GHC for ARMv7l softabi
Thanks! Looking at the llvm ir file, we find: target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:64:128-a0:0:64-n32" target triple = "armv6-unknown-linux-gnueabihf" that does looks incorrect for armv7l softabi. We have the hardfloat gnueabi, AND armv6. However, I don't know if this influences the generated IR to the point where it's unusable. Looking at https://github.com/ghc/ghc/blob/95c1feeb9ce9b2d6a9453dc4da148b80a5ddce3d/compiler/llvmGen/LlvmCodeGen/Ppr.hs#L35-L86 I don't see a proper configuration for it yet though. Now again we mix the llvm and gcc toolchain, and I don't have gcc on my system right now. We can do the following though: $ llc -O3 StgStartup.ll -o StgStartup.s $ clang --target=arm-unknown-linux-gnueabihf -c StgStartup.s -v and have this successfully produce an object file. As such I don't think the target triple given above is at fault here (apart from potentially generating hard-float fp). I would as such conclude that the issue is the argument passed to gcc as assembler here. I'm a bit at a loss how to solve this here right now. GHC HEAD has seen especially in this area quite a bit of churn as well. On top of my head, I've two suggestions: - Try configuring with a LLVM toolchain. E.g. CC=arm-linux-gnueabi-clang - Try GHC HEAD. If this still fails, you could try to sidestep the mangling and assembly logic, by adding -fast-llvm to the mk/flavour/.mk (e.g. quick-cross, perf-cross). Cheers, Moritz > On Oct 22, 2017, at 4:05 PM, shif...@nanotek.info wrote: > > October 22, 2017 11:51 AM, "Moritz Angermann"> wrote: > >> Can you rerun that command with -keep-llvm-files and attach the generated >> .ll file? >> > > I rerun the same command by adding -keep-llvm-files and the file > "./rts/StgStartup.ll" has been created. Please find it attached. > ___ > ghc-devs mailing list > ghc-devs@haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs ___ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Re: Compiling natively GHC for ARMv7l softabi
October 22, 2017 11:51 AM, "Moritz Angermann"wrote: > Can you rerun that command with -keep-llvm-files and attach the generated .ll > file? > I rerun the same command by adding -keep-llvm-files and the file "./rts/StgStartup.ll" has been created. Please find it attached. StgStartup.ll Description: Binary data ___ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Re: Compiling natively GHC for ARMv7l softabi
Can you rerun that command with -keep-llvm-files and attach the generated .ll file? Cheers, Moritz Sent from my iPhone > On 22 Oct 2017, at 3:06 PM, shif...@nanotek.info wrote: > > October 22, 2017 10:37 AM, "Moritz Angermann"> wrote: > >> Could you try running this with `-v`? Hopefully, this time will will not >> stop somewhere in the middle, but rather give us the full output, and >> also reproduce the errors. >> > > > Understood. > > # inplace/bin/ghc-stage1 -v -static -O -H64m -Wall -Iincludes > -Iincludes/dist -Iincludes/dist-derivedconstants/header > -Iincludes/dist-ghcconstants/header -Irts -Irts/dist/build -DCOMPILING_RTS > -this-unit-id rts -optc-DNOSMP -dcmm-lint -i -irts -irts/dist/build > -Irts/dist/build -irts/dist/build/./autogen -Irts/dist/build/./autogen >-O2-Wnoncanonical-monad-instances -c rts/StgStartup.cmm -o > rts/dist/build/StgStartup.o > Glasgow Haskell Compiler, Version 8.2.1, stage 1 booted by GHC version 8.2.1 > Using binary package database: > /tmp/ghc-8.2.1/inplace/lib/package.conf.d/package.cache > package flags [] > loading package database /tmp/ghc-8.2.1/inplace/lib/package.conf.d > wired-in package ghc-prim mapped to ghc-prim-0.5.1.0 > wired-in package integer-simple mapped to integer-simple-0.1.1.1 > wired-in package base mapped to base-4.10.0.0 > wired-in package rts mapped to rts > wired-in package template-haskell mapped to template-haskell-2.12.0.0 > wired-in package ghc mapped to ghc-8.2.1 > wired-in package dph-seq not found. > wired-in package dph-par not found. > Created temporary directory: /tmp/ghc32190_0 > *** C Compiler: > arm-linux-gnueabi-gcc -marm -fno-stack-protector -DTABLES_NEXT_TO_CODE > -DNOSMP -E -I includes -I includes/dist -I > includes/dist-derivedconstants/header -I includes/dist-ghcconstants/header -I > rts -I rts/dist/build -I rts/dist/build -I rts/dist/build/./autogen -I > /tmp/ghc-8.2.1/libraries/base/include -I /tmp/ghc-8.2.1/rts/dist/build -I > /tmp/ghc-8.2.1/includes -I > /tmp/ghc-8.2.1/includes/dist-derivedconstants/header -include > /tmp/ghc-8.2.1/includes/ghcversion.h -Dlinux_BUILD_OS -Dx86_64_BUILD_ARCH > -Dlinux_HOST_OS -Darm_HOST_ARCH '-D__GLASGOW_HASKELL_LLVM__=309' > -D__GLASGOW_HASKELL_TH__ -include/tmp/ghc32190_0/ghc_2.h -x > assembler-with-cpp rts/StgStartup.cmm -o /tmp/ghc32190_0/ghc_1.cmmcpp > *** ParseCmm [/tmp/ghc32190_0/ghc_1.cmmcpp]: > !!! ParseCmm [/tmp/ghc32190_0/ghc_1.cmmcpp]: finished in 2.50 milliseconds, > allocated 1.737 megabytes > *** LLVM CodeGen: > *** LLVM CodeGen: > Using LLVM version: (3,9) > *** CmmLint [Cmm$ghc_1.cmmcpp]: > !!! CmmLint [Cmm$ghc_1.cmmcpp]: finished in 0.35 milliseconds, allocated > 0.082 megabytes > !!! LLVM CodeGen: finished in 9.53 milliseconds, allocated 5.082 megabytes > *** LLVM Optimiser: > /usr/bin/opt-3.9 /tmp/ghc32190_0/ghc_4.ll -o /tmp/ghc32190_0/ghc_6.bc -O2 > '--enable-tbaa=true' > *** LLVM Compiler: > /usr/bin/llc-3.9 -O3 '-relocation-model=static' /tmp/ghc32190_0/ghc_6.bc -o > /tmp/ghc32190_0/ghc_7.lm_s '--enable-tbaa=true' > *** LLVM Mangler: > !!! LLVM Mangler: finished in 0.81 milliseconds, allocated 0.369 megabytes > *** Assembler: > arm-linux-gnueabi-gcc -marm -fno-stack-protector -DTABLES_NEXT_TO_CODE > -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header > -Iincludes/dist-ghcconstants/header -Irts -Irts/dist/build -Irts/dist/build > -Irts/dist/build/./autogen -x assembler -c /tmp/ghc32190_0/ghc_8.s -o > rts/dist/build/StgStartup.o > /tmp/ghc32190_0/ghc_8.s: Assembler messages: > > /tmp/ghc32190_0/ghc_8.s:41:0: error: > Error: selected processor does not support `ldrd r0,r1,[r3,#64]' in ARM > mode > | > 41 | ldrdr0, r1, [r3, #64] > | ^ > > /tmp/ghc32190_0/ghc_8.s:46:0: error: > Error: selected processor does not support `strd r0,r1,[r3,#64]' in ARM > mode > | > 46 | strdr0, r1, [r3, #64] > | ^ > > /tmp/ghc32190_0/ghc_8.s:108:0: error: > Error: selected processor does not support `ldrd r0,r1,[r2,#64]' in ARM > mode >| > 108 | ldrdr0, r1, [r2, #64] >| ^ > > /tmp/ghc32190_0/ghc_8.s:111:0: error: > Error: selected processor does not support `strd r0,r1,[r2,#64]' in ARM > mode >| > 111 | strdr0, r1, [r2, #64] >| ^ > > /tmp/ghc32190_0/ghc_8.s:137:0: error: > Error: selected processor does not support `ldrd r0,r1,[r2,#64]' in ARM > mode >| > 137 | ldrdr0, r1, [r2, #64] >| ^ > > /tmp/ghc32190_0/ghc_8.s:140:0: error: > Error: selected processor does not support `strd r0,r1,[r2,#64]' in ARM > mode >| > 140 | strdr0, r1, [r2, #64] >| ^ > > /tmp/ghc32190_0/ghc_8.s:163:0: error: > Error: selected processor does not support `ldrd r0,r1,[r2,#64]' in ARM > mode >| > 163 | ldrdr0, r1, [r2, #64] >| ^ > > /tmp/ghc32190_0/ghc_8.s:166:0: error: > Error: selected processor does not support `strd r0,r1,[r2,#64]' in ARM
Re: Compiling natively GHC for ARMv7l softabi
Could you try running this with `-v`? Hopefully, this time will will not stop somewhere in the middle, but rather give us the full output, and also reproduce the errors. > On Oct 22, 2017, at 2:33 PM, shif...@nanotek.info wrote: > > "inplace/bin/ghc-stage1" -static -O -H64m -Wall -Iincludes -Iincludes/dist > -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header > -Irts -Irts/dist/build -DCOMPILING_RTS -this-unit-id rts -optc-DNOSMP > -dcmm-lint -i -irts -irts/ > dist/build -Irts/dist/build -irts/dist/build/./autogen > -Irts/dist/build/./autogen -O2-Wnoncanonical-monad-instances > -c rts/StgStartup.cmm -o rts/dist/build/StgStartup. ___ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Re: Compiling natively GHC for ARMv7l softabi
October 21, 2017 9:21 PM, shif...@nanotek.info wrote: > October 21, > .00µ2017 > 2:.00ÿ3 > PM, > shif...@nanotek.info wrote: > >> October 19, >> .00µ2017 >> 7:.00µ34 >> PM, >> shif...@nanotek.info wrote: >> >>> October 19, >>> .00µ2017 >>> 6:.00ÿ8 >>> PM, "Moritz Angermann" >>>wrote: >> >> Shiftag, >> >> any chance you could try this with 8.2 again then? >>> Hi, >>> >>> I'm going to try that and I will let you know ;) >>> >>> Thanks guys. >> >> Hi, >> >> So I installed GHC-8.2.1 and then I tried to cross-compiling it. The >> ./configure went fine but the >> make : >> >> # make >> Run "make install" to install >> Makefile:46: recipe for target 'default' failed >> make: *** [default] Error 1 >> >> Hmm...did I forgot something ? > > Sorry my bad, I downloaded the wrong archive. Now its compiling, it should > work. > Hi Guys, I hope you have a great Sunday. I'm sorry, it still buggy. So I tried GHC-8.2.1 and I did the following stuff : $ ./configure --target=arm-linux-gnueabi [...] -- Configure completed successfully. Building GHC version : 8.2.1 Git commit id : 0cee25253f9f2cb4f19f021fd974bdad3c26a80b Build platform: x86_64-unknown-linux Host platform : x86_64-unknown-linux Target platform : arm-unknown-linux Bootstrapping using : /usr/bin/ghc which is version : 8.2.1 Using (for bootstrapping) : gcc Using gcc : arm-linux-gnueabi-gcc which is version : 7.2.0 Building a cross compiler : YES Unregisterised: NO hs-cpp : arm-linux-gnueabi-gcc hs-cpp-flags : -E -undef -traditional ar : /usr/bin/arm-linux-gnueabi-ar ld : arm-linux-gnueabi-ld.gold nm : /usr/bin/arm-linux-gnueabi-nm objdump : /usr/bin/arm-linux-gnueabi-objdump ranlib : /usr/bin/arm-linux-gnueabi-ranlib windres : dllwrap : Happy: /usr/bin/happy (1.19.7) Alex : /usr/bin/alex (3.2.3) Perl : /usr/bin/perl sphinx-build : /usr/bin/sphinx-build xelatex : Using LLVM tools llc : /usr/bin/llc-3.9 opt : /usr/bin/opt-3.9 HsColour : /usr/bin/HsColour Tools to build Sphinx HTML documentation available: YES Tools to build Sphinx PDF documentation available: NO -- # grep -v '#' mk/build.mk | sed '/^$/d' BuildFlavour = perf-cross ifneq "$(BuildFlavour)" "" include mk/flavours/$(BuildFlavour).mk endif HADDOCK_DOCS = NO STRIP_CMD = : WITH_TERMINFO = NO # make "inplace/bin/ghc-stage1" -optc-marm -optc-fno-stack-protector -optc-Wall -optc-Wall -optc-Wextra -optc-Wstrict-prototypes -optc-Wmissing-prototypes -optc-Wmissing-declarations -optc-Winline -optc-Waggregate-return -optc-Wpointer-arith -optc-Wmissing-noret urn -optc-Wnested-externs -optc-Wredundant-decls -optc-Iincludes -optc-Iincludes/dist -optc-Iincludes/dist-derivedconstants/header -optc-Iincludes/dist-ghcconstants/header -optc-Irts -optc-Irts/dist/build -optc-DCOMPILING_RTS -optc-DNOSMP -optc-DUSE_LIBFF I_FOR_ADJUSTORS -optc-fno-strict-aliasing -optc-fno-common -optc-Irts/dist/build/./autogen -optc-Werror=unused-but-set-variable -optc-Wno-error=inline -optc-O2 -optc-fomit-frame-pointer -optc-g -optc-DRtsWay=\"rts_v\" -optc-ffunction-sections -optc-fdata- sections -static -O -H64m -Wall -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header -Irts -Irts/dist/build -DCOMPILING_RTS -this-unit-id rts -optc-DNOSMP -dcmm-lint -i -irts -irts/dist/build -Irts /dist/build -irts/dist/build/./autogen -Irts/dist/build/./autogen -O2 -Wnoncanonical-monad-instances -c rts/posix/GetEnv.c -o rts/dist/build/posix/GetEnv.o "inplace/bin/ghc-stage1" -static -O -H64m -Wall -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header -Irts -Irts/dist/build -DCOMPILING_RTS -this-unit-id rts -optc-DNOSMP -dcmm-lint -i -irts -irts/ dist/build -Irts/dist/build -irts/dist/build/./autogen -Irts/dist/build/./autogen -O2-Wnoncanonical-monad-instances -c rts/StgStartup.cmm -o rts/dist/build/StgStartup.o /tmp/ghc22858_0/ghc_8.s: Assembler messages: /tmp/ghc22858_0/ghc_8.s:41:0: error: Error: selected processor does not support `ldrd r0,r1,[r3,#64]' in ARM mode | 41 | ldrdr0, r1, [r3, #64]
Re: Compiling natively GHC for ARMv7l softabi
October 21, .00µ2017 2:.00ÿ3 PM, shif...@nanotek.info wrote: > October 19, > .00µ2017 > 7:.00µ34 > PM, > shif...@nanotek.info wrote: > >> October 19, >> .00µ2017 >> 6:.00ÿ8 >> PM, "Moritz Angermann" >>wrote: >> >>> Shiftag, >>> >>> any chance you could try this with 8.2 again then? >> >> Hi, >> >> I'm going to try that and I will let you know ;) >> >> Thanks guys. > > Hi, > > So I installed GHC-8.2.1 and then I tried to cross-compiling it. The > ./configure went fine but the > make : > > # make > Run "make install" to install > Makefile:46: recipe for target 'default' failed > make: *** [default] Error 1 > > Hmm...did I forgot something ? Sorry my bad, I downloaded the wrong archive. Now its compiling, it should work. ___ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Re: Compiling natively GHC for ARMv7l softabi
October 19, .00µ2017 7:.00µ34 PM, shif...@nanotek.info wrote: > October 19, > .00µ2017 > 6:.00ÿ8 > PM, "Moritz Angermann" >wrote: > >> Shiftag, >> >> any chance you could try this with 8.2 again then? > > Hi, > > I'm going to try that and I will let you know ;) > > Thanks guys. Hi, So I installed GHC-8.2.1 and then I tried to cross-compiling it. The ./configure went fine but the make : # make Run "make install" to install Makefile:46: recipe for target 'default' failed make: *** [default] Error 1 Hmm...did I forgot something ? ___ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Re: Compiling natively GHC for ARMv7l softabi
October 19, .00µ2017 6:.00ÿ8 PM, "Moritz Angermann"wrote: > Shiftag, > > any chance you could try this with 8.2 again then? > Hi, I'm going to try that and I will let you know ;) Thanks guys. ___ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Re: Compiling natively GHC for ARMv7l softabi
Shiftag, any chance you could try this with 8.2 again then? Cheers, Moritz > On Oct 19, 2017, at 9:56 PM, Ben Gamariwrote: > > Moritz Angermann writes: > >> Ugh! This looks even worse. I'm a bit at a loss here, why this didn't even >> make it to the assembly stage... >> > This was a known bug in 8.0. See #11784. IIRC I fixed it for 8.2. > > Cheers, > > - Ben > > ___ > ghc-devs mailing list > ghc-devs@haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs ___ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Re: Compiling natively GHC for ARMv7l softabi
Moritz Angermannwrites: > Ugh! This looks even worse. I'm a bit at a loss here, why this didn't even > make it to the assembly stage... > This was a known bug in 8.0. See #11784. IIRC I fixed it for 8.2. Cheers, - Ben signature.asc Description: PGP signature ___ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Re: Compiling natively GHC for ARMv7l softabi
October 19, 2017 11:52 AM, "Moritz Angermann"wrote: > Ugh! This looks even worse. I'm a bit at a loss here, why this didn't even > make it to the assembly > stage... > >> On Oct 19, 2017, at 3:32 PM, shif...@nanotek.info wrote: >> >> October 19, 2017 10:34 AM, "Moritz Angermann" >> wrote: >> >> "inplace/bin/ghc-stage1" -static -H32m -O -Wall -Iincludes -Iincludes/dist >> -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header >> -Irts -Irts/dist/build >> -DCOMPILING_RTS -this-unit-id rts -optc-DNOSMP -dcmm-lint -i -irts >> -irts/dist/build >> -irts/dist/build/autogen -Irts/dist/build -Irts/dist/build/autogen -O2 -c >> rts/StgStartup.cmm -o >> rts/dist/build/StgStartup.o >>> run this with `-v`, to check the invorcations. I'm pretty certain some >>> flags to opt/llc are >>> missing/wrong here. >> >> Ok :) >> >> Please see below : >> >> $ inplace/bin/ghc-stage1 -v -static -H32m -O -Wall -Iincludes -Iincludes/dist >> -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header >> -Irts -Irts/dist/build >> -DCOMPILING_RTS -this-unit-id rts -optc-DNOSMP -dcmm-lint -i -irts >> -irts/dist/build >> -irts/dist/build/autogen -Irts/dist/build -Irts/dist/build/autogen -O2 -c >> rts/StgStartup.cmm -o >> rts/dist/build/StgStartup.o >> Glasgow Haskell Compiler, Version 8.0.2, stage 1 booted by GHC version 8.0.2 >> Using binary package database: >> /tmp/ghc-8.0.2/inplace/lib/package.conf.d/package.cache >> loading package database /tmp/ghc-8.0.2/inplace/lib/package.conf.d >> wired-in package ghc-prim mapped to ghc-prim-0.5.0.0 >> wired-in package integer-gmp mapped to integer-gmp-1.0.0.1 >> wired-in package base mapped to base-4.9.1.0 >> wired-in package rts mapped to rts >> wired-in package template-haskell mapped to template-haskell-2.11.1.0 >> wired-in package ghc mapped to ghc-8.0.2 >> wired-in package dph-seq not found. >> wired-in package dph-par not found. >> Hsc static flags: >> Created temporary directory: /tmp/ghc25166_0 >> *** C Compiler: >> /usr/bin/arm-linux-gnueabi-gcc -marm -fno-stack-protector >> -DTABLES_NEXT_TO_CODE -DNOSMP -E -I >> includes -I includes/dist -I includes/dist-derivedconstants/header -I >> includes/dist-ghcconstants/header -I rts -I rts/dist/build -I rts/dist/build >> -I >> rts/dist/build/autogen -I /tmp/ghc-8.0.2/libraries/base/include -I >> /tmp/ghc-8.0.2/libraries/integer-gmp/include -I >> /tmp/ghc-8.0.2/rts/dist/build -I >> /tmp/ghc-8.0.2/includes -I >> /tmp/ghc-8.0.2/includes/dist-derivedconstants/header >> '-D__GLASGOW_HASKELL__=800' -include /tmp/ghc-8.0.2/includes/ghcversion.h >> '-Dlinux_BUILD_OS=1' >> '-Dx86_64_BUILD_ARCH=1' '-Dlinux_HOST_OS=1' '-Darm_HOST_ARCH=1' >> '-D__GLASGOW_HASKELL_LLVM__=307' >> '-D__GLASGOW_HASKELL_TH__=0' -include/tmp/ghc25166_0/ghc_2.h -x >> assembler-with-cpp >> rts/StgStartup.cmm -o /tmp/ghc25166_0/ghc_1.cmmcpp >> *** ParseCmm [/tmp/ghc25166_0/ghc_1.cmmcpp]: >> !!! ParseCmm [/tmp/ghc25166_0/ghc_1.cmmcpp]: finished in 4.00 milliseconds, >> allocated 2.082 >> megabytes >> *** LLVM CodeGen: >> *** LLVM CodeGen: >> Using LLVM version: (3,7) >> *** Deleting temp files: >> Deleting: /tmp/ghc25166_0/ghc_5.c /tmp/ghc25166_0/ghc_4.ll >> /tmp/ghc25166_0/ghc_3.rsp >> /tmp/ghc25166_0/ghc_2.h /tmp/ghc25166_0/ghc_1.cmmcpp >> Warning: deleting non-existent /tmp/ghc25166_0/ghc_5.c >> *** Deleting temp dirs: >> Deleting: /tmp/ghc25166_0 >> ghc-stage1: panic! (the 'impossible' happened) >> (GHC version 8.0.2 for arm-unknown-linux): >> hscCmmFile: no_mod >> >> Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug For your information : # ./configure --target=arm-linux-gnueabi --with-ld=arm-linux-gnueabi [...] -- Configure completed successfully. Building GHC version : 8.0.2 Git commit id : 8c7250379d0d2bad1d07dfd556812ff7aa2c42e8 Build platform: x86_64-unknown-linux Host platform : x86_64-unknown-linux Target platform : arm-unknown-linux Bootstrapping using : /usr/bin/ghc which is version : 8.0.2 Using gcc : /usr/bin/arm-linux-gnueabi-gcc which is version : 7.2.0 Building a cross compiler : YES hs-cpp : /usr/bin/arm-linux-gnueabi-gcc hs-cpp-flags : -E -undef -traditional ld : /usr/bin/arm-linux-gnueabi-ld.gold nm : /usr/bin/arm-linux-gnueabi-nm objdump : /usr/bin/arm-linux-gnueabi-objdump Happy: /usr/bin/happy (1.19.7) Alex : /usr/bin/alex (3.2.3) Perl : /usr/bin/perl sphinx-build : /usr/bin/sphinx-build xelatex : Using LLVM tools llc : /usr/bin/llc opt : /usr/bin/opt HsColour : /usr/bin/HsColour Tools to build Sphinx HTML documentation available: YES Tools to build Sphinx PDF documentation available: NO
Re: Compiling natively GHC for ARMv7l softabi
Ugh! This looks even worse. I'm a bit at a loss here, why this didn't even make it to the assembly stage... > On Oct 19, 2017, at 3:32 PM, shif...@nanotek.info wrote: > > October 19, 2017 10:34 AM, "Moritz Angermann"> wrote: > >>> "inplace/bin/ghc-stage1" -static -H32m -O -Wall -Iincludes -Iincludes/dist >>> -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header >>> -Irts -Irts/dist/build >>> -DCOMPILING_RTS -this-unit-id rts -optc-DNOSMP -dcmm-lint -i -irts >>> -irts/dist/build >>> -irts/dist/build/autogen -Irts/dist/build -Irts/dist/build/autogen -O2 -c >>> rts/StgStartup.cmm -o >>> rts/dist/build/StgStartup.o >> >> run this with `-v`, to check the invorcations. I'm pretty certain some flags >> to opt/llc are >> missing/wrong here. > > > Ok :) > > Please see below : > > $ inplace/bin/ghc-stage1 -v -static -H32m -O -Wall -Iincludes > -Iincludes/dist -Iincludes/dist-derivedconstants/header > -Iincludes/dist-ghcconstants/header -Irts -Irts/dist/build -DCOMPILING_RTS > -this-unit-id rts -optc-DNOSMP -dcmm-lint -i -irts -irts/dist/build > -irts/dist/build/autogen -Irts/dist/build -Irts/dist/build/autogen > -O2 -c rts/StgStartup.cmm -o rts/dist/build/StgStartup.o > Glasgow Haskell Compiler, Version 8.0.2, stage 1 booted by GHC version 8.0.2 > Using binary package database: > /tmp/ghc-8.0.2/inplace/lib/package.conf.d/package.cache > loading package database /tmp/ghc-8.0.2/inplace/lib/package.conf.d > wired-in package ghc-prim mapped to ghc-prim-0.5.0.0 > wired-in package integer-gmp mapped to integer-gmp-1.0.0.1 > wired-in package base mapped to base-4.9.1.0 > wired-in package rts mapped to rts > wired-in package template-haskell mapped to template-haskell-2.11.1.0 > wired-in package ghc mapped to ghc-8.0.2 > wired-in package dph-seq not found. > wired-in package dph-par not found. > Hsc static flags: > Created temporary directory: /tmp/ghc25166_0 > *** C Compiler: > /usr/bin/arm-linux-gnueabi-gcc -marm -fno-stack-protector > -DTABLES_NEXT_TO_CODE -DNOSMP -E -I includes -I includes/dist -I > includes/dist-derivedconstants/header -I includes/dist-ghcconstants/header -I > rts -I rts/dist/build -I rts/dist/build -I rts/dist/build/autogen -I > /tmp/ghc-8.0.2/libraries/base/include -I > /tmp/ghc-8.0.2/libraries/integer-gmp/include -I /tmp/ghc-8.0.2/rts/dist/build > -I /tmp/ghc-8.0.2/includes -I > /tmp/ghc-8.0.2/includes/dist-derivedconstants/header > '-D__GLASGOW_HASKELL__=800' -include /tmp/ghc-8.0.2/includes/ghcversion.h > '-Dlinux_BUILD_OS=1' '-Dx86_64_BUILD_ARCH=1' '-Dlinux_HOST_OS=1' > '-Darm_HOST_ARCH=1' '-D__GLASGOW_HASKELL_LLVM__=307' > '-D__GLASGOW_HASKELL_TH__=0' -include/tmp/ghc25166_0/ghc_2.h -x > assembler-with-cpp rts/StgStartup.cmm -o /tmp/ghc25166_0/ghc_1.cmmcpp > *** ParseCmm [/tmp/ghc25166_0/ghc_1.cmmcpp]: > !!! ParseCmm [/tmp/ghc25166_0/ghc_1.cmmcpp]: finished in 4.00 milliseconds, > allocated 2.082 megabytes > *** LLVM CodeGen: > *** LLVM CodeGen: > Using LLVM version: (3,7) > *** Deleting temp files: > Deleting: /tmp/ghc25166_0/ghc_5.c /tmp/ghc25166_0/ghc_4.ll > /tmp/ghc25166_0/ghc_3.rsp /tmp/ghc25166_0/ghc_2.h /tmp/ghc25166_0/ghc_1.cmmcpp > Warning: deleting non-existent /tmp/ghc25166_0/ghc_5.c > *** Deleting temp dirs: > Deleting: /tmp/ghc25166_0 > ghc-stage1: panic! (the 'impossible' happened) > (GHC version 8.0.2 for arm-unknown-linux): > hscCmmFile: no_mod > > Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug ___ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Re: Compiling natively GHC for ARMv7l softabi
October 19, 2017 10:34 AM, "Moritz Angermann"wrote: >> "inplace/bin/ghc-stage1" -static -H32m -O -Wall -Iincludes -Iincludes/dist >> -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header >> -Irts -Irts/dist/build >> -DCOMPILING_RTS -this-unit-id rts -optc-DNOSMP -dcmm-lint -i -irts >> -irts/dist/build >> -irts/dist/build/autogen -Irts/dist/build -Irts/dist/build/autogen -O2 -c >> rts/StgStartup.cmm -o >> rts/dist/build/StgStartup.o > > run this with `-v`, to check the invorcations. I'm pretty certain some flags > to opt/llc are > missing/wrong here. Ok :) Please see below : $ inplace/bin/ghc-stage1 -v -static -H32m -O -Wall -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header -Irts -Irts/dist/build -DCOMPILING_RTS -this-unit-id rts -optc-DNOSMP -dcmm-lint -i -irts -irts/dist/build -irts/dist/build/autogen -Irts/dist/build -Irts/dist/build/autogen -O2 -c rts/StgStartup.cmm -o rts/dist/build/StgStartup.o Glasgow Haskell Compiler, Version 8.0.2, stage 1 booted by GHC version 8.0.2 Using binary package database: /tmp/ghc-8.0.2/inplace/lib/package.conf.d/package.cache loading package database /tmp/ghc-8.0.2/inplace/lib/package.conf.d wired-in package ghc-prim mapped to ghc-prim-0.5.0.0 wired-in package integer-gmp mapped to integer-gmp-1.0.0.1 wired-in package base mapped to base-4.9.1.0 wired-in package rts mapped to rts wired-in package template-haskell mapped to template-haskell-2.11.1.0 wired-in package ghc mapped to ghc-8.0.2 wired-in package dph-seq not found. wired-in package dph-par not found. Hsc static flags: Created temporary directory: /tmp/ghc25166_0 *** C Compiler: /usr/bin/arm-linux-gnueabi-gcc -marm -fno-stack-protector -DTABLES_NEXT_TO_CODE -DNOSMP -E -I includes -I includes/dist -I includes/dist-derivedconstants/header -I includes/dist-ghcconstants/header -I rts -I rts/dist/build -I rts/dist/build -I rts/dist/build/autogen -I /tmp/ghc-8.0.2/libraries/base/include -I /tmp/ghc-8.0.2/libraries/integer-gmp/include -I /tmp/ghc-8.0.2/rts/dist/build -I /tmp/ghc-8.0.2/includes -I /tmp/ghc-8.0.2/includes/dist-derivedconstants/header '-D__GLASGOW_HASKELL__=800' -include /tmp/ghc-8.0.2/includes/ghcversion.h '-Dlinux_BUILD_OS=1' '-Dx86_64_BUILD_ARCH=1' '-Dlinux_HOST_OS=1' '-Darm_HOST_ARCH=1' '-D__GLASGOW_HASKELL_LLVM__=307' '-D__GLASGOW_HASKELL_TH__=0' -include/tmp/ghc25166_0/ghc_2.h -x assembler-with-cpp rts/StgStartup.cmm -o /tmp/ghc25166_0/ghc_1.cmmcpp *** ParseCmm [/tmp/ghc25166_0/ghc_1.cmmcpp]: !!! ParseCmm [/tmp/ghc25166_0/ghc_1.cmmcpp]: finished in 4.00 milliseconds, allocated 2.082 megabytes *** LLVM CodeGen: *** LLVM CodeGen: Using LLVM version: (3,7) *** Deleting temp files: Deleting: /tmp/ghc25166_0/ghc_5.c /tmp/ghc25166_0/ghc_4.ll /tmp/ghc25166_0/ghc_3.rsp /tmp/ghc25166_0/ghc_2.h /tmp/ghc25166_0/ghc_1.cmmcpp Warning: deleting non-existent /tmp/ghc25166_0/ghc_5.c *** Deleting temp dirs: Deleting: /tmp/ghc25166_0 ghc-stage1: panic! (the 'impossible' happened) (GHC version 8.0.2 for arm-unknown-linux): hscCmmFile: no_mod Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug ___ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Re: Compiling natively GHC for ARMv7l softabi
> > "inplace/bin/ghc-stage1" -static -H32m -O -Wall -Iincludes -Iincludes/dist > -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header > -Irts -Irts/dist/build -DCOMPILING_RTS -this-unit-id rts -optc-DNOSMP > -dcmm-lint -i -irts -irts/dist/build -irts/dist/build/autogen > -Irts/dist/build -Irts/dist/build/autogen -O2 -c > rts/StgStartup.cmm -o rts/dist/build/StgStartup.o run this with `-v`, to check the invorcations. I'm pretty certain some flags to opt/llc are missing/wrong here. ___ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Re: Compiling natively GHC for ARMv7l softabi
October 18, 2017 6:51 PM, "Ben Gamari"wrote: > shif...@nanotek.info writes: > >> October 17, 2017 10:45 PM, "Ben Gamari" wrote: >> >> Hi Guys, >> >> Thanks a mil !!! > > Great! > > Do let us know if anything else goes boom. > > Cheers, > > - Ben Hi, I'm afraid I have a very bad news. So it goes boom again and it's like a nuclear bomb :(. So I'm still cross-compiling version 8.0.2 on GNU/Linux with arm-linux-gnueabi compiling suite. As reminders, my target architecture is armv7l soft-abi with neon FPU. I have the following error at make step : ===--- building final phase make --no-print-directory -f ghc.mk phase=final all "inplace/bin/ghc-stage1" -static -H32m -O -Wall -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header -Irts -Irts/dist/build -DCOMPILING_RTS -this-unit-id rts -optc-DNOSMP -dcmm-lint -i -irts -irts/dist/build -irts/dist/build/autogen -Irts/dist/build -Irts/dist/build/autogen -O2 -c rts/StgStartup.cmm -o rts/dist/build/StgStartup.o /tmp/ghc24064_0/ghc_8.s: Assembler messages: /tmp/ghc24064_0/ghc_8.s:38:0: error: /tmp/ghc24064_0/ghc_8.s:42:0: error: Error: selected processor does not support `strd r0,r1,[r7,#64]' in ARM mode /tmp/ghc24064_0/ghc_8.s:131:0: error: Error: selected processor does not support `ldrd r0,r1,[r3,#64]' in ARM mode /tmp/ghc24064_0/ghc_8.s:134:0: error: Error: selected processor does not support `strd r0,r1,[r3,#64]' in ARM mode `arm-linux-gnueabi-gcc' failed in phase `Assembler'. (Exit code: 1) rts/ghc.mk:255: recipe for target 'rts/dist/build/StgStartup.o' failed make[1]: *** [rts/dist/build/StgStartup.o] Error 1 Makefile:129: recipe for target 'all' failed make: *** [all] Error 2 So I checked on Google and I found this: https://ghc.haskell.org/trac/ghc/ticket/11058 Hmm...do I have some hope ? Cheers Shiftag ___ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Re: Compiling natively GHC for ARMv7l softabi
shif...@nanotek.info writes: > October 17, 2017 10:45 PM, "Ben Gamari"wrote: > > Hi Guys, > > Thanks a mil !!! > Great! Do let us know if anything else goes boom. Cheers, - Ben signature.asc Description: PGP signature ___ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Re: Compiling natively GHC for ARMv7l softabi
October 17, 2017 10:45 PM, "Ben Gamari"wrote: > Brandon Allbery writes: > >> On Tue, Oct 17, 2017 at 12:41 AM, wrote: >> >>> utils/ghc-cabal/ghc.mk:48: recipe for target >>> 'utils/ghc-cabal/dist/build/tmp/ghc-cabal' >>> failed >>> make[1]: *** [utils/ghc-cabal/dist/build/tmp/ghc-cabal] Killed >> >> The OOM killer got you. Add swap if you can. > > Exactly. > > Cheers, > > - Ben Hi Guys, Thanks a mil !!! Well, add a swap if I can ? Yes, we can :) $ dd if=/dev/zero of=/tmp/swap bs=1M count=4096 $ chmod 600 /tmp/swap $ mkswap /tmp/swap $ swapon /tmp/swap $ swapon -s Here we go, now it's fixed. I have an other issue but I can figure it out myself. Cheers, Shiftag ___ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Re: Compiling natively GHC for ARMv7l softabi
Brandon Allberywrites: > On Tue, Oct 17, 2017 at 12:41 AM, wrote: > >> utils/ghc-cabal/ghc.mk:48: recipe for target >> 'utils/ghc-cabal/dist/build/tmp/ghc-cabal' >> failed >> make[1]: *** [utils/ghc-cabal/dist/build/tmp/ghc-cabal] Killed >> > > The OOM killer got you. Add swap if you can. > Exactly. Cheers, - Ben signature.asc Description: PGP signature ___ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Re: Compiling natively GHC for ARMv7l softabi
On Tue, Oct 17, 2017 at 12:41 AM,wrote: > utils/ghc-cabal/ghc.mk:48: recipe for target > 'utils/ghc-cabal/dist/build/tmp/ghc-cabal' > failed > make[1]: *** [utils/ghc-cabal/dist/build/tmp/ghc-cabal] Killed > The OOM killer got you. Add swap if you can. -- brandon s allbery kf8nh sine nomine associates allber...@gmail.com ballb...@sinenomine.net unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net ___ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Re: Compiling natively GHC for ARMv7l softabi
> shif...@nanotek.info writes: > >> Hi List, >> >> I would like to install GHC for my CPU which is an ARMv7L Soft-ABI >> NEON FPU. I read some stuff on ARM and GHC related. So it appears that >> an installation is possible but with a RPi. The problem is the stack >> binary which has been compiled for Hard-Float target. So it should not >> be difficult to make it work for my architecture. > > Indeed I suspect you are right; it should be fairly straightforward to > build GHC for your platform. > >> I checked for stack sources (stack-1.5.1.tar.gz) but I have any clue >> about how to compile it. Can you give me an hand ? > > First you will need to build GHC itself. This will be a two-step > process: > > 1. First build a cross-compiler [1] for your ARMv7L target on a machine > with a working GHC (e.g. an amd64 machine). > > 2. Transfer this compiler to your target and use it to build a native > GHC > > Let us know if you have any trouble. > > Cheers, > > - Ben > > [1] https://ghc.haskell.org/trac/ghc/wiki/Building/CrossCompiling Thank you. So, I succeed to install GHC on x64 GNU/Linux machine. However, I have an issue at Stage1 while cross-compiling. I have the following error : # make ===--- building phase 0 make --no-print-directory -f ghc.mk phase=0 phase_0_builds utils/genprimopcode/ghc.mk:19: utils/genprimopcode/dist/package-data.mk: No such file or directory utils/deriveConstants/ghc.mk:19: utils/deriveConstants/dist/package-data.mk: No such file or directory utils/genapply/ghc.mk:23: utils/genapply/dist/package-data.mk: No such file or directory libraries/hpc/ghc.mk:3: libraries/hpc/dist-boot/package-data.mk: No such file or directory libraries/binary/ghc.mk:3: libraries/binary/dist-boot/package-data.mk: No such file or directory libraries/Cabal/Cabal/ghc.mk:3: libraries/Cabal/Cabal/dist-boot/package-data.mk: No such file or directory libraries/ghc-boot-th/ghc.mk:3: libraries/ghc-boot-th/dist-boot/package-data.mk: No such file or directory libraries/ghc-boot/ghc.mk:3: libraries/ghc-boot/dist-boot/package-data.mk: No such file or directory libraries/template-haskell/ghc.mk:3: libraries/template-haskell/dist-boot/package-data.mk: No such file or directory libraries/hoopl/ghc.mk:3: libraries/hoopl/dist-boot/package-data.mk: No such file or directory libraries/transformers/ghc.mk:3: libraries/transformers/dist-boot/package-data.mk: No such file or directory libraries/terminfo/ghc.mk:3: libraries/terminfo/dist-boot/package-data.mk: No such file or directory compiler/ghc.mk:584: compiler/stage1/package-data.mk: No such file or directory utils/hsc2hs/ghc.mk:15: utils/hsc2hs/dist/package-data.mk: No such file or directory utils/ghc-pkg/ghc.mk:60: utils/ghc-pkg/dist/package-data.mk: No such file or directory utils/dll-split/ghc.mk:23: utils/dll-split/dist-install/package-data.mk: No such file or directory ghc/ghc.mk:111: ghc/stage1/package-data.mk: No such file or directory "/usr/bin/ghc" -H32m -O -Wall \ -optc-Wall -optc-fno-stack-protector \ \ -hide-all-packages \ -package base -package array -package time -package containers -package bytestring -package deepseq -package process -package pretty -package directory -package unix \ --make utils/ghc-cabal/Main.hs -o utils/ghc-cabal/dist/build/tmp/ghc-cabal \ -no-user-package-db \ -Wall -fno-warn-unused-imports -fno-warn-warnings-deprecations \ -DCABAL_VERSION=1,24,2,0 \ -DMIN_VERSION_binary_0_8_0 \ -DBOOTSTRAPPING \ -optP-include -optPutils/ghc-cabal/cabal_macros_boot.h \ -odir bootstrapping \ -hidir bootstrapping \ -ilibraries/Cabal/Cabal \ -ilibraries/binary/src -DGENERICS \ -ilibraries/filepath \ -ilibraries/hpc \ [53 of 95] Compiling Distribution.PackageDescription ( libraries/Cabal/Cabal/Distribution/PackageDescription.hs, bootstrapping/Distribution/PackageDescription.o ) utils/ghc-cabal/ghc.mk:48: recipe for target 'utils/ghc-cabal/dist/build/tmp/ghc-cabal' failed make[1]: *** [utils/ghc-cabal/dist/build/tmp/ghc-cabal] Killed Makefile:129: recipe for target 'all' failed make: *** [all] Error 2 I checked Google and I found the following patch : https://ghc.haskell.org/trac/ghc/ticket/8709 But it didn't work. Do you have an idea to fix it ? Cheers ___ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Re: Compiling natively GHC for ARMv7l softabi
shif...@nanotek.info writes: > Hi List, > > I would like to install GHC for my CPU which is an ARMv7L Soft-ABI > NEON FPU. I read some stuff on ARM and GHC related. So it appears that > an installation is possible but with a RPi. The problem is the stack > binary which has been compiled for Hard-Float target. So it should not > be difficult to make it work for my architecture. > Indeed I suspect you are right; it should be fairly straightforward to build GHC for your platform. > I checked for stack sources (stack-1.5.1.tar.gz) but I have any clue > about how to compile it. Can you give me an hand ? > First you will need to build GHC itself. This will be a two-step process: 1. First build a cross-compiler [1] for your ARMv7L target on a machine with a working GHC (e.g. an amd64 machine). 2. Transfer this compiler to your target and use it to build a native GHC Let us know if you have any trouble. Cheers, - Ben [1] https://ghc.haskell.org/trac/ghc/wiki/Building/CrossCompiling signature.asc Description: PGP signature ___ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Compiling natively GHC for ARMv7l softabi
Hi List, I would like to install GHC for my CPU which is an ARMv7L Soft-ABI NEON FPU. I read some stuff on ARM and GHC related. So it appears that an installation is possible but with a RPi. The problem is the stack binary which has been compiled for Hard-Float target. So it should not be difficult to make it work for my architecture. I checked for stack sources (stack-1.5.1.tar.gz) but I have any clue about how to compile it. Can you give me an hand ? Cheers, PS: For info, usually I compiled natively that way : "-march=armv7-a -mfpu=neon -mtune=cortex-a9" ___ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs