-split-objs and --make together?

Dimitry Golubovsky dimitry at golubovsky.org
Fri Jul 29 00:09:58 EDT 2005


Is it possible to use --make when one or more of modules involved are split?

I tried this with ghc 6.2.2

I do the following (doesn't work)

Suppose we have syscall.hs and UNISTD_H.hs: the first contains Main and 
imports UNISTD_H, and the second is to be split.

         mkdir UNISTD_H_split
         ghc -c -split-objs UNISTD_H.hs
         ar cq libUNISTD_H.a UNISTD_H_split/*.o

I get the library and the  .hi file: no .o file

        ghc --make syscall.hs libUNISTD_H.a -o syscall

It tries to recompile UNISTD_H.hs because there is no UNISTD_H.o, and 
links against the object file, not the library

When I try

        ghc syscall.hs libUNISTD.a -o syscall

it works, and only syscall.hs is recompiled, but I cannot use --make.

I tried to name the library UNISTD_H.a, same result.

Is it possible to get ghc recognize the library same way as if it were 
an object file (which corresponds to the interface file) and use --make?

PS1 This is for that experiment with hsffig when the header file 
contains functions undefined in the default glibc. Linking against the 
library with split objs works fine, and executable size is much smaller, 
and unresolved references are gone. Only ability to use --make is 
missing here.

PS2 It would be nice if the perl script splitting the assembler code 
also created the directory where the split object files go.

Dimitry Golubovsky
Middletown, CT



More information about the Glasgow-haskell-users mailing list