cross compiling gnustep on embedded device (wince)

View: New views
8 Messages — Rating Filter:   Alert me  

cross compiling gnustep on embedded device (wince)

by Vincent R. :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I wanted to try to cross-compile core foundation to be able to play with
objective C on
my smartphone running windows CE.
I am using cegcc as a cross compiler and I have downloaded :

gnustep-make-2.2.0
gnustep-base-1.19.1

What would be the necessary steps to cross-compile and/or add support for
wince platform ?
First question is gnustep-make architecture dependent ?
I have configured and compiled gnustep-make as shown below :

./configure --prefix=/opt/mingw32ce --host=arm-mingw32ce
--target=arm-mingw32ce
make && make instal

THe problem I don't know if it handles cross-compiler and arm-*-pe targets
...

Then I tried to configure gnustep-base but I get some errors that make me
think
that it uses wrong compiler (gcc instead of arm-mingw32ce-gcc ...)

Could someone help me with this ?

Thanks



_______________________________________________
Gnustep-dev mailing list
Gnustep-dev@...
http://lists.gnu.org/mailman/listinfo/gnustep-dev

Re: cross compiling gnustep on embedded device (wince)

by Vincent R. :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, 25 Sep 2009 15:04:21 +0200, "Vincent R." <forumer@...>
wrote:

> Hi,
>
> I wanted to try to cross-compile core foundation to be able to play with
> objective C on
> my smartphone running windows CE.
> I am using cegcc as a cross compiler and I have downloaded :
>
> gnustep-make-2.2.0
> gnustep-base-1.19.1
>
> What would be the necessary steps to cross-compile and/or add support
for
> wince platform ?
> First question is gnustep-make architecture dependent ?
> I have configured and compiled gnustep-make as shown below :
>
> ./configure --prefix=/opt/mingw32ce --host=arm-mingw32ce
> --target=arm-mingw32ce
> make && make instal
>
> THe problem I don't know if it handles cross-compiler and arm-*-pe
targets
> ...
>
> Then I tried to configure gnustep-base but I get some errors that make
me
> think
> that it uses wrong compiler (gcc instead of arm-mingw32ce-gcc ...)
>
> Could someone help me with this ?

What makes me think it uses teh wrong compiler is the following error :

Making all for subproject Additions...z
 Compiling file GSCategories.m ...
GSCategories.m: In function `-[NSData(GSCategories)
initWithHexadecimalRepresentation:]':
GSCategories.m:310: warning: subscript has type `char'
GSCategories.m: At top level:
GSCategories.m:945: error: conflicting types for 'strerror_r'
/usr/include/string.h:69: error: previous declaration of 'strerror_r' was
here
GSCategories.m:945: error: conflicting types for 'strerror_r'
/usr/include/string.h:69: error: previous declaration of 'strerror_r' was
here

it seems to search for include in /usr/include while it should be in
/opt/mingw32ce/arm-mingw32ce/include


Last thing how does makefile works because usually when I enter make
command,
make file is called and processed but here this is not the case since
Makefile is almost empty.
So how does it work ?





_______________________________________________
Gnustep-dev mailing list
Gnustep-dev@...
http://lists.gnu.org/mailman/listinfo/gnustep-dev

Re: cross compiling gnustep on embedded device (wince)

by Vincent R. :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

OK I am progressing now I start to understand how makefiles works and now
I have another error :

Making all for subproject unix...
 Compiling file GSRunLoopCtxt.m ...
