cross compile-script adaptation for gcc 4.3/4.4

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

cross compile-script adaptation for gcc 4.3/4.4

by Hin-Tak Leung :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hiya,

I have not had any luck with cross-compiling gcc 4.3.x/4.4.x using the cross-script, but fedora 11 started shipping a gcc 4.4-based compiler in April anyway, so I haven't bothered with it much any more until this weekend. Anyway, I finally found the problem after some hours - it is an assumption which x86-mingw32-build.sh makes which is no-longer true in gcc 4.3 onwards: around line 108 for building and installing stage 1,
instead of this:
ALL_GCC="all-gcc" INSTALL_GCC=install-gcc

for gcc 4.3 onwards, libgcc is splitted out, and something like this is required:
ALL_GCC="all-gcc all-target-libgcc" INSTALL_GCC="install-gcc install-target-libgcc"
otherwise crtbegin.o and friends (part of libgcc) aren't built and installed and one gets into trouble during mingwrt building.

I'll file a bug as well, just so this is not forgotten...

Thanks for the script anyway - it has served a purpose for a couple of years...
Hin-Tak


     


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
MinGW-dvlpr mailing list
MinGW-dvlpr@...
https://lists.sourceforge.net/lists/listinfo/mingw-dvlpr

Parent Message unknown Re: cross compile-script adaptation for gcc 4.3/4.4

by Hin-Tak Leung :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

--- On Mon, 14/9/09, Hin-Tak Leung <hintak_leung@...> wrote:

> Hiya,
>
> I have not had any luck with cross-compiling gcc
> 4.3.x/4.4.x using the cross-script, but fedora 11 started
> shipping a gcc 4.4-based compiler in April anyway, so I
> haven't bothered with it much any more until this weekend.
> Anyway, I finally found the problem after some hours - it is
> an assumption which x86-mingw32-build.sh makes which is
> no-longer true in gcc 4.3 onwards: around line 108 for
> building and installing stage 1,
> instead of this:
> ALL_GCC="all-gcc" INSTALL_GCC=install-gcc
>
> for gcc 4.3 onwards, libgcc is splitted out, and something
> like this is required:
> ALL_GCC="all-gcc all-target-libgcc"
> INSTALL_GCC="install-gcc install-target-libgcc"
> otherwise crtbegin.o and friends (part of libgcc) aren't
> built and installed and one gets into trouble during mingwrt
> building.
>
> I'll file a bug as well, just so this is not forgotten...

I have filed at the bug tracker. I thought I'll have a go at switching to dw2 exception handling also; and encountered a deeper problem in the same area of code.

To get to dw2, the first thing is setting --enable-shared in base options;
however, that gets into a chicken and egg problem: the shared version of libgcc_s.dll needs part of the runtime target (crtldll2.o) to build, but crtbegin.o/crtend.o (from the libgcc target) is required for building the runtime.

So I worked around this by modifying the script further so that gcc stage1 and stage2 are further differentiated besides the make/make-install; the first stage must be run with ./configure --disable-shared ; it is also necessary to remove the config.status cache or do something a bit more drastic(like make distclean) than just re-running ./configure --enable-shared in the 2nd stage - part of classpath or libjava gets a bit confused by re-configure with different flags.
   



     

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
MinGW-dvlpr mailing list
MinGW-dvlpr@...
https://lists.sourceforge.net/lists/listinfo/mingw-dvlpr