-optl behavior in ghc-7.8.1

Simon Marlow marlowsd at gmail.com
Tue Apr 15 19:51:12 UTC 2014


On 14/04/2014 15:44, Brandon Allbery wrote:
> On Mon, Apr 14, 2014 at 10:42 AM, Simon Marlow <marlowsd at gmail.com
> <mailto:marlowsd at gmail.com>> wrote:
>
>     The problem I was fixing was that we weren't always passing the
>     -optl options.  Now when we invoke a program the -optXXX options
>     always come first - I think before it was kind of random and
>     different for each of the phases.
>
>
> Some things do need to come first, like that; but apparently we need
> either after-options or a more flexible library syntax. (Or an
> other-objects?)

If you need control over the ordering of all the linker options, you 
just put -optl in front of them all (object files, library files, -l, 
-L).  Then you'll need at least one object file (an empty one will do) 
to convince GHC that you actually want to run the linker though.  FWIW, 
this is what our build system does.

Cheers,
Simon


More information about the Glasgow-haskell-users mailing list