GSRunLoopCtxt.m: In function '-[GSRunLoopCtxt dealloc]':
GSRunLoopCtxt.m:84: error: '_efdMap' undeclared (first use in this
function)
GSRunLoopCtxt.m:84: error: (Each undeclared identifier is reported only
once
GSRunLoopCtxt.m:84: error: for each function it appears in.)
GSRunLoopCtxt.m:88: error: '_rfdMap' undeclared (first use in this
function)
GSRunLoopCtxt.m:92: error: '_wfdMap' undeclared (first use in this
function)
GSRunLoopCtxt.m: In function '-[GSRunLoopCtxt endEvent:for:]':
GSRunLoopCtxt.m:136: error: 'ET_RDESC' undeclared (first use in this
function)
GSRunLoopCtxt.m:137: error: '_rfdMap' undeclared (first use in this
function)
GSRunLoopCtxt.m:139: error: 'ET_WDESC' undeclared (first use in this
function)
GSRunLoopCtxt.m:140: error: '_wfdMap' undeclared (first use in this
function)
GSRunLoopCtxt.m:142: error: 'ET_EDESC' undeclared (first use in this
function)
GSRunLoopCtxt.m:143: error: '_efdMap' undeclared (first use in this
function)
GSRunLoopCtxt.m: In function '-[GSRunLoopCtxt initWithMode:extra:]':
GSRunLoopCtxt.m:200: error: '_efdMap' undeclared (first use in this
function)
GSRunLoopCtxt.m:202: error: '_rfdMap' undeclared (first use in this
function)
GSRunLoopCtxt.m:204: error: '_wfdMap' undeclared (first use in this
function)
GSRunLoopCtxt.m: In function '-[GSRunLoopCtxt pollUntil:within:]':
GSRunLoopCtxt.m:741: error: '_efdMap' undeclared (first use in this
function)
GSRunLoopCtxt.m:742: error: '_rfdMap' undeclared (first use in this
function)
GSRunLoopCtxt.m:743: error: '_wfdMap' undeclared (first use in this
function)
GSRunLoopCtxt.m:748: error: 'struct GSRunLoopThreadInfo' has no member
named 'inputFd'
GSRunLoopCtxt.m:776: error: 'ET_EDESC' undeclared (first use in this
function)
GSRunLoopCtxt.m:784: error: 'ET_RDESC' undeclared (first use in this
function)
GSRunLoopCtxt.m:792: error: 'ET_WDESC' undeclared (first use in this
function)
GSRunLoopCtxt.m:774: warning: enumeration value 'ET_HANDLE' not handled in
switch
GSRunLoopCtxt.m:774: warning: enumeration value 'ET_WINMSG' not handled in
switch
GSRunLoopCtxt.m:856: error: 'errno' undeclared (first use in this
function)
GSRunLoopCtxt.m:856: error: 'EINTR' undeclared (first use in this
function)
GSRunLoopCtxt.m:1011: error: 'struct GSRunLoopThreadInfo' has no member
named 'inputFd'
GSRunLoopCtxt.m: In function '+[GSRunLoopCtxt awakenedBefore:]':
GSRunLoopCtxt.m:1080: error: 'struct GSRunLoopThreadInfo' has no member
named 'inputFd'
GSRunLoopCtxt.m:1080: error: 'struct GSRunLoopThreadInfo' has no member
named 'inputFd'
GSRunLoopCtxt.m:1081: error: 'struct GSRunLoopThreadInfo' has no member
named 'inputFd'
make[4]: *** [obj/GSRunLoopCtxt.m.o] Error 1
make[3]: *** [internal-subproject-all_] Error 2

Why is it compiling subproject unix ?

Thanks



_______________________________________________
Gnustep-dev mailing list
Gnustep-dev@...
http://lists.gnu.org/mailman/listinfo/gnustep-dev

Re: cross compiling gnustep on embedded device (wince)

by David Chisnall :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 25 Sep 2009, at 16:57, Vincent R. wrote:

> Why is it compiling subproject unix ?

This will have been set by the configure script.  Did you set target  
triple when you ran ./configure?

David


_______________________________________________
Gnustep-dev mailing list
Gnustep-dev@...
http://lists.gnu.org/mailman/listinfo/gnustep-dev

Re: cross compiling gnustep on embedded device (wince)

by Vincent R. :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, 25 Sep 2009 16:59:41 +0100, David Chisnall <theraven@...>
wrote:
> On 25 Sep 2009, at 16:57, Vincent R. wrote:
>
>> Why is it compiling subproject unix ?
>
> This will have been set by the configure script.  Did you set target  
> triple when you ran ./configure?
>
> David

I did this :

cd gnustep-base
./configure --prefix=/opt/mingw32ce --host=arm-mingw32ce
--target=arm-mingw32ce
--with-ffi-include=/opt/mingw32ce/lib/libffi-3.0.8/include
--with-ffi-library=/opt/mingw32ce/lib

make target=arm-mingw32ce shared=yes



_______________________________________________
Gnustep-dev mailing list
Gnustep-dev@...
http://lists.gnu.org/mailman/listinfo/gnustep-dev

Re: cross compiling gnustep on embedded device (wince)

by Vincent R. :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, 25 Sep 2009 16:59:41 +0100, David Chisnall <theraven@...>
wrote:
> On 25 Sep 2009, at 16:57, Vincent R. wrote:
>
>> Why is it compiling subproject unix ?
>
> This will have been set by the configure script.  Did you set target  
> triple when you ran ./configure?
>
> David

I found why I think :

ifeq ($(GNUSTEP_TARGET_OS), mingw32)
libgnustep-base_SUBPROJECTS+=win32
else
libgnustep-base_SUBPROJECTS+=unix
endif


and since I am using mingw32ce it's not matched...



_______________________________________________
Gnustep-dev mailing list
Gnustep-dev@...
http://lists.gnu.org/mailman/listinfo/gnustep-dev

Re: cross compiling gnustep on embedded device (wince)

by David Chisnall :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 25 Sep 2009, at 17:06, Vincent R. wrote:

> On Fri, 25 Sep 2009 16:59:41 +0100, David Chisnall <theraven@...>
> wrote:
>> On 25 Sep 2009, at 16:57, Vincent R. wrote:
>>
>>> Why is it compiling subproject unix ?
>>
>> This will have been set by the configure script.  Did you set target
>> triple when you ran ./configure?
>>
>> David
>
> I found why I think :
>
> ifeq ($(GNUSTEP_TARGET_OS), mingw32)
> libgnustep-base_SUBPROJECTS+=win32
> else
> libgnustep-base_SUBPROJECTS+=unix
> endif
>
>
> and since I am using mingw32ce it's not matched...

You can try just tweaking it to match on mingw32ce too, but I don't  
think anyone else has tested it on a Wince machine, so you may need to  
do some tweaking to make it work if you get any errors.

David


_______________________________________________
Gnustep-dev mailing list
Gnustep-dev@...
http://lists.gnu.org/mailman/listinfo/gnustep-dev

Re: cross compiling gnustep on embedded device (wince)

by Vincent R. :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I am trying to cross-compile gnustep-make and gnustep-base and I would
have some questions and remarks/feedback in this area.

My goal is to be able to do an hello world using objective C on window
mobile device.

My current issue is the fact makefiles are adding a reference to
/usr/include and it makes
some conflict with includes from my toolchains:

vincent@vincent-pc:~/projects/GNUstep/gnustep-base-1.19.1$ make
messages=yes target=arm-mingw32ce                                        

                This is gnustep-make 2.0.8. Type 'make
print-gnustep-make-help' for help.
Making all in Source...
make[1]: entrant dans le répertoire «
/home/vincent/projects/GNUstep/gnustep-base-1.19.1/Source »
Making all in subprojects of library libgnustep-base...
make[2]: entrant dans le répertoire «
/home/vincent/projects/GNUstep/gnustep-base-1.19.1/Source/Additions »
Making all for subproject Additions...
arm-mingw32ce-gcc GSCategories.m -c \
              -MMD -MP -Wall -DGNUSTEP -DGNUSTEP_BASE_LIBRARY=1
-DGNU_RUNTIME=1 -DGNUSTEP_BASE_LIBRARY=1 -DGNUSTEP_WITH_DLL -g -Wall
-DDEBUG -fno-omit-frame-pointer -DGSWARN -DGSDIAGNOSE -Wno-import -g
-fno-strict-aliasing -fgnu-runtime -I../../Headers/Additions -I../. -I../
-I../../Headers -I.
-I/home/vincent/opt/mingw32ce-4.4.0/arm-mingw32ce/GNUstep/System/Library/Headers
-I/home/vincent/opt/mingw32ce-4.4.0/arm-mingw32ce/GNUstep/Local/Library/Headers
-I/home/vincent/opt/mingw32ce-4.4.0/arm-mingw32ce/lib/libffi-3.0.8/include
-I/usr/include -I/home/vincent/GNUstep/Library/Headers
-I/home/vincent/opt/mingw32ce-4.4.0/arm-mingw32ce/GNUstep/Local/Library/Headers
-I/home/vincent/opt/mingw32ce-4.4.0/arm-mingw32ce/GNUstep/System/Library/Headers
\
               -o obj/GSCategories.m.o
In file included from
/home/vincent/opt/mingw32ce-4.4.0/lib/gcc/arm-mingw32ce/4.4.0/../../../../arm-mingw32ce/include/windows.h:102,
                 from ../../Headers/Additions/GNUstepBase/preface.h:51,
                 from ../../Headers/Foundation/NSObjCRuntime.h:32,
                 from ../../Headers/Foundation/NSObject.h:31,
                 from ../../Headers/Foundation/FoundationErrors.h:29,
                 from ../../Headers/Foundation/Foundation.h:33,
                 from GSCategories.m:27:
/home/vincent/opt/mingw32ce-4.4.0/lib/gcc/arm-mingw32ce/4.4.0/../../../../arm-mingw32ce/include/winsock2.h:68:
error: conflicting types for 'fd_set'
/usr/include/sys/select.h:78: note: previous declaration of 'fd_set' was
here


When cross-compiling there shoudln't have -I/usr/include, in the worst
case it could be $TOOLCHAIN_ROOT/usr/include with
in my case TOOLCHAIN_ROOT=/home/vincent/opt/mingw32ce-4.4.0/arm-mingw32ce.




Thanks


_______________________________________________
Gnustep-dev mailing list
Gnustep-dev@...
http://lists.gnu.org/mailman/listinfo/gnustep-dev