Cross-compiling fails for package 'directory'

Following https://github.com/ku-fpg/raspberry-pi/wiki/GHC-Cross-Compiler-for-Raspberry..., I have built a cross-compiling ghc for creating programs that run on the raspberry pi. This ghc has built a "hello world" program that runs on the rpi: OK so far. Unfortunately, building the package 'directory-1.2.3.0' with this cross- compiler fails with the following error message: "System/Directory/Internal.hsc:31 directive const_str cannot be handled in cross-compilation mode" The offending function from System.Directory is this one:
-- | Filename extension for executable files (including the dot if any) -- (usually @\"\"@ on POSIX systems and @\".exe\"@ on Windows or OS\/2). exeExtension :: String exeExtension = (#const_str EXE_EXTENSION)
Although one can imagine that the meaning of this function is tricky when cross-compiling, I don't think that has actually anything to do with the error. The problem is that hsc2hs cannot handle this 'const_str' directive; see https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/hsc2hs.html#.... Now my question: how can this be fixed? Is the failure of hsc2hs to support this directive just a matter of "not implemented right now", maybe by lack of importance? Or is there a fundamental problem? If fixing hsc2hs is hard, could the 'directory' package perhaps choose another way to implement this function?

Is the failure of hsc2hs to support this directive just a matter of "not implemented right now", maybe by lack of importance? Or is there a fundamental problem?
See also: https://ghc.haskell.org/trac/ghc/ticket/9689 One would probably have to implement a C string literal parser to do this properly.
If fixing hsc2hs is hard, could the 'directory' package perhaps choose another way to implement this function?
Can you try this workaround?
diff --git a/System/Directory/Internal.hsc b/System/Directory/Internal.hsc
index a0a71db..0f9b71f 100644
--- a/System/Directory/Internal.hsc
+++ b/System/Directory/Internal.hsc
@@ -1,3 +1,5 @@
+{-# LANGUAGE CPP #-}
+##include
participants (2)
-
Arie Peterson
-
Phil Ruffwind