[m-rev.] diff: fix bug with mmc --make and static libraries

Julien Fischer juliensf at csse.unimelb.edu.au
Tue Oct 24 17:58:43 AEST 2006


On Tue, 24 Oct 2006, Julien Fischer wrote:

> Index: compiler/make.program_target.m
> ===================================================================
> RCS file: 
> /home/mercury/mercury1/repository/mercury/compiler/make.program_target.m,v
> retrieving revision 1.53
> diff -u -r1.53 make.program_target.m
> --- compiler/make.program_target.m	15 Oct 2006 23:26:45 -0000	1.53
> +++ compiler/make.program_target.m	24 Oct 2006 03:31:35 -0000
> @@ -340,7 +340,7 @@
>     % Report errors if any of the extra objects aren't present.
>     list.map_foldl2(dependency_status,
>         list.map((func(F) = dep_file(F, no)), ObjectsToCheck),
> -        ExtraObjStatus, !Info, !IO),
> +            ExtraObjStatus, !Info, !IO),
>
>     DepsResult3 =
>         ( list.member(deps_status_error, ExtraObjStatus) ->
> @@ -1102,7 +1102,20 @@
> maybe_install_library_file(Linkage, FileName, InstallDir, Succeeded, !IO) :-
>     globals.io_lookup_accumulating_option(lib_linkages, LibLinkages, !IO),
>     ( list.member(Linkage, LibLinkages) ->
> -        install_file(FileName, InstallDir, Succeeded, !IO)
> +        install_file(FileName, InstallDir, Succeeded0, !IO),
> +        %
> +        % We need to update the archive index after we copy a .a file to
> +        % the installation directory because the linkers on some OSs
> +        % complain if we don't.
> +        %
> +        (
> +            Linkage = "static",
> +            Succeeded0 = yes
> +        ->
> +            generate_archive_index(FileName, InstallDir, Succeeded, !IO)

The above line is incorrect, since FileName is directory qualified.  I've
made the following correction.

 	BaseFileName = dir.det_basename(FileName),
 	generate_archive_index(BaseFileName, InstallDir, Succeeded, !IO)

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



More information about the reviews mailing list