Rockbox Technical Forums

Rockbox Development => Starting Development and Compiling => Topic started by: pondlife on August 25, 2010, 06:26:25 AM

Title: Cygwin - unable to compile simulators
Post by: pondlife on August 25, 2010, 06:26:25 AM
I've not built a sim for a while, but whilst I can build targets ok, an attempt to build an H300 sim gives me:

Code: [Select]
...
CC apps/plugins/plugin_crt0.c
LD chessclock.rock
/home/Steve/rockbox/buildsim/apps/plugins/plugin_crt0.o: In function `atexit':
/home/Steve/rockbox/apps/plugins/plugin_crt0.c:41: multiple definition of `_atexit'
/usr/lib/gcc/i686-pc-mingw32/3.4.4/../../../../i686-pc-mingw32/lib/dllcrt2.o:dllcrt1.c:(.text+0x140): first defined here
collect2: ld returned 1 exit status
make: *** [/home/Steve/rockbox/buildsim/apps/plugins/chessclock.rock] Error 1

I've re-run rockboxdev.sh, done a make veryclean (and reconfigured), but no joy. Anyone else see this, or have a clue? (I see Rasher's sim was built, so assume it's my problem!)

pondlife
Title: Re: Cygwin - unable to compile simulators
Post by: dreamlayers on August 25, 2010, 03:00:57 PM
I tried to reproduce this by compiling a 32GB 5G iPod simulator in Cygwin, and I ran into a different error:
Code: [Select]
CC apps/alarm_menu.c
In file included from /usr/include/string.h:11,
                 from /home/Boris/Rockbox/rockbox/apps/alarm_menu.c:28:
/usr/include/sys/reent.h:185: error: parse error before "_READ_WRITE_RETURN_TYPE"
/usr/include/sys/reent.h:187: error: parse error before '(' token
That problem is fixed if I move the "#include <string.h>" to just below <stdbool.h>, above the Rockbox specific includes.  A similar sort of thing happens in apps/language.c:
Code: [Select]
CC apps/language.c:
In file included from /usr/include/string.h:11,
                 from /home/Boris/Rockbox/rockbox/apps/language.c:27:
/usr/include/sys/reent.h:185: error: parse error before '(' token
/usr/include/sys/reent.h:186: error: field `_EXFNPTR' declared as a function
There are a lot of errors after that, but I think the first error is the one that matters.  Moving "#include "string.h"" to be the first include fixes that.  Is Rockbox even supposed to be using system libc here though?  Then again, another error:
Code: [Select]
CC apps/main.c
In file included from /usr/include/time.h:11,
                 from /home/Boris/Rockbox/rockbox/firmware/export/rtc.h:27,
                 from /home/Boris/Rockbox/rockbox/apps/main.c:28:
/usr/include/sys/reent.h:185: error: parse error before "_READ_WRITE_RETURN_TYPE

Again there seems to be some conflict between system includes and Rockbox includes.  I don't feel like continuing what I've been doing to try to get through the compile, and I instead installed the gcc4 Cygwin package, resulting in installation of gcc 4.3.4-3.  I reverted the changes, made above, reconfigured, ran "make veryclean" and I again ran into similar errors:
Code: [Select]
CC apps/alarm_menu.c
In file included from /usr/include/string.h:11,
                 from /home/Boris/Rockbox/rockbox/apps/alarm_menu.c:28:
/usr/include/sys/reent.h:185: error: expected specifier-qualifier-list before ‘_READ_WRITE_RETURN_TYPE’
/usr/include/sys/reent.h:597: error: expected ‘)’ before ‘(’ token
Title: Re: Cygwin - unable to compile simulators
Post by: Lear on August 25, 2010, 03:23:55 PM
I've re-run rockboxdev.sh, done a make veryclean (and reconfigured), but no joy. Anyone else see this, or have a clue? (I see Rasher's sim was built, so assume it's my problem!)

I see it too. Maybe Rasher crosscompiles them on Linux, and avoids the problem that way? Anyway, looks like a link error introduced in r27873. When making a -shared library on Cygwin, it includes a module that defines atexit too. Probably should prefix atexit in the sim...
Title: Re: Cygwin - unable to compile simulators
Post by: funman on August 25, 2010, 03:52:56 PM
given that exit() and atexit() are standard funcs i think they should be renamed too.
Title: Re: Cygwin - unable to compile simulators
Post by: mc2739 on August 25, 2010, 06:02:19 PM
Maybe Rasher crosscompiles them on Linux, and avoids the problem that way?

If you look closely at the simulators currently on Rasher's site, you will notice that they are incomplete.  The first indication is that there is no rockbox-info.txt.  Also, there are no .rock files at all.