Rockbox Development > Starting Development and Compiling

Cygwin - unable to compile simulators

(1/1)

pondlife:
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: ---...
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
--- End code ---

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

dreamlayers:
I tried to reproduce this by compiling a 32GB 5G iPod simulator in Cygwin, and I ran into a different error:
--- Code: ---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

--- End code ---
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: ---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
--- End code ---
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: ---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
--- End code ---

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: ---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
--- End code ---

Lear:

--- Quote from: pondlife on August 25, 2010, 06:26:25 AM ---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!)

--- End quote ---

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...

funman:
given that exit() and atexit() are standard funcs i think they should be renamed too.

mc2739:

--- Quote from: Lear on August 25, 2010, 03:23:55 PM ---Maybe Rasher crosscompiles them on Linux, and avoids the problem that way?

--- End quote ---

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.

Navigation

[0] Message Index

Go to full version