hs-plugins: dynamic linking error with .ctors section

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

hs-plugins: dynamic linking error with .ctors section

Cyril Schmidt
I am using hs-plugins to load some Haskell modules dynamically.
It all goes well until I try to load a module that uses a package
with some C++ code in the implementation.

The module in question, A.hs, uses a package named RGPack, which
consists of some C++ code and a single Haskell module that provides
the necessary `foreign import' declarations. The package (including
the C++ code) is built by GHC.

When I try to load A.hs using hs-plugins, I get the following error:
Unknown PEi386 section name `.ctors' (while processing: C:\Program
Files\Haskell\RGPack-0.0\ghc-6.4.2/HSRGPack-0.0.o)

When I link A.hs statically (using `import A' in my main module),
it works fine.

I am fairly sure that the problem is somehow related to the usage
of the C++ code in the package (because .ctors section is C++-specific),
but I have no idea how I can remedy this. Rewriting the C++ code to
pure C is an obvious workaround, but I'd prefer to try something else
before I resort to this ;-)

For the record, I use GHC 6.4.2 on Windows, hs-plugins-1.0-rc0.

I will greatly appreciate any hints.

Cheers,

Cyril

_______________________________________________
Libraries mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/libraries
Reply | Threaded
Open this post in threaded view
|

Re: hs-plugins: dynamic linking error with .ctors section

Esa Ilari Vuokko
On 10/18/06, Cyril Schmidt <[hidden email]> wrote:

> I am using hs-plugins to load some Haskell modules dynamically.
> It all goes well until I try to load a module that uses a package
> with some C++ code in the implementation.
>
> The module in question, A.hs, uses a package named RGPack, which
> consists of some C++ code and a single Haskell module that provides
> the necessary `foreign import' declarations. The package (including
> the C++ code) is built by GHC.
>
> When I try to load A.hs using hs-plugins, I get the following error:
> Unknown PEi386 section name `.ctors' (while processing: C:\Program
> Files\Haskell\RGPack-0.0\ghc-6.4.2/HSRGPack-0.0.o)

I think this is fixed in ghc 6.6.  There probably isn't a workaround
without recompiling ghc from source (and fixing Linker.c in rts-dir.)

Best regards,
--Esa
_______________________________________________
Libraries mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/libraries
Reply | Threaded
Open this post in threaded view
|

Re: hs-plugins: dynamic linking error with .ctors section

Cyril Schmidt
Thanks!

I'll upgrade as soon as I can.

Regards,

Cyril

>> When I try to load A.hs using hs-plugins, I get the following error:
>> Unknown PEi386 section name `.ctors' (while processing: C:\Program
>> Files\Haskell\RGPack-0.0\ghc-6.4.2/HSRGPack-0.0.o)
>
> I think this is fixed in ghc 6.6.  There probably isn't a workaround
> without recompiling ghc from source (and fixing Linker.c in rts-dir.)
>
> Best regards,
> --Esa
>

_______________________________________________
Libraries mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/libraries
Reply | Threaded
Open this post in threaded view
|

Re[2]: hs-plugins: dynamic linking error with .ctors section

Bulat Ziganshin-2
In reply to this post by Esa Ilari Vuokko
Hello Esa,

Wednesday, October 18, 2006, 1:42:49 PM, you wrote:

>> When I try to load A.hs using hs-plugins, I get the following error:
>> Unknown PEi386 section name `.ctors' (while processing: C:\Program
>> Files\Haskell\RGPack-0.0\ghc-6.4.2/HSRGPack-0.0.o)

> I think this is fixed in ghc 6.6.  There probably isn't a workaround
> without recompiling ghc from source (and fixing Linker.c in rts-dir.)

and this problem was not fixed in 6.4 branch?


--
Best regards,
 Bulat                            mailto:[hidden email]

_______________________________________________
Libraries mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/libraries
Reply | Threaded
Open this post in threaded view
|

Re: hs-plugins: dynamic linking error with .ctors section

Cyril Schmidt
In reply to this post by Cyril Schmidt
Indeed, the code works when compiled by GHC 6.6.

Cheers,

Cyril

Cyril Schmidt wrote:
>>> When I try to load A.hs using hs-plugins, I get the following error:
>>> Unknown PEi386 section name `.ctors' (while processing: C:\Program
>>> Files\Haskell\RGPack-0.0\ghc-6.4.2/HSRGPack-0.0.o)

Esa Ilari Vuokko wrote:
>> I think this is fixed in ghc 6.6.  There probably isn't a workaround
>> without recompiling ghc from source (and fixing Linker.c in rts-dir.)
>>
>> Best regards,
>> --Esa

_______________________________________________
Libraries mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/libraries