Menu

#1543 stdcall / -O2 weirdness

OTHER
closed
nobody
gcc (462)
out-of-date
Unknown
2013-01-30
2011-05-19
No

* Upgrading to MinGW / GCC 4.5.2 fails to build the Ecere SDK. *

Tarball @ http://ecere.com/cgi-bin/gitweb.cgi?p=sdk;a=snapshot;h=749c7ae207a94ffbb0a9e36b54c9090f69cc7876;sf=tbz2
With mingw installed, you should be able to just do 'mingw32-make' from the sdk/ directory .
The bootstrap compiler executables in sdk\compiler\bootstrap\obj\bin.win32 will crash (ecp/ecc/ecs) on "Building eAR command line tool..."

If optimization is disabled (take out -O2 from CFLAGS in sdk/compiler/bootstrap/ecere/Makefile) when compiling the bootstrap ecere static library the problem does not happen anymore.
If sdk/compiler/bootstrap/ecere/bootstrap/instance.c is modified to the attached version, the problem goes away as well, but we get the warnings:

Warning: resolving ___ecereDll_Load_ecere@4 by linking to ___ecereDll_Load_ecere
Warning: resolving ___ecereDll_Unload_ecere@4 by linking to ___ecereDll_Unload_ecere

Note that the work around adds __attribute__((stdcall)) to __ecereDll_Unload_ecere .
The definition for this function is WITHOUT an stdcall definition, in sdk\compiler\bootstrap\ecere\bootstrap\ecere.main.c .

Note that there are 2 instance.c files that ends up in libecereBootstrap.a (compiled as instance.c.o and instance.o)

Please contact me at jerstlouis@gmail.com by email or GTalk/Jabber if you have any questions.

Many thanks.

Jerome

--------------------------------
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=c:/program files (x86)/ecere sdk/mingw/bin/../libexec/gcc/mingw32/4.5.2/lto-wrapper.exe
Target: mingw32
Configured with: ../gcc-4.5.2/configure --enable-languages=c,c++,ada,fortran,objc,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgo
mp --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-runtime-libs --disable-werror --build=mingw32 --prefix=/mingw
Thread model: win32
gcc version 4.5.2 (GCC)

GNU ld (GNU Binutils) 2.21

Building straight from cmd.exe

Discussion

  • Jerome St-Louis

    Jerome St-Louis - 2011-05-19

    Replacing sdk/compiler/bootstrap/ecere/bootstrap/instance.c with this works around the problem

     
  • Earnie Boyd

    Earnie Boyd - 2012-06-14

    If you still experience problems please open a new report.

     
  • Earnie Boyd

    Earnie Boyd - 2012-06-14
    • status: open --> closed-out-of-date
     
  • Earnie Boyd

    Earnie Boyd - 2013-01-30
    • status: closed-out-of-date --> closed
    • resolution: --> out-of-date
    • category: --> Unknown
    • milestone: --> OTHER