[mercury-users] try_io on x86-64

Julien Fischer juliensf at csse.unimelb.edu.au
Sat Oct 10 16:35:34 AEDT 2009


Hi Michael,

On Fri, 9 Oct 2009, Michael Day wrote:

>> Mercury is primarily developed on Linux x86-64 systems these days; we
>> haven't noticed any problems with try_io.
>
> I can reproduce the bug with the program below and rotd-2008-01-30, but only 
> when building with some optimisations enabled:
>
> $ mmc --make try -O3 --intermodule-optimisation
> Mercury/os/try.o:(.rodata+0x310): undefined reference to `<predicate 
> 'exception.wrap_success_or_failure'/2 mode 0>'
> collect2: ld returned 1 exit status
>
> --------------------------------
> :- module try.
>
> :- interface.
>
> :- import_module io.
>
> :- pred main(io, io).
> :- mode main(di, uo) is cc_multi.
>
> :- implementation.
>
> :- import_module int, exception.
>
> main(!IO) :-
>    try_io(test, Res, !IO),
>    write(Res, !IO), nl(!IO).
>
> :- pred test(int, io, io).
> :- mode test(out, di, uo) is det.
>
> test(17, !IO).
> --------------------------------
>
> Can you see if this error still manifests in the latest version?

I tried the above program on three of our machines using all
combinations of the grades installed on the machines,
--intermodule-optimisation/--no-intermodule-optimization, -O[0-6],
--linkage static** / shared.

(** Except on Mac OS X, where --linkage static doesn't work due to the
static versions of the system libs not be installed by default; I tried
--mercury-linkage static here though.)

This was with rotd-2009-10-0{8,9}.

The machines and GCC versions were:

    i686-pc-linux-gnu, gcc 3.4
    i686-apple-darwin9.8.0, gcc 4.0
    x86_64-unknown-linux-gnu, gcc 3.4

The only problem I can report is that you can no longer use "try" as a
module name; otherwise everything worked.

Cheers,
Julien.
--------------------------------------------------------------------------
mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the users mailing list