Rocking the blogosphere
Apple Online Store

Patch to make leJOS compile with gcc4

When I was trying to build leJOS on Mac OS X Tiger 10.4.3 with gcc4 (from Xcode 2.2):

$ gcc_select
Current default compiler:
gcc version 4.0.1 (Apple Computer, Inc. build 5247)

I was getting this error:

====> Making leJOS Unix binaries (lejos, for emulation)
cd unix_impl; make OSTYPE=darwin
gcc -I../vmsrc -I. -Wall -Wno-unused -c ../vmsrc/threads.c
../vmsrc/threads.c: In function 'switch_thread':
../vmsrc/threads.c:326: error: label at end of compound statement
make[1]: *** [threads.o] Error 1
make: *** [tinyvm_emul] Error 2

This is simple to fix by applying this patch:

--- threads.c.orig      2006-01-07 08:37:40.000000000 -0800
+++ threads.c   2006-01-07 08:37:48.000000000 -0800
@@ -321,6 +321,7 @@
                }
             }
 done_pi:
+            ;
 #endif // PI_AVOIDANCE

           }

Del.icio.us Digg Reddit Technorati

Possibly related posts

Comments

  1. Tim Visher
    November 6th, 2006 | 9:01 am

    Hi,

    I’m getting the exact same error. I already went through and added “-source 1.3″ to all of the make files and such, but now I’m getting this error. Unfortunately (I think I’m about to reveal a touch of newbie in me), I don’t understand how to apply the patch that you have there. Do I just change the code in threads.c to match that code?

    Thanks for any help!

    Timmy V.

  2. Andre S.
    January 1st, 2007 | 3:41 pm

    Just add ; on a new line after ‘done_pi:’ at line 323. :)

  3. Denys Vorobyov
    September 30th, 2007 | 7:00 pm

    Thank you Marc!

Leave a reply

Apple Online Store
Apple Online Store