Commit 3fff0020 authored by kgardas's avatar kgardas

on ARMv7 with VFPv3[D16] support pass appropriate -mattr value to LLVM llc

parent bab9a72d
......@@ -1333,7 +1333,8 @@ runPhase LlvmLlc input_fn dflags
SysTools.Option $ "-relocation-model=" ++ rmodel,
SysTools.FileOption "" input_fn,
SysTools.Option "-o", SysTools.FileOption "" output_fn]
++ map SysTools.Option lc_opts)
++ map SysTools.Option lc_opts
++ map SysTools.Option fpOpts)
return (LlvmMangle, output_fn)
where
......@@ -1341,6 +1342,17 @@ runPhase LlvmLlc input_fn dflags
llvmOpts = if platformOS (targetPlatform dflags) == OSDarwin
then ["-O1", "-O2", "-O2"]
else ["-O1", "-O2", "-O3"]
-- On ARMv7 using LLVM, LLVM fails to allocate floating point registers
-- while compiling GHC source code. It's probably due to fact
-- that it does not enable VFP by default. Let's do this manually
-- here
fpOpts = case platformArch (targetPlatform dflags) of
ArchARM ARMv7 ext -> if (elem VFPv3 ext)
then ["-mattr=+v7,+vfp3"]
else if (elem VFPv3D16 ext)
then ["-mattr=+v7,+vfp3,+d16"]
else []
_ -> []
-----------------------------------------------------------------------------
-- LlvmMangle phase
......@@ -1465,8 +1477,8 @@ mkExtraObjToLinkIntoBinary dflags dep_packages = do
elfSectionNote :: String
elfSectionNote = case platformArch (targetPlatform dflags) of
ArchARM -> "%note"
_ -> "@note"
ArchARM _ _ -> "%note"
_ -> "@note"
-- The "link info" is a string representing the parameters of the
-- link. We save this information in the binary, and the next time we
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment