This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Compiling with GCC but linking with eVC?


Compiling with GCC but linking with eVC?

Postby Dave H » Mar 9, 2003 @ 4:23pm

Is it possible to compile using the GCC compiler, and then take the output of GCC (the .s assembler or the .o files) and link them into a 'normal' eVC project?
Dave H.
Lead Programmer (Repton PPC/7650)
[url=http://www.handango.com/PlatformProductDetail.jsp?productId=43741]
Buy Repton Online here!
[/url]
User avatar
Dave H
pm Member
 
Posts: 164
Joined: Oct 3, 2002 @ 5:01pm


Postby Bradskey » Mar 9, 2003 @ 9:59pm

Bradskey
pm Member
 
Posts: 35
Joined: Feb 27, 2003 @ 7:52am


Uh ?

Postby warmi » Mar 9, 2003 @ 10:02pm

warmi
pm Insider
 
Posts: 518
Joined: Aug 24, 2002 @ 8:07am
Location: Chicago USA


Uh ?

Postby Bradskey » Mar 10, 2003 @ 12:15am

Bradskey
pm Member
 
Posts: 35
Joined: Feb 27, 2003 @ 7:52am


Postby Orpe » Mar 10, 2003 @ 4:09am

User avatar
Orpe
pm Member
 
Posts: 78
Joined: Sep 16, 2001 @ 6:51pm
Location: Stockholm, Sweden


Postby refractor » Mar 10, 2003 @ 12:55pm

User avatar
refractor
pm Insider
 
Posts: 2304
Joined: Feb 5, 2002 @ 1:12pm
Location: Luxembourg


Postby Sergey Chaban » Mar 10, 2003 @ 6:58pm

Sergey Chaban
pm Member
 
Posts: 72
Joined: Nov 12, 2002 @ 1:45am


Postby angedelamort » Mar 10, 2003 @ 9:01pm

User avatar
angedelamort
pm Member
 
Posts: 304
Joined: Mar 7, 2002 @ 11:16pm
Location: Montreal, Quebec


Postby Bradskey » Mar 10, 2003 @ 9:34pm

Bradskey
pm Member
 
Posts: 35
Joined: Feb 27, 2003 @ 7:52am


Postby refractor » Mar 10, 2003 @ 10:07pm

User avatar
refractor
pm Insider
 
Posts: 2304
Joined: Feb 5, 2002 @ 1:12pm
Location: Luxembourg


Postby Dave H » Mar 11, 2003 @ 12:44am

Dave H.
Lead Programmer (Repton PPC/7650)
[url=http://www.handango.com/PlatformProductDetail.jsp?productId=43741]
Buy Repton Online here!
[/url]
User avatar
Dave H
pm Member
 
Posts: 164
Joined: Oct 3, 2002 @ 5:01pm


Postby Sergey Chaban » Mar 11, 2003 @ 4:17am

Dave, why do you think those shifts are redundant?
I'm building with cross-gcc from time to time and it's not faster than eVT, quite opposite in fact.
Anyhow, you could build cross-gcc for CE, but it's quite painful.
Here is some howto, largely from memory.
First you will need both binutils and gcc packages, binutils needed because of cross-assembler and other tools (ar, ld) that will be used during GCC build.
You could build it under both Linux and Cygwin, but it's somewhat easier under Linux.
So you downloaded both gcc & binutils source (that's about 50 Megs),
now go to binutils dir and type the following:

./configure --target=arm-wince-pe --prefix=/gcc-ce

If you're building under linux and want to produce windows-hosted tool, you'll need to add --host=i686-pc (or something like that, perhaps "cygwin" must be added).

Replace gcc-ce with whatever location you want it to be installed.
After configure script is done, type "make install", most likely the build will fail in the GDB directory (always fails for me), then go to each tool's dir and build all needed tools one be one:
cd gas
make install
cd ../ld
make install
cd ../bfd
make install
cd ../binutils
make install

Now go to gcc dir and repeat "./configure --target=arm-wince-pe --prefix=/gcc-ce" "make install"
Under Cygwin you may have to edit some system files, because they lack some endianess defines for ARM target.
You may have to tweak some of the config files to exclude thumb & hardware FPU functions from libgcc build.
etc. etc. but with some luck ;) you'll get at least some of the tools in the gcc-ce dir - I just repeated these step with gcc 3.0.3 and managed to build C++ compiler and all the tools (I had to edit some stuff in lib1funcs.asm, but that's a hack, this could be fixed in config files).

After that you could link *.o files produced by compiler using Microsoft's linker, i.e. simply add them in the eVT IDE. Linker sometimes complains about some stuff in the object file, but I haver looked into it - it just works anyway.
However as I said above you're limited to C, e.g. you can't use GAPI lib from the GCC-compiled sources because GAPI export are C++ mangled names. Similary it's not possible to link C++ code compiled with GCC to eVC-compiled code (well it's actually possible but that's a lot hand-work).

I think I could send you precompiled binaries but this stuff is rather big.

SC
Sergey Chaban
pm Member
 
Posts: 72
Joined: Nov 12, 2002 @ 1:45am


Postby Dave H » Mar 11, 2003 @ 1:06pm

Dave H.
Lead Programmer (Repton PPC/7650)
[url=http://www.handango.com/PlatformProductDetail.jsp?productId=43741]
Buy Repton Online here!
[/url]
User avatar
Dave H
pm Member
 
Posts: 164
Joined: Oct 3, 2002 @ 5:01pm


Postby Sergey Chaban » Mar 11, 2003 @ 1:30pm

Sergey Chaban
pm Member
 
Posts: 72
Joined: Nov 12, 2002 @ 1:45am


Postby Dave H » Mar 11, 2003 @ 2:13pm

Dave H.
Lead Programmer (Repton PPC/7650)
[url=http://www.handango.com/PlatformProductDetail.jsp?productId=43741]
Buy Repton Online here!
[/url]
User avatar
Dave H
pm Member
 
Posts: 164
Joined: Oct 3, 2002 @ 5:01pm


Next

Return to Windows Mobile


Sort


Forum Description

A discussion forum for mobile device developers on the Windows Mobile platform. Any platform specific topics are welcome.

Moderators:

Dan East, sponge, Digby, David Horn, Kevin Gelso, RICoder

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron