Bug 10342 - Compile fails for x86_64-w64-mingw32
Summary: Compile fails for x86_64-w64-mingw32
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: JIT ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-02-16 02:32 UTC by Alistair Leslie-Hughes
Modified: 2014-12-01 04:17 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Alistair Leslie-Hughes 2013-02-16 02:32:11 UTC
configure --prefix=/xxx/xxxx --build=i686-pc-linux-gnu --target=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --with-tls=none --disable-mcs-build --enable-win32-dllmain=yes --with-libgc-threads=win32 PKG_CONFIG=false mono_cv_clang=no

Gives the following error when compiling
 CC     mallocx.lo
libtool: compile:  x86_64-w64-mingw32-gcc -DPACKAGE_NAME=\"libgc-mono\" -DPACKAGE_TARNAME=\"libgc-mono\" -DPACKAGE_VERSION=\"6.6\" "-DPACKAGE_STRING=\"libgc-mono 6.6\"" -DPACKAGE_BUGREPORT=\"Hans_Boehm@hp.com\" -DPACKAGE_URL=\"\" -DGC_WIN32_THREADS=1 -DNO_GETENV=1 -DGC_INSIDE_DLL=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DLT_OBJDIR=\".libs/\" -DSILENT=1 -DNO_SIGNALS=1 -DNO_EXECUTE_PERMISSION=1 -DJAVA_FINALIZATION=1 -DGC_GCJ_SUPPORT=1 -DATOMIC_UNCOLLECTABLE=1 -D_IN_LIBGC=1 -I./include -I./.. -I./.. -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -D_WIN32_IE=0x0501 -D_UNICODE -DUNICODE -DWIN32_THREADS -DFD_SETSIZE=1024 -D__default_codegen__ -g -mno-tls-direct-seg-refs -MT mallocx.lo -MD -MP -MF .deps/mallocx.Tpo -c mallocx.c  -DDLL_EXPORT -DPIC -o .libs/mallocx.o
In file included from ./include/private/../gc.h:33:0,
                 from ./include/private/gc_priv.h:46,
                 from mallocx.c:25:
./include/private/../gc_config_macros.h:35:0: warning: "GC_WIN32_THREADS" redefined [enabled by default]
<command-line>:0:0: note: this is the location of the previous definition
In file included from ./include/private/gc_priv.h:66:0,
                 from mallocx.c:25:
./include/private/gcconfig.h:2062:0: warning: "MACH_TYPE" redefined [enabled by default]
./include/private/gcconfig.h:1104:0: note: this is the location of the previous definition
mallocx.c:34:1: error: initializer element is not constant
mallocx.c:35:1: error: initializer element is not constant
mallocx.c:36:1: error: initializer element is not constant
mallocx.c:38:5: error: initializer element is not constant
mallocx.c:72:12: warning: 'GC_realloc' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
mallocx.c:226:10: warning: 'GC_malloc_ignore_off_page' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
mallocx.c:236:10: warning: 'GC_malloc_atomic_ignore_off_page' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
mallocx.c:536:12: warning: 'GC_malloc_uncollectable' redeclared without dllimport attribute after being referenced with dll linkage [enabled by default]
mallocx.c:638:12: warning: 'GC_malloc_atomic_uncollectable' redeclared without dllimport attribute after being referenced with dll linkage [enabled by default]
make[1]: *** [mallocx.lo] Error 1
make[1]: Leaving directory `/home2/source/mono/libgc'
Comment 1 Zoltan Varga 2013-02-19 13:04:34 UTC
Cross compiling mono is not very well supported, esp targeting windows.
Comment 2 Alistair Leslie-Hughes 2013-02-20 03:20:42 UTC
I've just done some more research.  Its appears to be a GCC bug that is fixed for the GCC 4.8 build. (My mingw package is 4.6.3)

http://sourceforge.net/tracker/?func=detail&aid=2364034&group_id=202880&atid=983354
Comment 3 Zoltan Varga 2014-12-01 04:17:21 UTC
This was fixed a long time ago.