[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gm2] minor changes to the linker

From: Gaius Mulley
Subject: [Gm2] minor changes to the linker
Date: Fri, 06 Oct 2017 16:23:06 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)


I thought I'd post a message about some changes which are in the process
of being tested on the master branch.  I've been experimenting with
automake and gm2 and found that during linking automake wants to pass
all objects to gm2 for linking.

This causes the command line program gm2 to try to link in an object
twice - once when it resolves the module dependencies to generate an
ordered list of module for linking and once when automake passes the .o
file to gm2.  I think it would be sensible to change gm2 to resolve the
redundancy.  gm2 will only include object files obtained from the
module dependency tree if they are not present on the command line.

I can't see any disadvantage to this approach - it is backwards
compatible and it works effortlessly with automake.  As an example here
is the for the gnu modula-2 maze demo:

bin_PROGRAMS = rndmap

rndmap_SOURCES = AdvMap.mod Chance.mod Geometry.mod MakeBoxes.mod \
                 MapOptions.mod RoomMap.mod StoreCoords.mod \
                 WriteMap.mod BoxMap.mod GetOpt.mod Map.mod \
                 Options.mod getopt.c

rndmap_LINK = gm2 -g -I$(srcdir) $(srcdir)/Map.mod -o $@

        gm2 -I$(srcdir) -fm2-g -g -c $<
So far it has been implemented on the master branch - I hope to backport
it to gm2-6.4.0-gcc etc in due course,


reply via email to

[Prev in Thread] Current Thread [Next in Thread]