This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Compiling ACE 5.3 testcase Service_Config_DLL.cpp causes ICE using MinGW under cygwin
- From: "Michael H. Cox" <mhcox at bluezoosoftware dot com>
- To: "ACE Bugs" <ace-bugs at cs dot wustl dot edu>
- Cc: "GCC Bugs" <gcc-bugs at gcc dot gnu dot org>,"MinGW Users" <mingw-users at lists dot sourceforge dot net>
- Date: Mon, 27 Jan 2003 12:56:56 -0700
- Subject: Compiling ACE 5.3 testcase Service_Config_DLL.cpp causes ICE using MinGW under cygwin
- Reply-to: <mhcox at bluezoosoftware dot com>
Below is an ACE problem report containing all the pertinent information.
The distilled code produces an internal compiler error in g++, so I assume
the bug is primarily in GCC. There is some strangeness in the ACE code that
*defines* a function as a dllimport when it probably should be a dllexport.
See below for the details...
ACE VERSION: 5.3
HOST MACHINE and OPERATING SYSTEM:
Pentium III 800MHz w/128MB and two SCSI hard drives: one mounted as
C: the other mounted as a volume at C:\home.
Full cygwin 1.3.18-1 install running under Win2K Advanced Server SP3
using WINSOCK 2.0 (5.00.2195.4874). Cygwin installed at C:\cygwin
and Win2K volume mounted at C:\home. C:\home is mounted at /home
under the cygwin environment. Environment variable ACE_ROOT set to
"c:/home/mhcox/projects/build/ACE-TAO/ACE_wrappers".
TARGET MACHINE and OPERATING SYSTEM, if different from HOST: Same.
COMPILER NAME AND VERSION (AND PATCHLEVEL): g++ -v output:
Reading specs from c:/MinGW/bin/../lib/gcc-lib/mingw32/3.2/specs
Configured with: ../gcc/configure --with-gcc --with-gnu-ld --with-gnu-as
--host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-n
ls
--enable-languages=f77,c++,objc,ada --disable-win32-registry --disable-share
d
Thread model: win32
gcc version 3.2 (mingw special 20020817-1)
Note: this is NOT the cygwin compiler, but mingw32 2.0.0-3
(GCC 3.2 equivalent) with patch packages (binutils-2.13.90-20021006-2,
mingw-runtime-2.3, and w32api-2.1) from from mingw.org. Installed at
C:\MinGW and cygwin mounted at /mingw. Environment variable MINGW_BASE
is set to "C:\MinGW".
CONTENTS OF $ACE_ROOT/ace/config.h:
// Should this be in config-g++-common.h for __GNU__>2?
#define ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION
#include "ace/config-win32.h"
CONTENTS OF $ACE_ROOT/include/makeinclude/platform_macros.GNU (unless
this isn't used in this case, e.g., with Microsoft Visual C++):
exceptions=1
rtti=1
include $(ACE_ROOT)/include/makeinclude/platform_mingw32.GNU
AREA/CLASS/EXAMPLE AFFECTED:
DOES THE PROBLEM AFFECT:
COMPILATION? Yes.
LINKING? No.
On Unix systems, did you run make realclean first? Yes.
EXECUTION? No.
OTHER (please specify)? N/A, only affects ACE.
SYNOPSIS:
Compiling testcase Service_Config_DLL.cpp causes ICE using MinGW
compiler
under cygwin.
DESCRIPTION:
While trying to build ACE+TAO using the MinGW compiler under cygwin, the
compiler had an internal compiler error. See the code below to
reproduce.
REPEAT BY:
Compiling the following source distilled from Service_Config_DLL.cpp
will
cause an ICE using the command line "g++ ICE.cpp":
// ICE.cpp: Distilled version of test case Service_Config_DLL.cpp from
// ACE 5.3 that causes an ICE in g++ 3.2 mingw:
// ICE.cpp: In function `void _make_Service_Config_DLL(void*)':
// ICE.cpp:24: Internal compiler error in rest_of_compilation, at
toplev.c:3491
// Please submit a full bug report,
// with preprocessed source if appropriate.
// See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
extern "C"
{
__attribute__((dllimport)) void _make_Service_Config_DLL (void *);
typedef void (*ACE_SERVICE_ALLOCATOR) (void *);
}
// Commenting out the line of code below changes ICE to a syntax error:
// ICE.cpp:22: function `void _make_Service_Config_DLL(void*)' definition is
marked dllimport
ACE_SERVICE_ALLOCATOR alloc_ = &_make_Service_Config_DLL;
// This should probably be __attribute__((dllexport)), but even changing it
// still produces ICE.
extern "C" __attribute__((dllimport))
void _make_Service_Config_DLL (void *gobbler)
{
}
//EOF
SAMPLE FIX/WORKAROUND:
N/A.