[m-users.] Can I put the C standalone interface object file in the mercury library

Julien Fischer jfischer at opturion.com
Fri Sep 14 12:00:10 AEST 2018


Hi Charles,

On Thu, 13 Sep 2018, Charles Shuller wrote:

> Sorry I wasn't clear enough. 
> 
> I wasn't trying to suggest a change to mmc, just find out if I was
> about to do something that would cause intermittent faults, random
> link errors or something else irritating.

In princple, it should be fine.  In practice, I'm not aware of anyone
having tried it.

Cheers,
Julien.

> On Thu, Sep 13, 2018 at 8:38 PM Julien Fischer <jfischer at opturion.com> wrote:
>
>       Hi Charles,
>
>       On Thu, 13 Sep 2018, Charles Shuller wrote:
>
>       > It seems like it would be a bit nicer if the standalone interface
>       > object file were added to the mercury library by doing something
>       > like: 
>       >
>       >     ar rs libmercury_lib.a libmercury_lib_interface.o
>       >
>       > Will this break something??  It's not clear to me if the interface is
>       > kept separate for a good reason or if it just happens to have been
>       > implemented that way.
>
>       You are assuming that there is a library in to which the object file
>       could be included being built at the same time as the standalone
>       interface.  While that's true in your case and in the example from
>       the samples directory, it isn't neccesarily true in general; the set
>       of libraries for which a standlone interface is being generated may
>       have alredy been built.
>
>       That said, it would probably be possible to addtionally support
>       something along the lines of
>
>           $ mmc --include-standalone-interface --make libmylib
>
>       which would cause the compiler to build the library, generate the
>       standalone interface and then include it in the archive or shared
>       object.
>
>       Julien.
> 
> 
>


More information about the users mailing list