On 13 September 2004 19:40, Claus Reinke wrote:
>> Just to expand on this a little: it's not clear that we could do this
>> even if we wanted to. Given an arbitrary .o file, we can't tell (a)
>> if it is a compiled Haskell module and (b) if so, where its .hi file
>> can be found. We can make guesses, but there isn't a general
>> solution.
>
> the only .o files you're interested in are those you've created, no?
>
> so you could add that information to the .o file - but the .hi file
> might have disappeared. however, the original question was about
> finding required packages in the linking step, with only some .o file
> at hand.
>
> so you could add info about required packages in the object file,
> say as the value of some hidden default symbol, or as an unresolved
> reference to a hidden symbol provided by the package. if, in the first
> case, the <GHCrequired_packages> symbol doesn't exist or if, in the
> second case, there's no reference to a <GHCprovides_package_P>
> symbol, you know its not one of your object files, so it shouldn't
> depend on your packages, should it?
Yes, both of these are good ideas. However, they both require noodling
in object files of course, which is non-portable. Or perhaps creative
use of 'nm' or 'objdump' would do.
In any case, I think we already arrived at a reasonable solution...
Cheers,
Simon
_______________________________________________
Glasgow-haskell-bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs