Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#5914 closed bug (fixed)

armhf build fails in Ubuntu (7.4.1)

Reported by: jani@… Owned by: simonmar
Priority: high Milestone: 7.6.1
Component: Compiler (LLVM) Version: 7.4.1
Keywords: Cc: dterei, juhp@…
Operating System: Linux Architecture: arm
Type of failure: Building GHC failed Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

The ARM code generator calls llc in the same way regardless of the ABI being used. When the hardfloat EABI variant is in use - armhf in Debian/Ubuntu, llc needs to be passed -float-abi=hard. This may mean the build scripts need to detect armel vs armhf and have a config option snippet in compiler/main/DriverPipeline.hs I made a successful build on armhf by just piggybacking it to check it works.

else if (elem VFPv3D16 ext)

+ then ["-mattr=+v7,+vfp3, "-float-abi=hard"]

BTW for Debian/Ubuntu we will need +d16 passed there, but it is not strictly related to the build failure on armhf.

Attachments (1)

0001-add-support-for-ARM-hard-float-ABI-fixes-5914.patch (47.8 KB) - added by kgardas 6 years ago.
Patch adding ARM hard-float ABI support

Download all attachments as: .zip

Change History (13)

comment:1 Changed 6 years ago by jani@…

Architecture: Unknown/Multiplearm
Component: CompilerCompiler (LLVM)
Operating System: Unknown/MultipleLinux
Owner: set to dterei
Type of failure: None/UnknownBuilding GHC failed

comment:2 Changed 6 years ago by dterei

Owner: changed from dterei to kgardas

Re-assigning as ARM stuff isn't handled by me.

comment:3 Changed 6 years ago by dterei

Cc: dterei added

comment:4 Changed 6 years ago by kgardas

Hello, I'll attempt to install hard-float ARM OS over the weekend and will give it a try.

comment:5 Changed 6 years ago by jani@…

Latest ghc packages in Debian sid and Ubuntu precise have the workaround (passing -float-abi=hard to llc on armhf)

comment:6 Changed 6 years ago by kgardas

Thanks, indeed, this is needed info, but I'll first attempt to fix that on GHC HEAD.

comment:7 Changed 6 years ago by juhpetersen

Cc: juhp@… added

Changed 6 years ago by kgardas

Patch adding ARM hard-float ABI support

comment:8 Changed 6 years ago by kgardas

Hi, attached patch adds hard-float ABI support to GHC HEAD. I've bootstrapped this on x86-solaris w/o any issue and also up to the ghc-stage2 failure (#6043) on ARM/Ubuntu with hard-float ABI. I'm not able to test it due to #6043 yet.

comment:9 Changed 6 years ago by simonmar

difficulty: Unknown
Milestone: 7.6.1
Owner: changed from kgardas to simonmar
Priority: normalhigh

I'll test and apply, thanks.

comment:10 Changed 6 years ago by karel.gardas@…

commit 3144f85661da176e3d80f28d652b42245becde09

Author: Karel Gardas <karel.gardas@centrum.cz>
Date:   Wed Apr 25 09:04:50 2012 +0200

    add support for ARM hard-float ABI (fixes #5914)
    
    This patch enhances Platform's ArchARM to include ARM ABI value. It also
    tweaks configure machinery to detect hard-float ABI and to set it wherever
    needed. Finally when hard-float ABI is in use, pass appropriate compiler
    option to the LLVM's llc. Fixes #5914.

 aclocal.m4                                         |    2 +-
 compiler/main/DriverPipeline.hs                    |   16 +-
 compiler/nativeGen/AsmCodeGen.lhs                  |    2 +-
 compiler/nativeGen/RegAlloc/Graph/TrivColorable.hs |   56 ++--
 compiler/nativeGen/RegAlloc/Linear/FreeRegs.hs     |   14 +-
 compiler/nativeGen/RegAlloc/Linear/Main.hs         |   14 +-
 compiler/nativeGen/TargetReg.hs                    |   70 ++--
 compiler/utils/Platform.hs                         |   12 +-
 config.guess                                       |  482 ++++++++++----------
 configure.ac                                       |   14 +
 10 files changed, 345 insertions(+), 337 deletions(-)

comment:11 Changed 6 years ago by simonmar

Resolution: fixed
Status: newclosed

Optimistically closing the ticket, please re-open if there's still a problem.

comment:12 Changed 6 years ago by juhpetersen

Thanks, I tested the patch on ghc-7.4.2 RC2 on Fedora:

http://arm.koji.fedoraproject.org/koji/taskinfo?taskID=839158 (test build)

and it built successfully. So probably will move to this patch for Fedora's ghc-7.4.2.

Note: See TracTickets for help on using tickets.