gm2
[Top][All Lists]
Advanced

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

Re: [Gm2] Building gm2-4.7.3 on MacOS 10.5.8/PPC


From: Gaius Mulley
Subject: Re: [Gm2] Building gm2-4.7.3 on MacOS 10.5.8/PPC
Date: Thu, 04 Sep 2014 10:16:56 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux)

john o goyo <address@hidden> writes:

> On 02/09/2014 21:59, john o goyo wrote:
>> On 01/09/2014 05:11, Gaius Mulley wrote:
>>> john o goyo<address@hidden> writes:
>>>
>>>> The release of 2014-08-30 now passed CFLAGS down to the gm2 area and
>>>> builds p2c but then fails to build ppg because it found no main().
>>>>
>>>> Where is the main() associated with ppg?
>>>
>>> Hi John,
>>>
>>> inside mod_init.c, it is built by the rule in:
>>>
>>> gcc-4.7.3+gm2-git-latest/gm2/gcc-versionno/gcc/gm2/Make-lang.in:2267
>>>
>>> could it be that say mklink also failed to build and is not creating
>>> the mod_init.c file correctly (empty file?)
>>
>> The file mod_init.c is in gcc/gm2 and contains main(). It is also
>> compiled and _main is in mod_init.o. Where is ppg actually linked
>> so that I may examine the list of objects modules included?
>
> Further to the above, I found the building script in gm2/Make-lang.in:
>
> gm2/ppg$(exeext): gm2/p2c/p2c-src/src/libp2c.a gm2/boot-bin/mklink
> gm2/boot-bin/p2c \
>      gm2/gm2-libs-boot/libgm2.a
> $(GM2-PPG-MODS:%.mod=gm2/gm2-compiler-boot/%.o) \
>      gm2/gm2-compiler-boot/ppg.o
>         $(QUIAT)echo "building gm2/ppg" ; \
>         if [ -f gm2/ppg$(exeext) ] ; then \
>             echo "hmm already built" ; \
>         fi ; \
>         cd gm2 ; \
>         ../$(M2LINK) -s ../$(srcdir)/gm2/init/ppginit ; \
>         $(CC) $(CFLAGS) -c mod_init.c -o mod_init.o ; \
>         M2PATH=". gm2-libs-boot gm2-compiler-boot" ; export M2PATH ; \
>         ../$(M2LINK) -l --lib p2c/p2c-src/src/libp2c.a --lib
> ../../libiberty/safe-ctype.o ../$(srcdir)/gm2/init/ppginit ; \
>         $(SHELL) linkcommand ; \
>         $(RM) linkcommand ; \
>         if [ -x a$(exeext) ] ; then \
>             mv a$(exeext) ppg$(exeext) ; \
>         elif [ -x a.out ] ; then \
>             mv a.out ppg$(exeext) ; \
>         else \
>             echo "failed to link $@" ; \
>             exit 1; \
>         fi
>
> Now mod_init.o is there but could you please explain the linking
> instructions above?  A grep for linkcommand found nothing that I understood.
>

Hi John,

sure, the program $(M2LINK) takes as input ../$(srcdir)/gm2/init/ppginit
which is a list of module names.  It searches the $(M2PATH) to find each
modulename.o or modulename.a and generates a file 'linkcommand' (in the
build directory) which is a small script 'gcc list of module names '
with the additional libraries (p2c/p2c-src/src/libp2c.a and
../../libiberty/safe-ctype.o).

Notice that $(M2LINK) with the -s option will generate the source
for mod_init.c.  Whereas with the -l option generates the linkcommand.
I think a good change would be to split this rule into smaller rules
and no longer use 'mod_init.c' but rather a program specific name.
Hope this helps.

regards,
Gaius



reply via email to

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