gm2
[Top][All Lists]
Advanced

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

Re: [Gm2] Bootstrapping GM2 on MacOSX Panther


From: Gaius Mulley
Subject: Re: [Gm2] Bootstrapping GM2 on MacOSX Panther
Date: 15 Mar 2005 16:03:48 +0000
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Ed Smith-Rowland <address@hidden> writes:

> I am trying to bootstrap the gcc-3.3.4 + gm2 combo on Mac OS X
> 10.3.8.

excellent!

> This is a BSDish system.
> 
> I managed to hack my way through several build problems (which I'll
> explain later) I came to this one that I don't know how to get around:
> ------------8<------------------8<---------------------8<----------------------8<-----------------------------------------------------------
> gcc   -g -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes
> -Wmissing-prototypes    -DHAVE_CONFIG_H  -o stage1/gm2/gm2lcc \
>               gm2/gm2-compiler-boot/gm2lcc_init.o \
>               gm2/gm2-compiler-boot/gm2lcc.o
> gm2/gm2-compiler-boot/gm2.a gm2/gm2-libs-boot/libgm2.a
> gm2/p2c/p2c-src/src/libp2c.a                     ./intl/libintl.a
> -liconv  ../libiberty/libiberty.a
> gm2/boot-bin/mklink -s -exit
> ../../gcc-3.3.4+gm2-20041222/gcc/gm2/init/gm2linit
> mv mod_init.c gm2/gm2-compiler-boot/gm2l_init.c
> gcc -c -g gm2/gm2-compiler-boot/gm2l_init.c -o
> gm2/gm2-compiler-boot/gm2l_init.o
> gcc   -g -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes
> -Wmissing-prototypes    -DHAVE_CONFIG_H  -o stage1/gm2/gm2l \
>               gm2/gm2-compiler-boot/gm2l_init.o \
>               gm2/gm2-compiler-boot/m2flex.o \
>               gm2/gm2-compiler-boot/gm2l.o gm2/gm2-compiler-boot/gm2.a
> gm2/gm2-libs-boot/libgm2.a gm2/p2c/p2c-src/src/libp2c.a
> ./intl/libintl.a  -liconv  ../libiberty/libiberty.a
> ld: Undefined symbols:
> _M2Reserved_NulName
> make[3]: *** [stage1/gm2/gm2l] Error 1
> cp: stage2/gm2/gm2lcc: No such file or directory
> make[2]: *** [gm2lcc] Error 1
> make[1]: *** [stage2_build] Error 2
> make: *** [bootstrap] Error 2
> ------------8<------------------8<---------------------8<----------------------8<-----------------------------------------------------------
> 


> I can grep for M2Reserved_Nul and found no references to it in the
> source directory but found several *.h and *.c references in my build
> directory.  Here are declarations:
> 
> ------------8<------------------8<---------------------8<----------------------8<-----------------------------------------------------------
> MacOSX:~/gcc/obj-3.3.4+gm2-20041222 ed$ find ../obj-3.3.4+gm2-20041222
> -name \*.h -exec grep M2Reserved_Nul {} \;
> vextern unsigned int M2Reserved_NulName, M2Reserved_NulTok,
> vextern unsigned int M2Reserved_NulName, M2Reserved_NulTok,
> ------------8<------------------8<---------------------8<----------------------8<-----------------------------------------------------------

ok this looks correct. Basically the Modula-2 compiler is translated
into C (this C source is placed into the build directory) as you
discovered. The M2Reserved_NulName is held inside the file

  vextern unsigned int M2Reserved_NulName, M2Reserved_NulTok,
  build-dir/gcc/gm2/gm2-compiler-boot/GM2Reserved.h

> What should the value of this variable be?  Where is it defined?

