Can build gcc-2.95.3 with g++ for m68k-coff ... Yeah !!!!

Delarue Christophe cdelarue@e-generis.com
Thu Feb 14 05:14:00 GMT 2002


> You may look@the following message in this thread:

> <3C63C15E.BDCD6865@luukku.com>

> Wolfgang

I haven't find within this thread <3C63C15E.BDCD6865@luukku.com> to make what
I've done (may be I missed something, this is a little bit to difficult for me)
... or I am not a guru enough patch the original code to produce what I've
done.

I think that the ``startfile'' options is usefull to help having something from
scratch. In fact we have allready a full running programm that runs with a
Microtec C++ compiler, (thus the _start to main and bzero the memory is
allready done) ...

(I use a HOST=sparc-sun-solaris2.6 TARGET=m68k-coff)


I change my gcc/specs file  so that the nostartfiles disappear from the specs file :
> -------------- specs file --------
> *link_command:
> %{!fsyntax-only:  %{!c:%{!M:%{!MM:%{!E:%{!S:%(linker) %l %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n}                        %{r} %{s} %{t} %{u*} %{x} %{z} %{Z}                     %{!A:%{!nostdlib:%{!nostartfiles:%S}}}                  %{static:} %{L*} %D %o                  %{!nostdlib:%{!nodefaultlibs:%G %L %G}}                 %{!A:%{!nostdlib:%{!nostartfiles:%E}}}                  %{T*}
>  }}}}}}
> --------------

---------------------------------
  *link_command:
! %{!fsyntax-only:  %{!c:%{!M:%{!MM:%{!E:%{!S:%(linker) %l %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n}                      %{r} %{s} %{t} %{u*} \
%{x} %{z} %{Z} %{static:} %{L*} %D %o                      %{!nostdlib:%{!nodefaultlibs:%G %L %G}} %{T*}
   }}}}}}
-----------------------------------

I remove !A:%{!nostdlib:%{!nostartfiles:%S}}} and %{!A:%{!nostdlib:%{!nostartfiles:%E}}} 

With that modification a gcc hello-world.cc -o hello-world -lstdc++ -lc link
without any complain. 

Now a with a:
cd build-gcc
make
this makes the configure found m68k-coff-gcc able to generate a executable. It
compile the whole rest of libiberty well, and the libstdc++ is ranlibed !!!

Just a point : vsprintf does not compile :

diff -c /home/export/delarue/gcc-2.95.3/gcc-2.95.3/libiberty/vsprintf.c.orig /home/export/delarue/gcc-2.95.3/gcc-2.95.3/libiberty/vsprintf.c
*** /home/export/delarue/gcc-2.95.3/gcc-2.95.3/libiberty/vsprintf.c.orig        Thu Feb 14 12:37:51 2002
--- /home/export/delarue/gcc-2.95.3/gcc-2.95.3/libiberty/vsprintf.c     Thu Feb 14 12:50:07 2002
***************
*** 39,53 ****
  {
    FILE b;
    int ret;
! #ifdef VMS
!   b->_flag = _IOWRT|_IOSTRG;
!   b->_ptr = buf;
!   b->_cnt = 12000;
! #else
!   b._flag = _IOWRT|_IOSTRG;
!   b._ptr = buf;
!   b._cnt = 12000;
! #endif

    ret = _doprnt(format, ap, &b);
    putc('\0', &b);
--- 39,57 ----
  {
    FILE b;
    int ret;
! /*  #ifdef VMS */
! /*    b->_flag = _IOWRT|_IOSTRG; */
! /*    b->_ptr = buf; */
! /*    b->_cnt = 12000; */
! /*  #else */
! /*    b._flag = _IOWRT|_IOSTRG; */
! /*    b._ptr = buf; */
! /*    b._cnt = 12000; */
! /*  #endif */
!
!   b._flags = __SWR | __SSTR;
!   b._bf._base = b._p = (unsigned char *) buf;
!   b._bf._size = b._w = 1200;

    ret = _doprnt(format, ap, &b);
    putc('\0', &b);

Diff finished at Thu Feb 14 12:50:20


I hope this is a valid hack. I take the code from the newlib part ...

With those modification I have a valid c++ compiler.

My next step is making to translate the mapping from C++ Microtec file to gnu.

If anybody as done that ... here is my exec.locate file :

-------------- exec.locate

CHIP    68000


* * * Code CCES 
*
* la premiere partie de la table des vecteurs (vector00) est mappee en 0x00
* la seconde partie de la table des vecteurs (vector01) est mappee en 0x100
* la zone des registres 0xF0-0xFF est protegee par RESMEM

RESMEM   $F0, $10


* tables des vecteurs d'IT dont les entrees pointent sur vector02
SECT     vector00 = $0
SECT     vector01 = $100
ORDER    vector00, vector01


* Sections Boot minimal 
SECT     BOOTVERS = $400
ORDER    BOOTVERS, BOOT_T, BOOT_S, BOOT_L, BOOT_C


* Partie modifiable lors d'un upgrade logiciel
SECT     CODEINFO = $4000
SECT     btext    = $4010
SECT     vector02 = $4010
SECT     SUITEBOOT= $4200
ORDER    btext, vector02, SUITEBOOT


* Suite de la partie modifiable lors d'un upgrade logiciel
ORDER    code, codeflash, initfini, const, literals, strings
ORDER    ehscfn, ehsftbl, S_codeAsmScoop, ROM_VARS, etext, ??INITDATA, dataio
ORDER    0, 10, 11, stack, heap, SYSHOST

SECT    12 = $B80000



* * * RAM carte CCES
*
* 

SECT     DEBUT_RAM = $C00000
ORDER    DEBUT_RAM, ANNUAIRE, RAM_SAVE, TRACESIG
ORDER    bdata, vars, edata, bbss, zerovars, ebss

* Zone reservee pour la pile uniquement a l'init SYSTEME
RESMEM   $C00000, $100

* Zone reservee pour l'identifiant de PABX
RESMEM   $003F80, $80

* Alignement TRACESIG sur 16 octets
ALIGNMOD TRACESIG,16


INITDATA vars


* * * Definitions d'adresses 
*
*
public	_systemIdAddress       = $003F80

public	_base                  = $B00000
public	_var_debug             = $B00000
public	_syst_config_reg       = $F0
public	_bulle                 = $A00000
public  _DEBUT_RAM_APPLI       = $C00000
public  _portExt3              = $A20000
public  _portStatus            = $A40000
public  _PAC_Registers         = $A80000


* Declarations de variables a utiliser pour la carte PAC R1 uniquement :
* (Elles definissent les fenetres memoires CCES pour chacun des slots PCMCIA)
public _PAC_BeginAddressSlotA  = $800000
public _PAC_EndAddressSlotA    = $8FFFFF
public _PAC_BeginAddressSlotB  = $900000
public _PAC_EndAddressSlotB    = $9FFFFF
 

* Infos relatives a la carte PCMCIA
public _ccesCodeInfo           = $004000
public _UpgradeSoftwareAddress = $004010
public _ccesBootInfo           = $C00200
public _BootStrapAddress       = $C00400

-------------- end exec.locate

-- 
Christophe DELARUE        E-Generis
Tel.: (+33) 299 842052    Fax.: (+33) 299 639331
13, sq. du Chene Germain / 35510 Cesson-Sevigne / France
mailto:cdelarue@e-generis.com

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com



More information about the crossgcc mailing list