logo       

RE: Bug#171518: ghc --make does not play nice with FFI wrapper: msg#00012

lang.haskell.glasgow.bugs

Subject: RE: Bug#171518: ghc --make does not play nice with FFI wrapper

> Package: ghc5
> Version: 5.04-1
> Severity: normal
>
> I have a module SDL.Bare.Audio with this declaration:
>
> foreign import ccall safe "wrapper"
> mkSDL_AudioSpec_Callback :: SDL_AudioSpec_Callback u ->
> IO (FunPtr (SDL_AudioSpec_Callback u))
>
> When compiling Audio.hs, this results in the creation and compilation
> of Audio_stub.c.
>
> Unfortunately, if I'm using ghc --make, if it decides to skip
> compilation
> of Audio.hs, it never realizes that it also needs to link in
> Audio_stub.o,
> causing this failure at the end:
>
> ghc: linking ...
> build/Audio.o(.text+0x89): In function `s3Fk_ret':
> : undefined reference to `SDLziBareziAudio_d3K2'
> collect2: ld returned 1 exit status

Thanks, this is indeed a bug. The code to look for the stub file
exists, but it was looking for foo.stub_o rather than foo_stub.o
(d'oh!).

Cheers,
Simon


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise