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

Re: [microblaze-uclinux] C++ and mb-gcc



C++ is not yet fully supported with the microBlaze compiler.   In particular the global constructors
don't work.  Answer record 19897 describes this.   I can't say if EDK 7.1 will change this, but I
suspect not.

John


Stefano Capaccio wrote:

> Hi,
>
> I know that there has been a short discussion regarding C++ support
> unde uClinux, and I wish to find out if anybody has got any further?
>
> We're developing on the Microblaze, using the Xilinx ported GNU tools
> (mb-gcc etc) and are using the xilkernel as a light weight OS.
>
> The problems we seem to be having I think are related to the compiler,
> thus it seems that instructions are being created incorrectly (see
> below).  In addition, when using initially the string class, and
> mapping malloc() to something useful, none of the methods are
> implemented (i.e. ->assign, ->c_str etc).
>
> Is this something that is known as "future work", is it something
> Xilinx related, is it completely new or is there something we can do
> to ensure that the tools behave themselves?
>
> Thanks,
>
> Stef
>
> ======
>
> Source:
>
> if (at_end)
> {
>         ... code ...
> }
> // FIX:START
> // Works with 2+ nop
> asm("nop;nop;nop;");
> // FIX:END
>
> With 3 NOPS
> +++++++++++
>
> 8000bc48:       80000000        or      r0, r0, r0
> /* Strange branch instruction here.  Never changes from
> /* 0x8000bc98 ...
> 8000bc4c:       bc1d004c        beqi    r29, 76         // 8000bc98
> 8000bc50:       b0008000        imm     -32768
> ...
> 8000bc88:       80000000        or      r0, r0, r0
> 8000bc8c:       f8730020        swi     r3, r19, 32
> -> NOP? 8000bc90:       80000000        or      r0, r0, r0
> -> NOP? 8000bc94:       80000000        or      r0, r0, r0
> /* Branch from 0x8000bc4c to here...
> -> NOP  8000bc98:       80000000        or      r0, r0, r0
> 8000bc9c:       b0008000        imm     -32768
> 8000bca0:       30a0bd90        addik   r5, r0, -17008
>
> With 2 NOPS
> +++++++++++
>
> 8000bc48:       80000000        or      r0, r0, r0
> /* Here's that branch instruction again.  Still 0x8000bc98 ...
> 8000bc4c:       bc1d004c        beqi    r29, 76         // 8000bc98
> 8000bc50:       b0008000        imm     -32768
> ...
> 8000bc88:       80000000        or      r0, r0, r0
> 8000bc8c:       f8730020        swi     r3, r19, 32
> -> NOP? 8000bc90:       80000000        or      r0, r0, r0
> -> NOP? 8000bc94:       80000000        or      r0, r0, r0
> /* Branch to here this time...
> 8000bc98:       b0008000        imm     -32768
> 8000bc9c:       30a0bd88        addik   r5, r0, -17016
> 8000bca0:       b9f48770        brlid   r15, -30864     // 80004410 <printf>
>
> With 1 NOP
> ++++++++++
>
> 8000bc48:       80000000        or      r0, r0, r0
> /* Here's that branch instruction again.  Still 0x8000bc98 ...
> 8000bc4c:       bc1d004c        beqi    r29, 76         // 8000bc98
> 8000bc50:       b0008000        imm     -32768
> ...
> 8000bc88:       80000000        or      r0, r0, r0
> 8000bc8c:       f8730020        swi     r3, r19, 32
> -> NOP? 8000bc90:       80000000        or      r0, r0, r0
> 8000bc94:       b0008000        imm     -32768
> /* Branch to here this time... same address different instruction
> 8000bc98:       30a0bd88        addik   r5, r0, -17016
> 8000bc9c:       b9f48774        brlid   r15, -30860     // 80004410 <printf>
>
> ___________________________
> microblaze-uclinux mailing list
> microblaze-uclinux@itee.uq.edu.au
> Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
> Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/

--
   ___  ___
  /   ^/  /\
 /___/ \ /  John McCluskey                 Xilinx Inc.
 \   \  v   6600 TransCanada Highway #415  Field Apps Engineer
  \   \     Pointe Claire, PQ  H9R 4S2     Phone: (514) 426-2770
  /   /     CANADA
 /___/  ^   E-Mail Address:                john.mccluskey@xilinx.com
 \   \ / \  Applications Hotline:          (800) 255-7778
  \___v\__\/



___________________________
microblaze-uclinux mailing list
microblaze-uclinux@itee.uq.edu.au
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/