Compiling natively GHC for ARMv7l softabi
shiftag at nanotek.info
shiftag at nanotek.info
Thu Oct 19 12:35:05 UTC 2017
October 19, 2017 11:52 AM, "Moritz Angermann" <moritz.angermann at gmail.com> 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, shiftag at nanotek.info wrote:
>>
>> October 19, 2017 10:34 AM, "Moritz Angermann" <moritz.angermann at gmail.com> 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
----------------------------------------------------------------------
# grep -v '#' build.mk | sed '/^$/d'
ifneq "$(BuildFlavour)" ""
include mk/flavours/$(BuildFlavour).mk
endif
STRIP_CMD = :
Stage1Only=YES
HADDOCK_DOCS=NO
BUILD_SPHINX_PDF=NO
BUILD_SPHINX_HTML=NO
# make
[and you know the rest...]
More information about the ghc-devs
mailing list