summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-02-13 14:00:15 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-02-13 15:53:10 -0400
commit4f59f9439687cccfb7aac6aca62dbe97038179bf (patch)
tree94d8fa2e00989c183a20db782b8c5e9fa0e3ff9b /Build
parent16405cbd31e2ee5a2ef021a1c178738709b087c3 (diff)
windows: Fix process termination code.
The ctrl-c hack used before didn't actually seem to work. No haskell libraries expose TerminateProcess. I tried just calling it via FFI, but got segfaults, probably to do with the wacky process handle not being managed correctly. Moving it all into one C function worked. This was hell. The EvilLinker hack was just final icing on the cake. We all know what the cake was made of.
Diffstat (limited to 'Build')
-rw-r--r--Build/EvilLinker.hs11
1 files changed, 9 insertions, 2 deletions
diff --git a/Build/EvilLinker.hs b/Build/EvilLinker.hs
index c8641f649..1b57ba959 100644
--- a/Build/EvilLinker.hs
+++ b/Build/EvilLinker.hs
@@ -17,6 +17,7 @@ import Control.Applicative ((<$>))
import Control.Monad
import System.Directory
import Data.Maybe
+import Data.List
import Utility.Monad
import Utility.Process
@@ -94,13 +95,19 @@ parseCollect2 = do
path <- manyTill anyChar (try $ string ldcmd)
void $ char ' '
params <- restOfLine
- return $ CmdParams (path ++ ldcmd) (escapeDosPaths params) Nothing
+ return $ CmdParams (path ++ ldcmd) (skipHack $ escapeDosPaths params) Nothing
where
ldcmd = "ld.exe"
versionline = do
void $ string "collect2 version"
restOfLine
-
+
+{- For unknown reasons, asking the linker to link this in fails,
+ - with error about multiple definitions of a symbol from the library.
+ - This is a horrible hack. -}
+skipHack :: String -> String
+skipHack = replace "dist/build/git-annex/git-annex-tmp/Utility/winprocess.o" ""
+
{- Input contains something like
- c:/program files/haskell platform/foo -LC:/Program Files/Haskell Platform/ -L...
- and the *right* spaces must be escaped with \