Skip to contentSkip to conversation

uboot on microblaze, compilation error

U-Boot Horst Gall 4 participants 15 messages Mar 17, 2010 – Mar 22, 2010

lore
Share & tools
lore

Horst Gall

author
#0 lore raw

Hi,

I try to compile an actual version of u-boot for xilinx microblaze. The linker ends with the error-message:

    ... mb-ld.real:u-boot.lds:1: parse error

In u-boot main-directory I found the file 'u-boot.lds':

    OUTPUT_ARCH(1)
    ENTRY(_start)
    ...
    cpu/1/start.o (.text)
    ...

When I change the "1" to "microblaze" it works:

    OUTPUT_ARCH(microblaze)
    ENTRY(_start)
    ...
    cpu/microblaze/start.o (.text)
    ...

After "make ...config" my modification is overwritten. How can I fix this problem?

Best regards
Horst Gall

#1 lore raw

Dear "Horst Gall",

Quoted 8 lines · In message <001701cac601$5a380c50$c801a8c0@xeon> you wrote:

I try to compile an actual version of u-boot for xilinx microblaze. The linker ends with the error-message:

    ... mb-ld.real:u-boot.lds:1: parse error

In u-boot main-directory I found the file 'u-boot.lds':

Quoted 7 lines
    OUTPUT_ARCH(1)
    ENTRY(_start)
    ...
    cpu/1/start.o (.text)
    ...

When I change the "1" to "microblaze" it works:

The linker script is run through the C preprocessor. Obviously your toolchain auto-defines "microblaze" as "1".

Quoted 1 line

How can I fix this problem?

Fix your toolchain. "microblaze" is not a reserved identified, and your toolchain is not supposed to mess with it.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Once they go up, who cares where  they  come  down?  That's  not  my
department."                                       - Werner von Braun
#2 lore raw
In reply to Horst Gall
Quoted 24 lines · On Wednesday 17 March 2010 14:36:38 Horst Gall wrote:

Hi,

I try to compile an actual version of u-boot for xilinx microblaze. The linker ends with the error-message:

    ... mb-ld.real:u-boot.lds:1: parse error

In u-boot main-directory I found the file 'u-boot.lds':

    OUTPUT_ARCH(1)
    ENTRY(_start)
    ...
    cpu/1/start.o (.text)
    ...

When I change the "1" to "microblaze" it works:

    OUTPUT_ARCH(microblaze)
    ENTRY(_start)
    ...
    cpu/microblaze/start.o (.text)
    ...
Quoted 2 lines

After "make ...config" my modification is overwritten. How can I fix this problem?

add "#undef microblaze" to the top of board/xilinx/microblaze-generic/u- boot.lds
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20100317/e3100f28/attachment.pgp

#3 lore raw
Quoted 25 lines · Mike Frysinger
Quoted 24 lines · On Wednesday 17 March 2010 14:36:38 Horst Gall wrote:

Hi,

I try to compile an actual version of u-boot for xilinx microblaze. The linker ends with the error-message:

    ... mb-ld.real:u-boot.lds:1: parse error

In u-boot main-directory I found the file 'u-boot.lds':

    OUTPUT_ARCH(1)
    ENTRY(_start)
    ...
    cpu/1/start.o (.text)
    ...

When I change the "1" to "microblaze" it works:

    OUTPUT_ARCH(microblaze)
    ENTRY(_start)
    ...
    cpu/microblaze/start.o (.text)
    ...
Quoted 5 lines
Quoted 2 lines

After "make ...config" my modification is overwritten. How can I fix this problem?

add "#undef microblaze" to the top of board/xilinx/microblaze-generic/u- boot.lds

Mike is right. I expect you are using toolchain from EDK where the problem is. Linux toolchain are ok.

Michal

Quoted 9 lines

-mike

------------------------------------------------------------------------

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Signature · 4 lines
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/
Microblaze U-BOOT custodian
#4 lore raw
Quoted 21 lines · On Thursday 18 March 2010 05:29:19 Michal Simek wrote:
Quoted 20 lines · Mike Frysinger
Quoted 19 lines · On Wednesday 17 March 2010 14:36:38 Horst Gall wrote:

