Author Topic: Problems compiling on GCC  (Read 21231 times)

Offline coflynn

  • Newbie
  • *
  • Posts: 6
    • View Profile
Problems compiling on GCC
« on: January 06, 2009, 03:45:05 AM »
Hello,

I was compiling uTasker on GCC using YAGARTO, and came across a few problems/bugs:

#1:

SAM7X.C, line 255:

Currently reads:
Code: [Select]
    #if defined _GNU || define ROWLEY
Should be:
Code: [Select]
    #if defined _GNU || defined ROWLEY

#2:

..\..\..\Hardware\SAM7X\SAM7X.c:850: error: invalid storage class for functio
fnPhyInterrupt'

This is due to a change in recent versions of GCC I think... the function decleration needs to be moved outside the function, as so:

Code: [Select]
#ifdef SUPPORT_PORT_INTERRUPTS
    #if defined INTERRUPT_TASK_PHY
    static void fnPhyInterrupt(void);
#endif
#endif

// Ethernet configuration routine
//
extern void fnConfigEthernet(ETHTABLE *pars)
{
#ifdef SUPPORT_PORT_INTERRUPTS
    #if defined INTERRUPT_TASK_PHY
    INTERRUPT_SETUP interrupt_setup;                                     // interrupt configuration parameters
    #endif
#else
    __interrupt void PortB_Interrupt(void);                              // phy interrupt
#endif

Described at http://lists.apple.com/archives/unix-porting/2005/Jul/msg00038.html

Regards,

  -Colin

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3243
    • View Profile
    • uTasker
Re: Problems compiling on GCC
« Reply #1 on: January 06, 2009, 04:08:07 AM »
Hi Colin

Thanks for the feedback.

- The ROWLEY typo is probably quite old but did not seem to cause any problems(?)
- I admit to not testing SP4 with GCC (was busy with new IAR5 and Keil setups...) and GCC doesn't like prototypes declares in a function. I have corrected this in my reference version:

#if defined SUPPORT_PORT_INTERRUPTS && defined INTERRUPT_TASK_PHY        // {50}
    static void fnPhyInterrupt(void);
#endif



SUPPORT_PORT_INTERRUPTS is new in SP4 and allows defining user interrupts to falling, rising or both edges of any GPIO [see example when define IRQ_TEST set in application.h - in fnInitIRQ()]. However it involved reworking the original PHY interrupt line since it was previously quite a dedicated solution.

Regards

Mark

Offline coflynn

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Problems compiling on GCC
« Reply #2 on: January 06, 2009, 04:22:43 AM »
Hi,

Quote
- The ROWLEY typo is probably quite old but did not seem to cause any problems(?)

Gave me a hard error on my YAGARTO GCC (4.3.2)... not sure why it wasn't caught before!

Quote
I have corrected this in my reference version:

Alright great! Yes I wasn't sure the best way to fix it - I just made the compiler happy ;-)

Regards,

  -Colin

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3243
    • View Profile
    • uTasker
Re: Problems compiling on GCC
« Reply #3 on: January 06, 2009, 04:58:11 AM »
Colin

You are right. I checked SP3 which did it as follows:

    #ifdef ROWLEY
        #define __root
    #endif

... at a different location...
    #ifdef _GNU
        #define __root
    #endif


Therefore it was a typo when making it conditional on GCC and ROWLEY at the same location.

Corrected as:
    #if defined _GNU || defined ROWLEY                                   // {49}
        #define __root
    #endif

in my reference.

Regards

Mark