which declares it as an unsigned integer. But the vextern is #defined
to nothing when we compile M2Reserved.c (thus declaring the variable
in this module) whereas when other modules include GM2Reserved.h
vextern is declared `extern'.

It maybe that this mechanism is failing. Can email me the result
of a:

    find . -name 'M2Reserved.o' -exec nm {} \; -print

in your build directory? You should see:

00000000 t AddKeyword
0000003e t Init
00000004 C M2Reserved_AmbersandTok
00000004 C M2Reserved_AndTok
00000004 C M2Reserved_ArrayTok
00000004 C M2Reserved_AsmTok
00000004 C M2Reserved_AttributeTok
00000004 C M2Reserved_BarTok
00000004 C M2Reserved_BecomesTok
00000004 C M2Reserved_BeginTok
00000004 C M2Reserved_BuiltinTok
00000004 C M2Reserved_ByTok
00000004 C M2Reserved_CaseTok
00000004 C M2Reserved_ColonTok
00000004 C M2Reserved_CommaTok
00000004 C M2Reserved_ConstTok
00000004 C M2Reserved_DateTok
00000004 C M2Reserved_DefinitionTok
00000004 C M2Reserved_DivTok
00000004 C M2Reserved_DivideTok
00000004 C M2Reserved_DoTok
00000004 C M2Reserved_DoubleQuotesTok
00000004 C M2Reserved_ElseTok
00000004 C M2Reserved_ElsifTok
00000004 C M2Reserved_EndTok
00000004 C M2Reserved_EofTok
00000004 C M2Reserved_EqualTok
00000004 C M2Reserved_ExitTok
00000004 C M2Reserved_ExportTok
00000004 C M2Reserved_FileTok
00000004 C M2Reserved_ForTok
00000004 C M2Reserved_FromTok
00000004 C M2Reserved_GreaterEqualTok
00000004 C M2Reserved_GreaterTok
00000004 C M2Reserved_HashTok
00000004 C M2Reserved_IfTok
00000004 C M2Reserved_ImplementationTok
00000004 C M2Reserved_ImportTok
00000004 C M2Reserved_InTok
00001098 T M2Reserved_IsReserved
00000004 C M2Reserved_LCBraTok
00000004 C M2Reserved_LParaTok
00000004 C M2Reserved_LSBraTok
00000004 C M2Reserved_LessEqualTok
00000004 C M2Reserved_LessGreaterTok
00000004 C M2Reserved_LessTok
00000004 C M2Reserved_LineTok
00000004 C M2Reserved_LoopTok
00000004 C M2Reserved_MinusTok
00000004 C M2Reserved_ModTok
00000004 C M2Reserved_ModuleTok
00000004 C M2Reserved_NotTok
00000004 C M2Reserved_NulName
00000004 C M2Reserved_NulTok
00000004 C M2Reserved_OfTok
00000004 C M2Reserved_OrTok
00000004 C M2Reserved_PeriodPeriodTok
00000004 C M2Reserved_PeriodTok
00000004 C M2Reserved_PlusTok
00000004 C M2Reserved_PointerTok
00000004 C M2Reserved_ProcedureTok
00000004 C M2Reserved_QualifiedTok
00000004 C M2Reserved_RCBraTok
00000004 C M2Reserved_RParaTok
00000004 C M2Reserved_RSBraTok
00000004 C M2Reserved_RecordTok
00000004 C M2Reserved_RepeatTok
00000004 C M2Reserved_ReturnTok
00000004 C M2Reserved_SemiColonTok
00000004 C M2Reserved_SetTok
00000004 C M2Reserved_SingleQuoteTok
00000004 C M2Reserved_ThenTok
00000004 C M2Reserved_TimesTok
00000004 C M2Reserved_ToTok
00000004 C M2Reserved_TypeTok
00000004 C M2Reserved_UnQualifiedTok
00000004 C M2Reserved_UntilTok
00000004 C M2Reserved_UpArrowTok
00000004 C M2Reserved_VarTok
00000004 C M2Reserved_VolatileTok
00000004 C M2Reserved_WhileTok
00000004 C M2Reserved_WithTok
000010ec T M2Reserved_tokToTok
         U NameKey_MakeKey
00000004 b NameTotok
         U SymbolKey_GetSymKey
         U SymbolKey_InitTree
         U SymbolKey_PutSymKey
00001108 T _M2_M2Reserved_init
00000000 b _was_initialized.0
00000008 b tokToName
./gcc/gm2/gm2-compiler-boot/M2Reserved.o

indicating that M2Reserved_NulName is declared in this file.

Hope this helps,

Gaius




reply via email to

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