Re: [U-Boot] [PATCH 1/2] tegra2: Always build with USE_PRIVATE_LIBGCC=yes.
Dear Thierry Reding, In message 1321524246-5187-2-git-send-email-thierry.red...@avionic-design.de you wrote: The AVP on Tegra2 doesn't boot properly when U-Boot is linked against the GCC provided libgcc. To work around this, always build and link against a private libgcc for Tegra2-based boards. I notice this patch only now, when pulling in from u-boot-arm. I will accept this only temporarily. Why don't you use a working tool chain instead, or fix the one you are using? Best regards, Wolfgang Denk -- 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: w...@denx.de COBOL is for morons. -- E.W. Dijkstra ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2] tegra2: Always build with USE_PRIVATE_LIBGCC=yes.
On 01/05/2012 08:50 AM, Wolfgang Denk wrote: Dear Thierry Reding, In message 1321524246-5187-2-git-send-email-thierry.red...@avionic-design.de you wrote: The AVP on Tegra2 doesn't boot properly when U-Boot is linked against the GCC provided libgcc. To work around this, always build and link against a private libgcc for Tegra2-based boards. I notice this patch only now, when pulling in from u-boot-arm. I will accept this only temporarily. Why don't you use a working tool chain instead, or fix the one you are using? I believe the issue isn't that the toolchain is broken, but due to the mix of multiple CPU types on Tegra, all of which run the same U-Boot binary. U-Boot starts execution on the AVP CPU, an ARMv4(?) CPU. U-Boot then inits the main CPUs, ARMv7 Cortex A9s, and arranges for them to continue running U-Boot. The libraries included in the toolchain are built for the ARMv7 CPUs, and hence fail to operate correctly when used by the portion of U-Boot which runs on the ARMv4 CPU, presumably due to ISA differences. IIRC, there are overrides in the U-Boot build process such that some/all of U-Boot is built so it'll run on ARMv4 OK, which is why using libgcc built by U-Boot solves this. -- nvpublic ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2] tegra2: Always build with USE_PRIVATE_LIBGCC=yes.
Hi Stephen, On Thu, Jan 5, 2012 at 8:53 AM, Stephen Warren swar...@nvidia.com wrote: On 01/05/2012 08:50 AM, Wolfgang Denk wrote: Dear Thierry Reding, In message 1321524246-5187-2-git-send-email-thierry.red...@avionic-design.de you wrote: The AVP on Tegra2 doesn't boot properly when U-Boot is linked against the GCC provided libgcc. To work around this, always build and link against a private libgcc for Tegra2-based boards. I notice this patch only now, when pulling in from u-boot-arm. I will accept this only temporarily. Why don't you use a working tool chain instead, or fix the one you are using? I believe the issue isn't that the toolchain is broken, but due to the mix of multiple CPU types on Tegra, all of which run the same U-Boot binary. U-Boot starts execution on the AVP CPU, an ARMv4(?) CPU. U-Boot then inits the main CPUs, ARMv7 Cortex A9s, and arranges for them to continue running U-Boot. The libraries included in the toolchain are built for the ARMv7 CPUs, and hence fail to operate correctly when used by the portion of U-Boot which runs on the ARMv4 CPU, presumably due to ISA differences. IIRC, there are overrides in the U-Boot build process such that some/all of U-Boot is built so it'll run on ARMv4 OK, which is why using libgcc built by U-Boot solves this. Yes that's right, but actually I have never delved into exactly why. Perhaps it is an integer divide or internal memcpy() call early in the code. We might be able to find the offending C library code, given enough time, and perhaps arrange not to call it. A little fragile though. Regards, Simon -- nvpublic ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2] tegra2: Always build with USE_PRIVATE_LIBGCC=yes.
Simon, -Original Message- From: s...@google.com [mailto:s...@google.com] On Behalf Of Simon Glass Sent: Thursday, January 05, 2012 10:07 AM To: Stephen Warren Cc: Wolfgang Denk; Thierry Reding; u-boot@lists.denx.de; Tom Warren Subject: Re: [U-Boot] [PATCH 1/2] tegra2: Always build with USE_PRIVATE_LIBGCC=yes. Hi Stephen, On Thu, Jan 5, 2012 at 8:53 AM, Stephen Warren swar...@nvidia.com wrote: On 01/05/2012 08:50 AM, Wolfgang Denk wrote: Dear Thierry Reding, In message 1321524246-5187-2-git-send-email-thierry.reding@avionic- design.de you wrote: The AVP on Tegra2 doesn't boot properly when U-Boot is linked against the GCC provided libgcc. To work around this, always build and link against a private libgcc for Tegra2-based boards. I notice this patch only now, when pulling in from u-boot-arm. I will accept this only temporarily. Why don't you use a working tool chain instead, or fix the one you are using? I believe the issue isn't that the toolchain is broken, but due to the mix of multiple CPU types on Tegra, all of which run the same U-Boot binary. U-Boot starts execution on the AVP CPU, an ARMv4(?) CPU. U-Boot then inits the main CPUs, ARMv7 Cortex A9s, and arranges for them to continue running U-Boot. The libraries included in the toolchain are built for the ARMv7 CPUs, and hence fail to operate correctly when used by the portion of U-Boot which runs on the ARMv4 CPU, presumably due to ISA differences. IIRC, there are overrides in the U-Boot build process such that some/all of U-Boot is built so it'll run on ARMv4 OK, which is why using libgcc built by U-Boot solves this. Yes that's right, but actually I have never delved into exactly why. Perhaps it is an integer divide or internal memcpy() call early in the code. We might be able to find the offending C library code, given enough time, and perhaps arrange not to call it. A little fragile though. IIRC, it was a divide that caused an undefined instruction exception. You can run U-Boot w/o the UE_PRIVATE_LIBGCC, and break in w/JTAG and look at the undefined instr shadow regs (sp/lr/pc) and find the opcode that caused the fault pretty easily, again IIRC. But USE_PRIVATE_LIBGCC was intended for just this problem, and works fine. Tom Regards, Simon -- nvpublic ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2] tegra2: Always build with USE_PRIVATE_LIBGCC=yes.
Dear Stephen Warren, In message 4f05d596.6030...@nvidia.com you wrote: I will accept this only temporarily. Why don't you use a working tool chain instead, or fix the one you are using? I believe the issue isn't that the toolchain is broken, but due to the mix of multiple CPU types on Tegra, all of which run the same U-Boot binary. When we can solve this issue with our own version of the libgcc, then we can also solve it by using a tool chain that provides the needed lingcc code. U-Boot starts execution on the AVP CPU, an ARMv4(?) CPU. U-Boot then inits the main CPUs, ARMv7 Cortex A9s, and arranges for them to continue running U-Boot. OK, so you have to use a tool chain which provides libgcc code for armv4t systems. What exactly is the problem here? The libraries included in the toolchain are built for the ARMv7 CPUs, SO this is not the right tool chain for the job. Ecactly what I said. and hence fail to operate correctly when used by the portion of U-Boot which runs on the ARMv4 CPU, presumably due to ISA differences. IIRC, there are overrides in the U-Boot build process such that some/all of U-Boot is built so it'll run on ARMv4 OK, which is why using libgcc built by U-Boot solves this. No, this is NOT a solution, it is a workaround for an inappropriate toolchain. If you want to build code for an armv4t system, you must use a tool chain that supports it. Best regards, Wolfgang Denk -- 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: w...@denx.de Small is beautiful. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2] tegra2: Always build with USE_PRIVATE_LIBGCC=yes.
Dear Simon Glass, In message capnjgz2wcqf2tpwwfudkg7y_xdeyhbfrenqxxrjg6eu7yj9...@mail.gmail.com you wrote: The libraries included in the toolchain are built for the ARMv7 CPUs, and hence fail to operate correctly when used by the portion of U-Boot which runs on the ARMv4 CPU, presumably due to ISA differences. IIRC, there are overrides in the U-Boot build process such that some/all of U-Boot is built so it'll run on ARMv4 OK, which is why using libgcc built by U-Boot solves this. Yes that's right, but actually I have never delved into exactly why. Perhaps it is an integer divide or internal memcpy() call early in the code. We might be able to find the offending C library code, given enough time, and perhaps arrange not to call it. A little fragile though. That would be the totally wrong approach. Problems should be solved where they originate. Here this appears to be the tool chain, which does not provide a version of libgcc suitable for amv4t configurations. Best regards, Wolfgang Denk -- 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: w...@denx.de All men should freely use those seven words which have the power to make any marriage run smoothly: You know dear, you may be right. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2] tegra2: Always build with USE_PRIVATE_LIBGCC=yes.
On 01/05/2012 12:16 PM, Wolfgang Denk wrote: In message 4f05d596.6030...@nvidia.com you wrote: ... The libraries included in the toolchain are built for the ARMv7 CPUs, SO this is not the right tool chain for the job. Ecactly what I said. and hence fail to operate correctly when used by the portion of U-Boot which runs on the ARMv4 CPU, presumably due to ISA differences. IIRC, there are overrides in the U-Boot build process such that some/all of U-Boot is built so it'll run on ARMv4 OK, which is why using libgcc built by U-Boot solves this. No, this is NOT a solution, it is a workaround for an inappropriate toolchain. If you want to build code for an armv4t system, you must use a tool chain that supports it. But we don't want to generate code for ARMv4 in general, but rather ARMv7 as the toolchain does. Only a tiny part of the code needs to be built for ARMv4, and in general we want to benefit from using ARMv7. -- nvpublic ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2] tegra2: Always build with USE_PRIVATE_LIBGCC=yes.
Dear Stephen Warren, In message 4f05fcbd.2040...@nvidia.com you wrote: No, this is NOT a solution, it is a workaround for an inappropriate toolchain. If you want to build code for an armv4t system, you must use a tool chain that supports it. But we don't want to generate code for ARMv4 in general, but rather Then just turn on the ARMv4 specific options (-march=armv4t -mno-thumb -mthumb-interwork -mtune=arm920t ???) for the files that need it. But as soon as any of these files liks code from libgcc you have to decide. ARMv7 as the toolchain does. Only a tiny part of the code needs to be built for ARMv4, and in general we want to benefit from using ARMv7. Then you should probably still link against a ARMv4 specific libgcc. If you were building U-Boot's libgcc code with optimization set for ARMv7 this would not fix anything. Best regards, Wolfgang Denk -- 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: w...@denx.de I'd rather be led to hell than managed to heaven. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2] tegra2: Always build with USE_PRIVATE_LIBGCC=yes.
Hi, On Thu, Jan 5, 2012 at 12:17 PM, Wolfgang Denk w...@denx.de wrote: Dear Stephen Warren, In message 4f05fcbd.2040...@nvidia.com you wrote: No, this is NOT a solution, it is a workaround for an inappropriate toolchain. If you want to build code for an armv4t system, you must use a tool chain that supports it. But we don't want to generate code for ARMv4 in general, but rather Then just turn on the ARMv4 specific options (-march=armv4t -mno-thumb -mthumb-interwork -mtune=arm920t ???) for the files that need it. But as soon as any of these files liks code from libgcc you have to decide. Perhaps we could adjust Tegra's config.mk to use ARMv4T when not building with the private libgcc? ARMv7 as the toolchain does. Only a tiny part of the code needs to be built for ARMv4, and in general we want to benefit from using ARMv7. Then you should probably still link against a ARMv4 specific libgcc. If you were building U-Boot's libgcc code with optimization set for ARMv7 this would not fix anything. It might be possible to specify ARMv4T on the link flags and have it pick up the v4T library, even if nearly everything else is ARMv7? Regards, Simon Best regards, Wolfgang Denk -- 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: w...@denx.de I'd rather be led to hell than managed to heaven. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2] tegra2: Always build with USE_PRIVATE_LIBGCC=yes.
On 01/05/2012 01:42 PM, Simon Glass wrote: Hi, On Thu, Jan 5, 2012 at 12:17 PM, Wolfgang Denk w...@denx.de wrote: Dear Stephen Warren, In message 4f05fcbd.2040...@nvidia.com you wrote: No, this is NOT a solution, it is a workaround for an inappropriate toolchain. If you want to build code for an armv4t system, you must use a tool chain that supports it. But we don't want to generate code for ARMv4 in general, but rather Then just turn on the ARMv4 specific options (-march=armv4t -mno-thumb -mthumb-interwork -mtune=arm920t ???) for the files that need it. That's exactly what we've already done, but that doesn't affect code that gets pulled in from libgcc, which is what USE_PRIVATE_LIBGCC affects IIUC. But as soon as any of these files liks code from libgcc you have to decide. Perhaps we could adjust Tegra's config.mk to use ARMv4T when not building with the private libgcc? I believe the relevant U-Boot source files are already built for ARMv4T, it's just libgcc that's the issue. ARMv7 as the toolchain does. Only a tiny part of the code needs to be built for ARMv4, and in general we want to benefit from using ARMv7. Then you should probably still link against a ARMv4 specific libgcc. If you were building U-Boot's libgcc code with optimization set for ARMv7 this would not fix anything. It might be possible to specify ARMv4T on the link flags and have it pick up the v4T library, even if nearly everything else is ARMv7? I don't think we use any multilib toolchains, so I don't think that's possible. -- nvpublic ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2] tegra2: Always build with USE_PRIVATE_LIBGCC=yes.
Dear Stephen, In message 4f060dd1.9050...@nvidia.com you wrote: It might be possible to specify ARMv4T on the link flags and have it pick up the v4T library, even if nearly everything else is ARMv7? I don't think we use any multilib toolchains, so I don't think that's possible. I don't even think you need one with multilib support. You need one that provides a libgcc for armv4t, that's all. It is wrong, always and everywhere, NOT to try to fix the problems at the origin. If your tool chain does not meet your requirements, then the first action should always be to get a working tool chain - ideally by getting the deficiencies of the currnt one fixed, or by using another one. Working around such problems may be a short term approach to get things running quickly. But it appears that more and more people make it a habit to do just that, without even trying to get the real problems fixed upstream. That's bad, bad, bad. Best regards, Wolfgang Denk -- 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: w...@denx.de I'd rather be led to hell than managed to heaven. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 1/2] tegra2: Always build with USE_PRIVATE_LIBGCC=yes.
The AVP on Tegra2 doesn't boot properly when U-Boot is linked against the GCC provided libgcc. To work around this, always build and link against a private libgcc for Tegra2-based boards. Signed-off-by: Thierry Reding thierry.red...@avionic-design.de --- arch/arm/cpu/armv7/tegra2/config.mk |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/arm/cpu/armv7/tegra2/config.mk b/arch/arm/cpu/armv7/tegra2/config.mk index 8f9bdc9..2303dba 100644 --- a/arch/arm/cpu/armv7/tegra2/config.mk +++ b/arch/arm/cpu/armv7/tegra2/config.mk @@ -29,3 +29,5 @@ ifdef CONFIG_TEGRA2 CFLAGS_arch/arm/lib/board.o += -march=armv4t endif + +USE_PRIVATE_LIBGCC = yes -- 1.7.7.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2] tegra2: Always build with USE_PRIVATE_LIBGCC=yes.
On Thu, Nov 17, 2011 at 2:04 AM, Thierry Reding thierry.red...@avionic-design.de wrote: The AVP on Tegra2 doesn't boot properly when U-Boot is linked against the GCC provided libgcc. To work around this, always build and link against a private libgcc for Tegra2-based boards. Signed-off-by: Thierry Reding thierry.red...@avionic-design.de Tested-by: Simon Glass s...@chromium.org --- arch/arm/cpu/armv7/tegra2/config.mk | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/arm/cpu/armv7/tegra2/config.mk b/arch/arm/cpu/armv7/tegra2/config.mk index 8f9bdc9..2303dba 100644 --- a/arch/arm/cpu/armv7/tegra2/config.mk +++ b/arch/arm/cpu/armv7/tegra2/config.mk @@ -29,3 +29,5 @@ ifdef CONFIG_TEGRA2 CFLAGS_arch/arm/lib/board.o += -march=armv4t endif + +USE_PRIVATE_LIBGCC = yes -- 1.7.7.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot