This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [m68k] Fix m51qe family compilation for gcc >= 4.5.0


Hi Corine,

On Mon, Jul 19, 2010 at 07:25, Corinna Vinschen <vinschen@redhat.com> wrote:
> Rafael,
>
> On Jul 16 18:11, Rafael Campos wrote:
>> Hi all,
>>
>> Compiling newlib for m68k with the new support added to 51qe family
>> it's broken. I'll attach a patch to fix it.
>
> First of all, your patch is missing a ChangeLog entry. ?Please add one.
>
> As far as I understand your patch, it treats __mcf_family_51 identical
> to __mcf_family_51qe, but only if gcc is >= 4.5.1. ?If the gcc
> requirement is necessary, why? ?If the entire 51 family chokes on
> accessing CACR, then I don't see how this has anything to do with the
> gcc version, and your patch could be simplified to
>
> ?-#if !defined(__mcf_family_5213) && !defined(__mcf_family_51qe)
> ?+#if !defined(__mcf_family_5213) && !defined(__mcf_family_51)
>
> assuming that #define __mcf_family_51qe includes #define __mcf_family_51.
> Or at least
>
> ?-#if !defined(__mcf_family_5213) && !defined(__mcf_family_51qe)
> ?+#if !defined(__mcf_family_5213) && !defined(__mcf_family_51) && !defined(__mcf_family_51qe)

You are right, this is the proper approach. I'll  send the patch with
the proper Changelog & the proper fix.

>
> So, would you mind to explain a bit more detailed what this patch
> fixes exactly and why in this way?
>
>
> Corinna
>
>>
>> Regards,
>> --
>> Rafael Campos Las Heras (Methril)
>
>> Index: cf-crt1.c
>> ===================================================================
>> RCS file: /cvs/src/src/libgloss/m68k/cf-crt1.c,v
>> retrieving revision 1.4
>> diff -u -8 -p -r1.4 cf-crt1.c
>> --- cf-crt1.c 16 Jun 2008 18:42:40 -0000 ? ? ?1.4
>> +++ cf-crt1.c 16 Jul 2010 21:08:32 -0000
>> @@ -63,16 +63,25 @@ void __start1 (void *heap_limit)
>>
>> ?/* A default hardware init hook. ?*/
>>
>> ?void __attribute__ ((weak)) hardware_init_hook (void)
>> ?{
>> ? ?/* Set the VBR. */
>> ? ?__asm__ __volatile__ ("movec.l %0,%/vbr" :: "r" (__interrupt_vector));
>>
>> +/*Check for GCC >= 4.5 m51qe family definition chage */
>> +#if ( __GNUC__ > 4 || (__GNUC__ == 4 && \
>> + ? ? ?(__GNUC_MINOR__ > 5 ?|| \
>> + ? ? ?(__GNUC_MINOR__ == 5 && __GNUC_PATCHLEVEL__ > 0)) )
>> + ?#if defined(__mcf_family_51)
>> + ? ?#define __mcf_family_51qe
>> + ?#endif
>> +#endif
>> +
>> ?#if !defined(__mcf_family_5213) && !defined(__mcf_family_51qe)
>> ? ?/* Flush & enable the caches */
>> ?#define CACR_CINV (1 << 24)
>> ?#define CACR_CENB (1 << 31)
>> ? ?__asm__ __volatile__ ("movec.l %0,%/cacr" :: "r" (CACR_CINV | CACR_CENB));
>> ?#endif
>>
>> ? ?/* Should we drop into user mode here? */
>
>
> --
> Corinna Vinschen
> Cygwin Project Co-Leader
> Red Hat
>

Regards,
___________
Rafael Campos
o0 Methril 0o
http://openblog.methril.net/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]