I try to compile an actual version of u-boot for xilinx microblaze.

The linker ends with the error-message:

    ... mb-ld.real:u-boot.lds:1: parse error

In u-boot main-directory I found the file 'u-boot.lds':

    OUTPUT_ARCH(1)
    ENTRY(_start)
    ...
    cpu/1/start.o (.text)
    ...

When I change the "1" to "microblaze" it works:

    OUTPUT_ARCH(microblaze)
    ENTRY(_start)
    ...
    cpu/microblaze/start.o (.text)
    ...
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

After "make ...config" my modification is overwritten. How can I fix this problem?

add "#undef microblaze" to the top of board/xilinx/microblaze-generic/u- boot.lds

Mike is right. I expect you are using toolchain from EDK where the problem is. Linux toolchain are ok.

i dont think the toolchain is broken. this is standard gcc behavior for all arches. i would check the microblaze gcc port, but it doesnt seem to be mainlined at gcc.gnu.org, so ive lost interest.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20100318/1faf3d82/attachment.pgp

#5 lore raw
Quoted 24 lines · Mike Frysinger
Quoted 23 lines · On Thursday 18 March 2010 05:29:19 Michal Simek wrote:
Quoted 22 lines · Mike Frysinger
Quoted 21 lines · On Wednesday 17 March 2010 14:36:38 Horst Gall wrote:

I try to compile an actual version of u-boot for xilinx microblaze.

The linker ends with the error-message:

    ... mb-ld.real:u-boot.lds:1: parse error

In u-boot main-directory I found the file 'u-boot.lds':

    OUTPUT_ARCH(1)
    ENTRY(_start)
    ...
    cpu/1/start.o (.text)
    ...

When I change the "1" to "microblaze" it works:

    OUTPUT_ARCH(microblaze)
    ENTRY(_start)
    ...
    cpu/microblaze/start.o (.text)
    ...

After "make ...config" my modification is overwritten. How can I fix this problem?

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

add "#undef microblaze" to the top of board/xilinx/microblaze-generic/u- boot.lds

Mike is right. I expect you are using toolchain from EDK where the problem is. Linux toolchain are ok.

i dont think the toolchain is broken. this is standard gcc behavior for all arches. i would check the microblaze gcc port, but it doesnt seem to be mainlined at gcc.gnu.org, so ive lost interest.

Michael Eager takes care about. There is official updated branch at
http://gcc.gnu.org/viewcvs/branches/microblaze/
He is trying to add it to mainline repo but AFAIF he wasn't successful yet. I don't know how gcc community works but it seems to me a little closed.

Michal

Quoted 1 line

-mike

Signature · 4 lines
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/
Microblaze U-BOOT custodian
#6 lore raw
Quoted 36 lines · On Friday 19 March 2010 03:21:08 Michal Simek wrote:
Quoted 28 lines · Mike Frysinger
Quoted 27 lines · On Thursday 18 March 2010 05:29:19 Michal Simek wrote:
Quoted 25 lines · Mike Frysinger
Quoted 13 lines · On Wednesday 17 March 2010 14:36:38 Horst Gall wrote:

I try to compile an actual version of u-boot for xilinx microblaze.

The linker ends with the error-message:

    ... mb-ld.real:u-boot.lds:1: parse error

In u-boot main-directory I found the file 'u-boot.lds':

    OUTPUT_ARCH(1)
    ENTRY(_start)
    ...
    cpu/1/start.o (.text)
    ...

When I change the "1" to "microblaze" it works:

Quoted 8 lines
    OUTPUT_ARCH(microblaze)
    ENTRY(_start)
    ...
    cpu/microblaze/start.o (.text)
    ...

After "make ...config" my modification is overwritten. How can I fix this problem?

add "#undef microblaze" to the top of
board/xilinx/microblaze-generic/u- boot.lds

Quoted 6 lines
Quoted 2 lines

Mike is right. I expect you are using toolchain from EDK where the problem is. Linux toolchain are ok.

i dont think the toolchain is broken. this is standard gcc behavior for all arches. i would check the microblaze gcc port, but it doesnt seem to be mainlined at gcc.gnu.org, so ive lost interest.

Quoted 5 lines

