14 Replies Latest reply on May 12, 2013 3:46 AM by Thang.Le

    Sourcery CodeBench Lite 2012.09-64 - Breaks kernel builds

    fabio.porcedda Talented

      Hi all,

      this toolchain is unable to build the linux kernel (i've tried 3.6.6 and 3.7-rc6),

      it gives me this error:

       

      ...

      arch/arm/lib/copy_template.S:100: Error: selected processor does not support ARM mode `ldralt ip,[r1],#4'

      ...

       

      The kernel builds fine with the previous release (2012.03) and

      with other gcc-4.7 toolchain (ubuntu 12.10 armel-cross).

       

      I think it's afflicted by this bug:

      http://sourceware.org/bugzilla/show_bug.cgi?id=14575

      https://bugzilla.redhat.com/show_bug.cgi?id=869025

       

      Do you think there is some hope to have a fixed version?

       

      Best regards

      Fabio Porcedda

        • 1. Re: Sourcery CodeBench Lite 2012.09-64 - Breaks kernel builds
          Eman Talented

          Very funny you didn't get any response at all! Eventhough this post have been viewed close to 3000 times!

          I have a very similar problem...

           

          Some questions for you.

          1) What platform / OS are you compiling on?

          2) Can you post last few lines using:
                     make -w V=1

          3) post the content of that file "copy_template.S"

           

          Probably you have the wrong -march and SYSROOT combination specified.

          -march=... appears several times, and it's **** close to impossible to figure out where they come from.

          • 2. Re: Sourcery CodeBench Lite 2012.09-64 - Breaks kernel builds
            fabio.porcedda Talented

            Hi Eman,

             

            1)

            Ubuntu 12.10 32bit

            I'm building the latest linx kernel version (v3.7.3) without any modification.

             

            2)

              /opt/arm-2012.09/bin/arm-none-linux-gnueabi-gcc -Wp,-MD,arch/arm/lib/.clear_user.o.d  -nostdinc -isystem /opt/arm-2012.09/bin/../lib/gcc/arm-none-linux-gnueabi/4.7.2/include -I/extra/git-cache/linux-stable/arch/arm/include -Iarch/arm/include/generated  -Iinclude -I/extra/git-cache/linux-stable/arch/arm/include/uapi -Iarch/arm/include/generated/uapi -I/extra/git-cache/linux-stable/include/uapi -Iinclude/generated/uapi -include /extra/git-cache/linux-stable/include/linux/kconfig.h -D__KERNEL__ -mlittle-endian -Iarch/arm/mach-at91/include  -D__ASSEMBLY__ -mabi=aapcs-linux -mno-thumb-interwork -funwind-tables -marm -D__LINUX_ARM_ARCH__=5 -march=armv5te -mtune=arm9tdmi -include asm/unified.h -msoft-float         -c -o arch/arm/lib/clear_user.o arch/arm/lib/clear_user.S

              /opt/arm-2012.09/bin/arm-none-linux-gnueabi-gcc -Wp,-MD,arch/arm/lib/.clearbit.o.d  -nostdinc -isystem /opt/arm-2012.09/bin/../lib/gcc/arm-none-linux-gnueabi/4.7.2/include -I/extra/git-cache/linux-stable/arch/arm/include -Iarch/arm/include/generated  -Iinclude -I/extra/git-cache/linux-stable/arch/arm/include/uapi -Iarch/arm/include/generated/uapi -I/extra/git-cache/linux-stable/include/uapi -Iinclude/generated/uapi -include /extra/git-cache/linux-stable/include/linux/kconfig.h -D__KERNEL__ -mlittle-endian -Iarch/arm/mach-at91/include  -D__ASSEMBLY__ -mabi=aapcs-linux -mno-thumb-interwork -funwind-tables -marm -D__LINUX_ARM_ARCH__=5 -march=armv5te -mtune=arm9tdmi -include asm/unified.h -msoft-float         -c -o arch/arm/lib/clearbit.o arch/arm/lib/clearbit.S

              /opt/arm-2012.09/bin/arm-none-linux-gnueabi-gcc -Wp,-MD,arch/arm/lib/.copy_from_user.o.d  -nostdinc -isystem /opt/arm-2012.09/bin/../lib/gcc/arm-none-linux-gnueabi/4.7.2/include -I/extra/git-cache/linux-stable/arch/arm/include -Iarch/arm/include/generated  -Iinclude -I/extra/git-cache/linux-stable/arch/arm/include/uapi -Iarch/arm/include/generated/uapi -I/extra/git-cache/linux-stable/include/uapi -Iinclude/generated/uapi -include /extra/git-cache/linux-stable/include/linux/kconfig.h -D__KERNEL__ -mlittle-endian -Iarch/arm/mach-at91/include  -D__ASSEMBLY__ -mabi=aapcs-linux -mno-thumb-interwork -funwind-tables -marm -D__LINUX_ARM_ARCH__=5 -march=armv5te -mtune=arm9tdmi -include asm/unified.h -msoft-float         -c -o arch/arm/lib/copy_from_user.o arch/arm/lib/copy_from_user.S

            arch/arm/lib/copy_template.S: Assembler messages:

            arch/arm/lib/copy_template.S:100: Error: selected processor does not support ARM mode `ldralt r3,[r1],#4'

            arch/arm/lib/copy_template.S:100: Error: selected processor does not support ARM mode `ldralt r4,[r1],#4'

            arch/arm/lib/copy_template.S:100: Error: selected processor does not support ARM mode `ldralt r5,[r1],#4'

            arch/arm/lib/copy_template.S:100: Error: selected processor does not support ARM mode `ldralt r6,[r1],#4'

            arch/arm/lib/copy_template.S:100: Error: selected processor does not support ARM mode `ldralt r7,[r1],#4'

            arch/arm/lib/copy_template.S:100: Error: selected processor does not support ARM mode `ldralt r8,[r1],#4'

            arch/arm/lib/copy_template.S:100: Error: selected processor does not support ARM mode `ldralt ip,[r1],#4'

            arch/arm/lib/copy_template.S:100: Error: selected processor does not support ARM mode `ldralt lr,[r1],#4'

            arch/arm/lib/copy_template.S:118: Error: selected processor does not support ARM mode `ldralt r3,[r1],#4'

            arch/arm/lib/copy_template.S:119: Error: selected processor does not support ARM mode `ldralt r4,[r1],#4'

            arch/arm/lib/copy_template.S:120: Error: selected processor does not support ARM mode `ldralt r5,[r1],#4'

            arch/arm/lib/copy_template.S:121: Error: selected processor does not support ARM mode `ldralt r6,[r1],#4'

            arch/arm/lib/copy_template.S:122: Error: selected processor does not support ARM mode `ldralt r7,[r1],#4'

            arch/arm/lib/copy_template.S:123: Error: selected processor does not support ARM mode `ldralt r8,[r1],#4'

            arch/arm/lib/copy_template.S:124: Error: selected processor does not support ARM mode `ldralt lr,[r1],#4'

            arch/arm/lib/copy_template.S:173: Error: selected processor does not support ARM mode `ldralt lr,[r1],#4'

            arch/arm/lib/copy_template.S:243: Error: selected processor does not support ARM mode `ldralt r4,[r1],#4'

            arch/arm/lib/copy_template.S:243: Error: selected processor does not support ARM mode `ldralt r5,[r1],#4'

            arch/arm/lib/copy_template.S:243: Error: selected processor does not support ARM mode `ldralt r6,[r1],#4'

            arch/arm/lib/copy_template.S:243: Error: selected processor does not support ARM mode `ldralt r7,[r1],#4'

            arch/arm/lib/copy_template.S:243: Error: selected processor does not support ARM mode `ldralt r8,[r1],#4'

            arch/arm/lib/copy_template.S:243: Error: selected processor does not support ARM mode `ldralt r9,[r1],#4'

            arch/arm/lib/copy_template.S:243: Error: selected processor does not support ARM mode `ldralt ip,[r1],#4'

            arch/arm/lib/copy_template.S:243: Error: selected processor does not support ARM mode `ldralt lr,[r1],#4'

            arch/arm/lib/copy_template.S:243: Error: selected processor does not support ARM mode `ldralt lr,[r1],#4'

            arch/arm/lib/copy_template.S:245: Error: selected processor does not support ARM mode `ldralt r4,[r1],#4'

            arch/arm/lib/copy_template.S:245: Error: selected processor does not support ARM mode `ldralt r5,[r1],#4'

            arch/arm/lib/copy_template.S:245: Error: selected processor does not support ARM mode `ldralt r6,[r1],#4'

            arch/arm/lib/copy_template.S:245: Error: selected processor does not support ARM mode `ldralt r7,[r1],#4'

            arch/arm/lib/copy_template.S:245: Error: selected processor does not support ARM mode `ldralt r8,[r1],#4'

            arch/arm/lib/copy_template.S:245: Error: selected processor does not support ARM mode `ldralt r9,[r1],#4'

            arch/arm/lib/copy_template.S:245: Error: selected processor does not support ARM mode `ldralt ip,[r1],#4'

            arch/arm/lib/copy_template.S:245: Error: selected processor does not support ARM mode `ldralt lr,[r1],#4'

            arch/arm/lib/copy_template.S:245: Error: selected processor does not support ARM mode `ldralt lr,[r1],#4'

            arch/arm/lib/copy_template.S:247: Error: selected processor does not support ARM mode `ldralt r4,[r1],#4'

            arch/arm/lib/copy_template.S:247: Error: selected processor does not support ARM mode `ldralt r5,[r1],#4'

            arch/arm/lib/copy_template.S:247: Error: selected processor does not support ARM mode `ldralt r6,[r1],#4'

            arch/arm/lib/copy_template.S:247: Error: selected processor does not support ARM mode `ldralt r7,[r1],#4'

            arch/arm/lib/copy_template.S:247: Error: selected processor does not support ARM mode `ldralt r8,[r1],#4'

            arch/arm/lib/copy_template.S:247: Error: selected processor does not support ARM mode `ldralt r9,[r1],#4'

            arch/arm/lib/copy_template.S:247: Error: selected processor does not support ARM mode `ldralt ip,[r1],#4'

            arch/arm/lib/copy_template.S:247: Error: selected processor does not support ARM mode `ldralt lr,[r1],#4'

            arch/arm/lib/copy_template.S:247: Error: selected processor does not support ARM mode `ldralt lr,[r1],#4'

            make[1]: *** [arch/arm/lib/copy_from_user.o] Error 1

            make: *** [arch/arm/lib] Error 2

            make: Leaving directory `/extra/git-cache/linux-stable'

             

            3)

            The arch/arm/lib/copy_template.S file is original, without any modification:

            http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=blob;f=arch/arm/lib/copy_template.S;h=805e3f8fb00786f00f62820c57b02852ad043aaa;hb=HEAD

             

            Bear in mind that i use only default source code and default options, i didn't choose -march or SYSROOT.

            The same linux kernel builds fine using other gcc4.7 arm toolchains:

            - Ubuntu 12.10 - gcc-4.7-arm-linux-gnueabi (gcc-4.7.2 binutils-2.22.90.20120919)

            - Buildroot 2013.02-snapshot: internal toolchain (gcc-4.7 binutils-2.23.1)

             

            I think that the problem is relase to the binutils version used: 2.23.51.20120829 that is affected by this bug:

            http://sourceware.org/bugzilla/show_bug.cgi?id=14575

            • 3. Re: Sourcery CodeBench Lite 2012.09-64 - Breaks kernel builds
              Eman Talented

              The problem is that the crappy freebie compiler (CodeBench Lite) doesn't supply the correct GLIBC libraries

              that are needed to fully support the combination of: "-march=armv5te -mtune=arm9tdmi" or whatever "-mcpu="

              you have. In my case, and also probably in yours,  we need "-march=armv7-a". This is only available in their

              most expensive version.

               

              This is a really dumb and counterproductive marketing failure. If they think that we will buy their expensive product

              after seeing their lack of support or interest in getting even the most simple problems resolved,  I seriously doubt

              they'll be able to offer much more for a fully paid version. Not understanding that ignoring simple questions here, will

              undoubtedly create more work for their fully supported packages.

               

              So my only suggestion at this point, is to stay away from Mentor Graphics products

              altogether. They create more headaches for beginners, than just compiling your own toolchain.

               

              After all, it only took me 20 minutes to download and compile my own set of binutils (as,ar,ld etc), that replaced the

              broken ones supplied in the CB Lite edition. Suddenly things started working!

               

              Good Luck!

              • 4. Re: Sourcery CodeBench Lite 2012.09-64 - Breaks kernel builds
                brad_dixon Embedded

                Fabio: You may well have an issue with the particular version of binutils and that Linux kernel version. Thanks for the write-up. I'm going to ask some people to look into and get back to you.

                • 5. Re: Sourcery CodeBench Lite 2012.09-64 - Breaks kernel builds
                  fabio.porcedda Talented

                  Hi brad_dixton,

                   

                  Thanks for looking in the problem.

                   

                  I've used the at91_dt_defconfig, but the same problem appens using versatile_defconfig and kirkwood_defconfig.

                   

                  This problem block the use of this toolchain for linux development.

                  As example we can't use this version in the buildroot project.

                  The latest version used arm codebench toolchain is the 2012.03.

                  At least until this problem is fixed.

                   

                  Best regards

                  • 6. Re: Sourcery CodeBench Lite 2012.09-64 - Breaks kernel builds
                    Eman Talented

                    Definitely a binutils (gas) problem as described HERE:

                    (The assembler is confusing two different instructions.)

                    Recompile your own binutils and replace the sorcery executable and you will probably be ok.

                    • 7. Re: Sourcery CodeBench Lite 2012.09-64 - Breaks kernel builds
                      brad_dixon Embedded

                      As Eman said, yes, its definetly a "bug". We snapped our binutils just prior to this patch getting mainlined so we don't have it in these Lite builds.

                       

                      We update Lite periodically based on sponsor requirements and when a new version is published you'll be able to grab it on the Sourcery Portal.

                       

                      B

                      • 8. Re: Sourcery CodeBench Lite 2012.09-64 - Breaks kernel builds
                        Thang.Le Talented

                        Hi all,

                         

                        I have same issue. How to fix it ?, I am using Ubuntu 13.03. Previous version has this issue ?

                         

                        Thanks

                        • 9. Re: Sourcery CodeBench Lite 2012.09-64 - Breaks kernel builds
                          fabio.porcedda Talented

                          thangvl2a ha scritto:

                           

                          Hi all,

                           

                          I have same issue. How to fix it ?, I am using Ubuntu 13.03. Previous version has this issue ?

                           

                          Thanks

                          The 2012.03 version works fine for me.

                          • 10. Re: Sourcery CodeBench Lite 2012.09-64 - Breaks kernel builds
                            Thang.Le Talented

                            Thanks Fabio Porcedda,

                             

                            I will try to back to this old version. Hope Mentor will fix it soon. This is a very basic error, it should not happen because before delevery a new version, at least they need to check it.

                             

                            @Fabio Porcedda: did you try GCC for ARM, how about it ?

                             

                            Regards

                            • 11. Re: Sourcery CodeBench Lite 2012.09-64 - Breaks kernel builds
                              fabio.porcedda Talented

                              Thang.Le wrote:

                               

                              Thanks Fabio Porcedda,

                               

                              I will try to back to this old version. Hope Mentor will fix it soon. This is a very basic error, it should not happen because before delevery a new version, at least they need to check it.

                               

                              @Fabio Porcedda: did you try GCC for ARM, how about it ?

                               

                              Regards

                              What do you mean with "GCC for ARM"?

                               

                              I have used successfully the gcc arm toolchain package provided with ubuntu distrubution and fedora distribution,

                              and the toolchain built from source by buildroot.

                               

                              Regards

                              • 12. Re: Sourcery CodeBench Lite 2012.09-64 - Breaks kernel builds
                                Thang.Le Talented

                                Hi

                                I mean GNUARM. It's different with Sourcery CodeBench Lite ?

                                 

                                Regards

                                • 13. Re: Sourcery CodeBench Lite 2012.09-64 - Breaks kernel builds
                                  fabio.porcedda Talented

                                  The latest version, Sourcery CodeBench Lite 2013.05  seems to work fine.

                                  • 14. Re: Sourcery CodeBench Lite 2012.09-64 - Breaks kernel builds
                                    Thang.Le Talented

                                    Hi,

                                    Tried with 2013.05. still have few issues when buiding kernel. However, this may be issues from GCC

                                     

                                    arch/arm/boot/compressed/head.S:565: Warning: (null)
                                    arch/arm/boot/compressed/head.S:676: Warning: (null)
                                    arch/arm/boot/compressed/head.S:698: Warning: (null)

                                     

                                     

                                    regards