It looks like where x86 assembly is using '@' character,
ARM assembly requires '%' character. This makes a problem in the patch
814edf44433801e37318ce79082ac6991dbc87dd 'Force re-linking if
the options have changed (#4451)' which makes linking assembly
file uncompilable on ARM. This patch fixes this.
---
 compiler/main/DriverPipeline.hs |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
index afbd03e..b02cd39 100644
--- a/compiler/main/DriverPipeline.hs
+++ b/compiler/main/DriverPipeline.hs
@@ -1440,7 +1440,10 @@ mkExtraObjToLinkIntoBinary dflags dep_packages = do
       | isWindowsTarget = empty
       | otherwise = hcat [
           text "__asm__(\"\\t.section ", text ghcLinkInfoSectionName,
-                                    text ",\\\"\\\",@note\\n",
+                                    text ",\\\"\\\",",
+                                    text elfSectionNote,
+                                    text "\\n",
+
                     text "\\t.ascii \\\"", info', text "\\\"\\n\");" ]
           where
             -- we need to escape twice: once because we're inside a C string,
@@ -1449,6 +1452,11 @@ mkExtraObjToLinkIntoBinary dflags dep_packages = do
 
             escape :: String -> String
             escape = concatMap (charToC.fromIntegral.ord)
+#ifdef arm_TARGET_ARCH
+            elfSectionNote = "%note"
+#else
+            elfSectionNote = "@note"
+#endif
 
 -- The "link info" is a string representing the parameters of the
 -- link.  We save this information in the binary, and the next time we
-- 
1.7.4.3


_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to