Michael Eager takes care about. There is official updated branch at
http://gcc.gnu.org/viewcvs/branches/microblaze/
He is trying to add it to mainline repo but AFAIF he wasn't successful yet. I don't know how gcc community works but it seems to me a little closed.

a quick glance shows that it no longer defines "microblaze" ... or i missed it -mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20100319/de20be99/attachment.pgp

#7 lore raw
In reply to Mike Frysinger

Dear Mike Frysinger,

Quoted 3 lines · In message <[email protected]> you wrote:

i dont think the toolchain is broken. this is standard gcc behavior for all arches. ...

You are wrong here. It _is_ a bug of the toolchain if it auto-defines random unreserved identifiers. This is NOT standard GCC behaviour.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
An Elephant is a mouse with an Operating System.              - Knuth
#8 lore raw
Quoted 6 lines · On Sunday 21 March 2010 16:00:29 Wolfgang Denk wrote:
Quoted 2 lines · Mike Frysinger

i dont think the toolchain is broken. this is standard gcc behavior for all arches. ...

You are wrong here. It _is_ a bug of the toolchain if it auto-defines random unreserved identifiers. This is NOT standard GCC behaviour.

they arent random, it's the arch-specific identifier. and most arches do exactly that with gcc. try actually looking at the builtins provided by x86, mips, and powerpc to mention just a few.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20100321/9db016b0/attachment.pgp

#9 lore raw

Dear Mike,

Quoted 7 lines · In message <[email protected]> you wrote:
Quoted 3 lines

You are wrong here. It _is_ a bug of the toolchain if it auto-defines random unreserved identifiers. This is NOT standard GCC behaviour.

they arent random, it's the arch-specific identifier. and most arches do exactly that with gcc. try actually looking at the builtins provided by x86, mips, and powerpc to mention just a few.

As far as I can tell these are neither part of the Standard Predefined Macros nor of the Common Predefined Macros, so these can only be part of the System-Specific Predefined Macros.

And the C standard requires that all System-Specific Macros be part of the _reserved_namespace_ (i. e. the names must begin with two underscores, or an underscore and a capital letter).

So if a C compiler auto-defines something as "arm", or "i386", or "microblaze", then it is NOT standard-conforming - bare with me if I simply call this broken.

Best regards,

Wolfgang Denk

Signature · 7 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
There are two ways of constructing a software design. One way  is  to
make  it  so  simple that there are obviously no deficiencies and the
other is to make it so complicated that there are  no  obvious  defi-
ciencies.                             - Charles Anthony Richard Hoare
#10 lore raw
Quoted 12 lines · On Sunday 21 March 2010 18:45:51 Wolfgang Denk wrote:
Quoted 6 lines · Mike
Quoted 2 lines

You are wrong here. It _is_ a bug of the toolchain if it auto-defines random unreserved identifiers. This is NOT standard GCC behaviour.

they arent random, it's the arch-specific identifier. and most arches do exactly that with gcc. try actually looking at the builtins provided by x86, mips, and powerpc to mention just a few.

As far as I can tell these are neither part of the Standard Predefined Macros nor of the Common Predefined Macros, so these can only be part of the System-Specific Predefined Macros.

Quoted 7 lines

And the C standard requires that all System-Specific Macros be part of the _reserved_namespace_ (i. e. the names must begin with two underscores, or an underscore and a capital letter).

So if a C compiler auto-defines something as "arm", or "i386", or "microblaze", then it is NOT standard-conforming - bare with me if I simply call this broken.

that may be, but if that is what the gcc maintainer has decided, then complaining about it wont fix code like u-boot. after all, u-boot hasnt told gcc that it wants strict preprocessor behavior (i.e. using something like - ansi). if it did, then gcc wouldnt have output any non-prefixed defines. -mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20100322/362cf416/attachment.pgp

#11 lore raw

Dear Mike Frysinger,

Quoted 7 lines · In message <[email protected]> you wrote:
Quoted 4 lines

So if a C compiler auto-defines something as "arm", or "i386", or "microblaze", then it is NOT standard-conforming - bare with me if I simply call this broken.

