[U-Boot] [PATCH v2 3/5] MIPS: Optimize the setup of endianess and CPU optimization flags

Daniel Schwierzeck daniel.schwierzeck at googlemail.com
Wed Mar 23 17:37:49 CET 2011


2011/3/23 Shinya Kuribayashi <skuribay at pobox.com>:
> On 03/21/2011 09:42 PM, Daniel Schwierzeck wrote:
>> I did some researching and testing with ELDK-4.1, ELDK-4.0 and ELDK-3.1.1.
>
> Thanks, much appreciated.
>
>> In ELDK-3.1.1 we have:
>> - mips_4KC-gcc (GCC) 3.3.3 (DENX ELDK 3.1.1 3.3.3-9)
>> - GNU assembler 2.14 20030612
>>
>> Therefore mips32r2 is already supported. But there is another problem
>> with this binutils version. The latest additions to mips.lds and
>> u-boot.lds for supporting recent binutils are causing parse errors.
>
> I wonder what's that 'the latest additions to mips.lds and u-boot.lds
> for supporting recent binutils' to be exact.  Which commit(s) are you
> referring to? Or could you provide error logs just in case please?

Following changes have been introduced to ld in binutils-2.16:

* Added SORT_BY_NAME and SORT_BY_ALIGNMENT to the linker script
  language to permit sorting sections by section name or section
  maximum alignment.

http://sourceware.org/cgi-bin/cvsweb.cgi/~checkout~/src/ld/NEWS?rev=1.116&content-type=text/plain&cvsroot=src&only_with_tag=binutils-binutils-2_21

These new macros are used in mips.lds and all u-boot.lds files.
I get follogwing error with ELDK-3.1.1 or other gcc-3.x based
toolchains (IncaIP used as sample config):

mips_4KC-ld -g -Ttext 0x80200000 -T mips.lds \
			-o <snip>/u-boot-git//build/incaip/examples/standalone/hello_world
-e hello_world <snip>/u-boot-git//build/incaip/examples/standalone/hello_world.o
<snip>/u-boot-git//build/incaip/examples/standalone/libstubs.o \
			-L<snip>/eldk-3.11/usr/bin/../lib/gcc-lib/mips-linux/3.3.3 -lgcc
mips_4KC-ld:mips.lds:37: parse error

This error refers to following line:
.rodata  : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }

Following commit introduced that change for all u-boot.lds files:
http://git.denx.de/?p=u-boot.git;a=commit;h=f62fb99941c625605aa16a0097b396a5c16d2c88

I'd claim that all toolchains with binutils lesser than 2.16 are not
working anymore.

>
>> Thus ELDK-3.1.1 and earlier are not functional with mainline U-Boot
>> anyway. ELDK-4.0 and 4.1 with gcc-4.0.0 and binutils-2.16.1 are
>> working properly.
>>
>> I suggest to drop official support for ELDK-3.1.1 / binutils-2.14 and
>> earlier.
>
> Hmm.  According to the README file, even the Linux kernel still builds
> with at least gcc 3.2.  I'm feeling that it might be a bit too early to
> drop gcc 3.3.3 (ELDK-3.1.1).
>
> So I'd like to take a look at the issue you found this time, first.  If
> it's easy to fix, let's fix it.  And if not, revise the patch please.
> We have not heard of any problem reports on MIPS builds with ELDK-3.1.1
> so far (at least I'm not aware of them).  The change won't be a problem.

I have prepared a v3 of this patch that checks whether -mips32r2 is
supported. If not than -mips32
will be used as fallback. But I want to clarify this first before I send it.

Best regards,
Daniel


More information about the U-Boot mailing list