I'm inclined to put this work (based on the current gcc from their svn)
in our repository.

Upgrading to 4.4.0 once it's out shouldn't be hard.

Does anyone have ideas (objections or hurrays) about that ?

        Danny





On Mon, 2009-02-02 at 22:32 +0100, Vincent R. wrote:
> On Mon, 02 Feb 2009 16:56:17 +0100, Danny Backx <danny.ba...@scarlet.be>
> wrote:
> > I'm not making any promises, as I said I am a bit short on time right
> > now.
> > 
> > But what are the things we want ?
> > - gcc 4.4.x -> is it stable enough yet ?
> > - binutils 2.19 ?
> > 
> >     Danny
> > 
> Actually my trainee and I need to work on gcc trunk if we want to have a
> chance to submit patch
> one day about seh implementation. Things are moving fast and I think it's
> good to have someone 
> regularly working with gcc trunk. gcc-4.4 is pretty stable and will be
> release soon.
> Actually I have solved all my issues with mingw and now I am using a static
> crt(no more mingwxx.dll) 
> (like mingw-w64) but unfortunately I still have an issue when working with
> Dlls.
> 
> 
> Let's say I have a simple dll (testDll.c) that exports a single function
> and 
> an executable(testDllexe.c)  that calls this exported function :  
> 
> testDll.c:
> -----------
> 
> #include <windows.h>
> 
> #include <commctrl.h>
> 
> #include "testDll_API.h"
> 
> 
> 
> 
> static char big_buf[0x10000] = { '1' };
> 
> 
> 
> TESTDLL_API 
> 
> int getDLLValue( void )
> 
> {
> 
>       Sleep (1);
> 
>       
> 
>       // function below are only here so that 
> 
>       // linker add them in import section
> 
>       // to compare with mingw32ce
> 
>       TerminateProcess(0,0);
> 
>       _fcloseall();
> 
>       fflush(NULL);
> 
>       free(0);
> 
>       malloc(0);
> 
>       realloc(0,0);
> 
>       LocalFree(0);
> 
> 
> 
>       return 1;
> 
> }
> 
> 
> 
> //BOOL APIENTRY _DllMainCRTStartup( HANDLE hModule,
> 
> BOOL DllMain( HANDLE hModule,
> 
>               DWORD  ul_reason_for_call,
> 
>               LPVOID lpReserved )
> 
> {
> 
>     return TRUE;
> 
> }
> ----------------------------
> 
> arm-mingw32ce-gcc -DTESTDLL_EXPORTS testDll.c  -o testDll.o -c
> arm-mingw32ce-gcc -shared testDll.o -o testDll.dll -Wl,--strip-debug
> -Wl,--major-os-version,4 -Wl,--minor-os-version,20
> -Wl,--major-subsystem-version,4 -Wl,--minor-subsystem-version,20
> -Wl,--major-image-version,0 -Wl,--stack,0x10000
> 
> When I compile with cegcc eveyrhing's fine but when I try with cegcc-4.4,
> dll is invalid.
> 
> So first I had a look at generated asm and here is the differences :
> 
> --- testDll-4.1.s     2009-02-02 20:11:08.000000000 +0100
> +++ testDll-4.4.s     2009-02-02 20:10:23.000000000 +0100
> @@ -1,18 +1,18 @@
>       .file   "testDll.c"
>       .data
> +     .align 4
>  big_buf:
>       .byte   49
>       .space  65535
>       .text
> -     .align  0
> +     .align 4
>       .global getDLLValue
>       .def    getDLLValue;    .scl    2;      .type   32;     .endef
>  getDLLValue:
>       @ args = 0, pretend = 0, frame = 0
>       @ frame_needed = 1, uses_anonymous_args = 0
> -     mov     ip, sp
> -     stmfd   sp!, {fp, ip, lr, pc}
> -     sub     fp, ip, #4
> +     stmfd   sp!, {fp, lr}
> +     add     fp, sp, #4
>       mov     r0, #1
>       bl      Sleep
>       mov     r0, #0
> @@ -32,31 +32,32 @@
>       bl      LocalFree
>       mov     r3, #1
>       mov     r0, r3
> -     ldmfd   sp, {fp, sp, pc}
> -     .align  0
> +     ldmfd   sp!, {fp, pc}
> +     .align 4
>       .global DllMain
>       .def    DllMain;        .scl    2;      .type   32;     .endef
>  DllMain:
>       @ args = 0, pretend = 0, frame = 12
>       @ frame_needed = 1, uses_anonymous_args = 0
> -     mov     ip, sp
> -     stmfd   sp!, {fp, ip, lr, pc}
> -     sub     fp, ip, #4
> +     @ link register save eliminated.
> +     str     fp, [sp, #-4]!
> +     add     fp, sp, #0
>       sub     sp, sp, #12
> -     str     r0, [fp, #-16]
> -     str     r1, [fp, #-20]
> -     str     r2, [fp, #-24]
> +     str     r0, [fp, #-4]
> +     str     r1, [fp, #-8]
> +     str     r2, [fp, #-12]
>       mov     r3, #1
>       mov     r0, r3
> -     sub     sp, fp, #12
> -     ldmfd   sp, {fp, sp, pc}
> -     .def    LocalFree;      .scl    2;      .type   32;     .endef
> -     .def    realloc;        .scl    2;      .type   32;     .endef
> -     .def    malloc; .scl    2;      .type   32;     .endef
> -     .def    free;   .scl    2;      .type   32;     .endef
> -     .def    fflush; .scl    2;      .type   32;     .endef
> -     .def    _fcloseall;     .scl    2;      .type   32;     .endef
> -     .def    TerminateProcess;       .scl    2;      .type   32;     .endef
> +     add     sp, fp, #0
> +     ldmfd   sp!, {fp}
> +     mov     pc, lr
>       .def    Sleep;  .scl    2;      .type   32;     .endef
> +     .def    TerminateProcess;       .scl    2;      .type   32;     .endef
> +     .def    _fcloseall;     .scl    2;      .type   32;     .endef
> +     .def    fflush; .scl    2;      .type   32;     .endef
> +     .def    free;   .scl    2;      .type   32;     .endef
> +     .def    malloc; .scl    2;      .type   32;     .endef
> +     .def    realloc;        .scl    2;      .type   32;     .endef
> +     .def    LocalFree;      .scl    2;      .type   32;     .endef
>       .section .drectve
>       .ascii " -export:getDLLValue"
> 
> First we can see that with 4.1 .align directive is 0 while with 4.4 it's 4,
> and for now
> I don't know if it's normal or not but anyway I dont' think this is the
> reason of the problem.
> I tried to compile testDll.c with cegcc-4.4 and do the final link with cecc
> and Dll seems ok.
> Something is wrong with -shared ...
> 
> PS : I have also updated patch.
> 
> 
> 
> 
> 
>  
> 
-- 
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info


------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Cegcc-devel mailing list
Cegcc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cegcc-devel

Reply via email to