that may be, but if that is what the gcc maintainer has decided, then complaining about it wont fix code like u-boot. after all, u-boot hasnt told

Complaining about it might help to accelerate fixes which are already in the works. GCC documentation reads:

We are slowly phasing out all predefined macros which are outside the reserved namespace. You should never use them in new programs, and we encourage you to correct older code to use the parallel macros whenever you find it.

Complaining might make the "slowwly" a little faster. Not complaining certainly does not help at all.

Quoted 2 lines

gcc that it wants strict preprocessor behavior (i.e. using something like - ansi). if it did, then gcc wouldnt have output any non-prefixed defines.

Maybe we should do that?

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
It is a good thing for an uneducated man to read books of quotations.
                        - Sir Winston Churchill _My Early Life_ ch. 9
#12 lore raw
Quoted 12 lines · On Monday 22 March 2010 07:18:52 Wolfgang Denk wrote:
Quoted 7 lines · Mike Frysinger
Quoted 3 lines

So if a C compiler auto-defines something as "arm", or "i386", or "microblaze", then it is NOT standard-conforming - bare with me if I simply call this broken.

that may be, but if that is what the gcc maintainer has decided, then complaining about it wont fix code like u-boot. after all, u-boot hasnt told

Complaining about it might help to accelerate fixes which are already in the works. GCC documentation reads:

Quoted 7 lines

We are slowly phasing out all predefined macros which are outside the reserved namespace. You should never use them in new programs, and we encourage you to correct older code to use the parallel macros whenever you find it.

Complaining might make the "slowwly" a little faster. Not complaining certainly does not help at all.

perhaps, but it doesnt make projects compile any better, and i'd be suspicious of how long it's actually going to take for that to become a reality. gcc has behaved this way for years, and i dont see any sign of it changing (it hasnt even started issuing warnings).

Quoted 5 lines
Quoted 3 lines

gcc that it wants strict preprocessor behavior (i.e. using something like
- ansi). if it did, then gcc wouldnt have output any non-prefixed defines.

Maybe we should do that?

looks like we already do, and you added it for precisely this reason (Aug 2009). i guess the OP is using an older version of u-boot which is why it's still a problem for him ?

kind of makes this whole thread pointless noise ... sorry about that
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20100322/4bfdffdf/attachment.pgp

#13 lore raw

Dear Mike Frysinger,

Quoted 5 lines · In message <[email protected]> you wrote:

perhaps, but it doesnt make projects compile any better, and i'd be suspicious of how long it's actually going to take for that to become a reality. gcc has behaved this way for years, and i dont see any sign of it changing (it hasnt even started issuing warnings).

And during these years, how many bug reports did you file?

It is people with your attitude who are to blame for this state.

Hey, this is community work. If you submit a patch and the respective maintainer or somebody else rejects it for some reason or another, what will you do? If you want to have this patch included you negotiate and co-operate.

If a tool is broken what do you do? You give up and don't even attempt to provide useful feedback.

There are tons of examples of really stupid developments all around because people don't even attempt to fix the problems at the origin, but rather accept it "gcc has always behaved like that".

Sorry for my uproariousness, but this really gets on my nerves.

Quoted 5 lines
Quoted 1 line

Maybe we should do that?

looks like we already do, and you added it for precisely this reason (Aug 2009). i guess the OP is using an older version of u-boot which is why it's still a problem for him ?

Yes, that's what I guess, too.

Quoted 1 line

kind of makes this whole thread pointless noise ... sorry about that

Me too.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Disobedience:  The silver lining to the cloud of servitude.
- Ambrose Bierce
#14 lore raw
Quoted 9 lines · On Monday 22 March 2010 17:39:04 Wolfgang Denk wrote:
Quoted 4 lines · Mike Frysinger

perhaps, but it doesnt make projects compile any better, and i'd be suspicious of how long it's actually going to take for that to become a reality. gcc has behaved this way for years, and i dont see any sign of it changing (it hasnt even started issuing warnings).

And during these years, how many bug reports did you file?

It is people with your attitude who are to blame for this state.

that depends on your POV. i dont personally have a problem with this behavior, so no, ive never submitted a bug. i'm guessing you have ? :p -mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20100322/c0c6bdff/attachment.pgp