Skip to content
Snippets Groups Projects
Commit fb14e4e2 authored by Erik de Castro Lopo's avatar Erik de Castro Lopo Committed by Mikolaj
Browse files

Fix configuation of ldProgram

Standard GNU `ld` ues `--relocatable` while `ld.gold` uses a `-relocatable`
flag (with a single `-`). Code will now detect both versions.
parent a134b265
No related branches found
No related tags found
No related merge requests found
......@@ -370,7 +370,19 @@ ldProgram =
-- `lld` only accepts `-help`.
`catchIO` (\_ -> return "")
let k = "Supports relocatable output"
v = if "--relocatable" `isInfixOf` ldHelpOutput then "YES" else "NO"
-- Standard GNU `ld` uses `--relocatable` while `ld.gold` uses
-- `-relocatable` (single `-`).
v
| "-relocatable" `isInfixOf` ldHelpOutput = "YES"
-- ld64 on macOS has this lovely response for "--help"
--
-- ld64: For information on command line options please use 'man ld'.
--
-- it does however support -r, if you read the manpage
-- (e.g. https://www.manpagez.com/man/1/ld64/)
| "ld64:" `isPrefixOf` ldHelpOutput = "YES"
| otherwise = "NO"
m = Map.insert k v (programProperties ldProg)
return $ ldProg{programProperties = m}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment