public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Dirk Behme <dirk.behme@googlemail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] Build failures with older toolchain
Date: Tue, 30 Nov 2010 17:44:30 +0100	[thread overview]
Message-ID: <4CF529EE.5030104@googlemail.com> (raw)
In-Reply-To: <B85A65D85D7EB246BE421B3FB0FBB5930247AFD2A0@dbde02.ent.ti.com>

On 30.11.2010 15:25, Premi, Sanjeev wrote:
>> -----Original Message-----
>> From: u-boot-bounces at lists.denx.de
>> [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Premi, Sanjeev
>> Sent: Monday, November 29, 2010 8:38 PM
>> To: Wolfgang Denk
>> Cc: u-boot at lists.denx.de
>> Subject: Re: [U-Boot] Build failures with older toolchain
>>
>
> [snip]...[snip]
>
>>>>
>>>>       I am process of downloading the 2009q3 version from
>>> codesourcery
>>>>       Albert mentioned he is using it. Are you on the same
>> version as
>>>>       well?
>>>
>>> No, I'm using ELDk 4.2
>>
>> [sp] Okay, so I downloaded both 2009-q3 and 2010.09-50 versions of the
>>       Codesourcery Lite edition.
>>
>>       There is no difference in the observations between
>> 2009q3 and 2010q1.
>>
> [sp] I have been able to narrow down the problem to one variable defined
>       in board/ti/evm.c - omap3_evm_version - declared as:
>        static u8 omap3_evm_version;
>
>       Any attempt to assign value this variable in omap3_evm_get_revision()
>       leads to the linker error I noted with Codesourcery 2010q1-202.
>
>       With 2009q1-203, definition of variable itself is sufficient to cause
>       the linker error.

Maybe CCing Codesourcery's mailing list

http://www.codesourcery.com/archives/arm-gnu-discuss/maillist.html

could help, too? At least it's worth a try?

Dirk

>       I have pasted a patch below that constructs the testcase I have created
>       to explain these observations:
>       1) When macros both _EXCLUDE_ME_1 and _EXCLUDE_ME_2 are undefined, the
>          problem is - as described.
>
>       2) When only macro _EXCLUDE_ME_1 is defined, the compilation succeeds
>          with Codesourcery 2010q1-202; but fails with 2009q1-203.
>
>       3) When both macros _EXCLUDE_ME_1 and _EXCLUDE_ME_2 are defined, the
>          compilation succeeds with both codesourcery versions.
>
>       OMAP3EVM is obviously not the only file using statics. I see their usage
>       in many files including OMAP3Beagle as well - one reason I did not even
>       suspect this to be problem.
>
>       I haven't yet been able to conclude the cause of failure - but appears
>       to be related to handling of static variables across compiler versions.
>       Still need to investigate further on this...
>
>       Board revision needs to be detected early during initialization. How is
>       this handled for other boards? (I am currently trying to browse non-omap
>       boards for pointers). Any quick suggestions would be helpful.
>
> [patch]
> diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c
> index 09d14f7..e766355 100644
> --- a/board/ti/evm/evm.c
> +++ b/board/ti/evm/evm.c
> @@ -37,15 +37,30 @@
>   #include<asm/mach-types.h>
>   #include "evm.h"
>
> +/* #define _EXCLUDE_ME_1 */	/* Uncomment - works with 2010q1 only */
> +/* #define _EXCLUDE_ME_2 */	/* Uncomment - works with 2009q3 as well */
> +
> +#if !defined(_EXCLUDE_ME_2)
>   static u8 omap3_evm_version;
> +#endif
>
>   u8 get_omap3_evm_rev(void)
>   {
> +#ifdef _EXCLUDE_ME_2
> +	return OMAP3EVM_BOARD_GEN_1; /* Debugging: Don't use the variable */
> +#else
>   	return omap3_evm_version;
> +#endif
> +
>   }
>
>   static void omap3_evm_get_revision(void)
>   {
> +#ifdef _EXCLUDE_ME_COMPLETELY_
> +	/*
> +	 * Original code in the function is being removed completely to reduce
> +	 * scope of the debug exercise.
> +	 */
>   #if defined(CONFIG_CMD_NET)
>   	/*
>   	 * Board revision can be ascertained only by identifying
> @@ -80,6 +95,20 @@ static void omap3_evm_get_revision(void)
>   	omap3_evm_version = OMAP3EVM_BOARD_GEN_2;
>   #endif
>   #endif	/* CONFIG_CMD_NET */
> +
> +#else
> +	/*
> +	 * Dummy implementation of function just for testing
> +	 */
> +
> +#if !defined(_EXCLUDE_ME_1)&&  !defined(_EXCLUDE_ME_2)
> +	/*
> +	 * Dummy assignment just for testing
> +	 */
> +	omap3_evm_version = OMAP3EVM_BOARD_GEN_2;
> +#endif
> +
> +#endif	/* _EXCLUDE_ME_COMPLETELY_ */
>   }
>
>   #ifdef CONFIG_USB_OMAP3
> [/patch]
>
> [snip]
> Removed my observations for Codesourcery 2010.09-50.
> Did not get chance to look at them so far...
> [/snip]
>
> Best regards,
> Sanjeev
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>

  reply	other threads:[~2010-11-30 16:44 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-19 18:50 [U-Boot] Build failures with older toolchain Premi, Sanjeev
2010-11-19 19:43 ` Premi, Sanjeev
2010-11-19 20:13   ` Wolfgang Denk
2010-11-22  9:14     ` Premi, Sanjeev
2010-11-22 13:50       ` Premi, Sanjeev
2010-11-22 14:31         ` Albert ARIBAUD
2010-11-22 14:42           ` Premi, Sanjeev
2010-11-22 15:02           ` Premi, Sanjeev
2010-11-22 15:23             ` Albert ARIBAUD
2010-11-22 15:27               ` Premi, Sanjeev
2010-11-22 15:35                 ` Albert ARIBAUD
2010-11-29  9:47                 ` Premi, Sanjeev
2010-11-29 10:32                   ` Albert ARIBAUD
2010-11-29 10:37                     ` Premi, Sanjeev
2010-11-29 11:29                       ` Wolfgang Denk
2010-11-29 11:48                         ` Premi, Sanjeev
2010-11-29 12:05                           ` Wolfgang Denk
2010-11-29 15:08                             ` Premi, Sanjeev
2010-11-29 15:33                               ` Albert ARIBAUD
2010-11-29 15:39                                 ` Premi, Sanjeev
2010-11-30 14:25                               ` Premi, Sanjeev
2010-11-30 16:44                                 ` Dirk Behme [this message]
2010-11-30 18:23                                   ` Premi, Sanjeev
2010-12-01 14:56                                 ` Premi, Sanjeev
2010-12-01 15:02                                   ` Albert ARIBAUD
2010-12-01 15:18                                     ` Premi, Sanjeev
2010-11-29 10:35                   ` Wolfgang Denk
2010-11-29 10:44                     ` Premi, Sanjeev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CF529EE.5030104@googlemail.com \
    --to=dirk.behme@googlemail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox