dev builds
themes manual
device status forums
mailing lists
IRC bugs
dev guide

Rockbox mail archive

Subject: Re: Should the sim compile cleanly in Cygwin using i686-w64-mingw32-gcc?

Re: Should the sim compile cleanly in Cygwin using i686-w64-mingw32-gcc?

From: Rafaël Carré <>
Date: Mon, 5 Dec 2011 12:53:30 -0500

Le Mon, 05 Dec 2011 12:37:20 -0500,
Boris Gjenero <> a écrit :

> Originally, in Windows the sim was supposed to compile via old Cygwin
> gcc-3, with the -mno-cygwin switch supplied by sdl-config. I'm now using
> Cygwin gcc-4 which doesn't support -mno-cygwin, and SDL from,
> which doesn't supply -mno-cygwin. Instead, I can cross compile from
> Cygwin using i686-w64-mingw32-gcc.
> Is this something that should work, and compile without warnings? If it
> should be considered unsupported, is there another alternative method
> that is supposed to work without warnings?
> There used to be a multiple definition error requiring
> -Wl,--allow-multiple-definition, but that was fixed in r31147.
> The only remaining error is FS#12427 due to __attribute__(weak) being
> different on Windows.
> Besides that, there are lots of warnings.
> Most warnings are due to MinGW prototypes having __declspec(dllimport)
> and Rockbox prototypes not having it. It's possible to use #ifndef to
> remove prototypes in firmware/include/strcasecmp.h when the function
> names are defined by the preprocessor. However
> apps/plugins/lib/pluginlib_exit.h intentionally includes <stdlib.h> to
> "make sure we are in sync with the real definitions, especially on
> hosted systems". It's possible to remove the __declspec(dllimport) via
> "-D_CRTIMP=". This just means imported functions will be called via
> stubs which jump to the location stored in a pointer, instead of the
> call directly using the pointer.
> Some other warnings are due to use of z in format specifiers, for
> printing size_t data. This warning is false for things displayed on the
> simulated device (eg. panicf()), but z really does not work when
> printing directly to standard output (eg. DEBUGF()).

if you define __USE_MINGW_ANSI_STDIO then the unix format specifiers
should be used instead of incompatible microsoft format (and %zu should work)

> Regards,
> Boris

Rafaël Carré
Received on 2011-12-05

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy