Ruben Van Boxem <vanboxem.ru...@gmail.com> said:
> 2013/11/5 <sampo-mi...@zxid.org>
> > Further investigation on this topic:
> >
> > Compiling using mingw-w64 installed from Ubuntu packages succeeds
> > without a problem.
> >
> > The ubuntu version is "MinGW-W64 Runtime 1.0 (stable - rev. 0) 0000-00-00"
> > x86_64-w64-mingw32-gcc --version:  gcc version 4.6.1 (GCC)
> > x86_64-w64-mingw32-ld --version: GNU ld (GNU Binutils) 2.21.52.20110606
> 
> You're using ancient versions of MinGW-w64. The oldest Ubuntu release
> currently supported uses version 2.0:
> http://packages.ubuntu.com/source/precise/mingw-w64
> 
> The GCC version would be 4.6.3 and binutils is 2.22.
> 
> Please ensure you are up to date. It's senseless to try and fix old
> software packages.

I agree.

But the point was that the new (3.0.0, though not necessary latest
bleeding edge git check out) software package is broken and
the old one (1.0.0) is not.

As an additional data point, I managed to make the 3.0.0 ld assert
go away by moving -Wl,--no-whole-archive flag before any of the
system libraries.

Cheers,
--Sampo

> Ruben
> 
> > My colleague tried also compiling in mingw-w64 3.0.1 environment
> > where host == target == win64. He also got assert in link phase,
> > though the exact details were different and he was not able to
> > analyze it thoroughly.
> >
> > So it definitely seems there is something wrong with later mingw-w64
> > and/or gcc and or ld when creating DLLs.
> >
> > Cheers,
> > --Sampo
> >
> > sampo-mi...@zxid.org said:
> > > Possibly two bugs really:
> > >
> > > 1. One of the autobuilds versions may be broken wrt libws2_32.a
> > > 2. ld asserts
> > >
> > > Version: MinGW-W64 Runtime 3.0 (alpha - rev. 5871) 2013-05-21
> > > File: mingw-w64-bin_i686-linux_20130523.tar.bz2 downloaded from
> > Automatic Builds
> > >       section of http://mingw-w64.sourceforge.net/download.php
> > > gcc --version: gcc (GCC) 4.9.0 20130523 (experimental)
> > > gcc -dumpmachine: x86_64-w64-mingw32
> > > Target: Windows 64bit
> > > Host: LinuxMint12 distro, uname -a
> > > Linux saz 3.0.0-17-generic #30-Ubuntu SMP Thu Mar 8 17:34:21 UTC 2012
> > i686 i686 i386 GNU/Linux
> > >
> > > I researched and this bug does not seem to have been reported previously
> > on this
> > > mailing list or as ticket.
> > >
> > > Tool chain seems to work for producing .exe files. It also appears to
> > have correctly
> > > compiled zlib, openssl, and curl - all in static library configuration.
> > >
> > > Core is produced when trying to link create (sorry for not having more
> > distilled
> > > receipe for reproduction):
> > >
> > > /apps/mingw/mingw-w64-bin_i686-linux_20130523/bin/x86_64-w64-mingw32-gcc
> >  -o zxidjava/zxidjni.dll -Wl,--add-stdcall-alias -shared -Wl,-whole-archive
> > -Wl,-no-undefined -Wl,--enable-runtime-pseudo-reloc
> > -Wl,--allow-multiple-definition zxidjava/zxid_wrap.o -L. -lzxid -mconsole
> > -L/apps/mingw/mingw-w64-bin_i686-linux_20130523/mingw/lib
> > -L/apps/mingw/mingw-w64-bin_i686-linux_20130523/mingw/lib -lcurl -lssl
> > -lcrypto -lz -lws2_32 -lwldap32 -lcrypt32 -lwinmm -lwsock32 -lgdi32
> > -lkernel32 -Wl,-no-whole-archive
> > > collect2: error: ld terminated with signal 11 [Segmentation fault]
> > >
> > /apps/mingw/mingw-w64-bin_i686-linux_20130523/bin/../lib/gcc/x86_64-w64-mingw32/4.9.0/../../../../x86_64-w64-mingw32/bin/ld:
> > /apps/mingw/mingw-w64-bin_i686-linux_20130523/mingw/lib/libws2_32.a(drfkh.o):
> > warning: illegal symbol index 1701081679 in relocs
> > >
> > /apps/mingw/mingw-w64-bin_i686-linux_20130523/bin/../lib/gcc/x86_64-w64-mingw32/4.9.0/../../../../x86_64-w64-mingw32/bin/ld:
> > /apps/mingw/mingw-w64-bin_i686-linux_20130523/mingw/lib/libws2_32.a(drfkh.o):
> > illegal relocation type 114 at address 0x72656469
> > >
> > /apps/mingw/mingw-w64-bin_i686-linux_20130523/bin/../lib/gcc/x86_64-w64-mingw32/4.9.0/../../../../x86_64-w64-mingw32/bin/ld:
> > BFD (GNU Binutils) 2.23.52.20130523 assertion fail
> > ../../../../build/binutils/src/bfd/cofflink.c:2390
> > >
> > > The core is over 80MB so here follows analysis (if you want the core
> > itself,
> > > I can make it available - or just ask me to run additional analysis
> > commands):
> > >
> > > /usr/bin/gdb
> > /apps/mingw/mingw-w64-bin_i686-linux_20130523/bin/x86_64-w64-mingw32-ld core
> > > GNU gdb (Ubuntu/Linaro 7.3-0ubuntu2) 7.3-2011.08
> > > Copyright (C) 2011 Free Software Foundation, Inc.
> > > License GPLv3+: GNU GPL version 3 or later <
> > http://gnu.org/licenses/gpl.html>
> > > This is free software: you are free to change and redistribute it.
> > > There is NO WARRANTY, to the extent permitted by law.  Type "show
> > copying"
> > > and "show warranty" for details.
> > > This GDB was configured as "i686-linux-gnu".
> > > For bug reporting instructions, please see:
> > > <http://bugs.launchpad.net/gdb-linaro/>...
> > > Reading symbols from
> > /apps/mingw/mingw-w64-bin_i686-linux_20130523/bin/x86_64-w64-mingw32-ld...done.
> > >
> > > warning: core file may not match specified executable file.
> > > [New LWP 5774]
> > >
> > > warning: Can't read pathname for load map: Input/output error.
> > > Core was generated by
> > `/apps/mingw/mingw-w64-bin_i686-linux_20130523/bin/../lib/gcc/x86_64-w64-mingw32'.
> > > Program terminated with signal 11, Segmentation fault.
> > > #0  0x080aa746 in _bfd_coff_link_input_bfd (flaginfo=0xbfc99de4,
> > input_bfd=0xb77b060)
> > >     at ../../../../build/binutils/src/bfd/cofflink.c:2464
> > > 2464 ../../../../build/binutils/src/bfd/cofflink.c: No such file or
> > directory.
> > >   in ../../../../build/binutils/src/bfd/cofflink.c
> > > (gdb) bt
> > > #0  0x080aa746 in _bfd_coff_link_input_bfd (flaginfo=0xbfc99de4,
> > input_bfd=0xb77b060)
> > >     at ../../../../build/binutils/src/bfd/cofflink.c:2464
> > > #1  0x080abbfc in _bfd_coff_final_link (abfd=0xa04ad20, info=0x8186760)
> > at ../../../../build/binutils/src/bfd/cofflink.c:927
> > > #2  0x08060d02 in ldwrite () at
> > ../../../../build/binutils/src/ld/ldwrite.c:582
> > > #3  0x0804acbb in main (argc=58, argv=0xbfc9a024) at
> > ../../../../build/binutils/src/ld/ldmain.c:420
> > > (gdb) bt full
> > > #0  0x080aa746 in _bfd_coff_link_input_bfd (flaginfo=0xbfc99de4,
> > input_bfd=0xb77b060)
> > >     at ../../../../build/binutils/src/bfd/cofflink.c:2464
> > >         h = <optimized out>
> > >         ps = 0x0
> > >         symndx = 1701081679
> > >         target_index = 8
> > >         internal_relocs = 0xe45fef8
> > >         irel = 0xe45fef8
> > >         contents = 0x3f6f4008 "r"
> > >         secdata = 0xb77ba84
> > >         n_tmask = 48
> > >         n_btshft = 4
> > >         adjust_symndx = 0
> > >         output_bfd = 0xa04ad20
> > >         strings = <optimized out>
> > >         syment_base = <error reading variable syment_base (Unhandled
> > dwarf expression opcode 0xf7)>
> > >         copy = 1
> > >         hash = 1
> > >         isymesz = <error reading variable isymesz (Unhandled dwarf
> > expression opcode 0xf7)>
> > >         osymesz = <error reading variable osymesz (Unhandled dwarf
> > expression opcode 0xf7)>
> > >         esym = 0xb77c3cc "\f\271w\v\365K"
> > >         esym_end = 0x8 <Address 0x8 out of bounds>
> > >         isymp = <optimized out>
> > >         secpp = <optimized out>
> > >         indexp = 0xe41fef4
> > >         output_index = <optimized out>
> > >         outsym = 0xe423b58 "NonIFSHandle"
> > >         sym_hash = 0xb77bffc
> > >         o = 0xb77c3cc
> > >         __PRETTY_FUNCTION__ = "_bfd_coff_link_input_bfd"
> > > #1  0x080abbfc in _bfd_coff_final_link (abfd=0xa04ad20, info=0x8186760)
> > at ../../../../build/binutils/src/bfd/cofflink.c:927
> > >         symesz = <error reading variable symesz (Unhandled dwarf
> > expression opcode 0xf7)>
> > >         flaginfo = {info = 0x8186760, output_bfd = 0xa04ad20, failed =
> > 0, global_to_static = 0, strtab = 0xccf1ab8, section_info = 0x0,
> > >           last_file_index = 48393, last_file = {_n = {_n_name =
> > ".file\000\000", _n_n = {_n_zeroes = 1818846766, _n_offset = 101},
> > >               _n_nptr = {0x6c69662e <Address 0x6c69662e out of bounds>,
> > 0x65 <Address 0x65 out of bounds>}}, n_value = 48407,
> > >             n_scnum = -2, n_flags = 0, n_type = 0, n_sclass = 103 'g',
> > n_numaux = 1 '\001'}, last_bf_index = -1, last_bf = {x_sym = {
> > >               x_tagndx = {l = 168077600, p = 0xa04a920}, x_misc =
> > {x_lnsz = {x_lnno = 1328, x_size = 2054}, x_fsize = 134612272},
> > >               x_fcnary = {x_fcn = {x_lnnoptr = 578155306048334112,
> > x_endndx = {l = 134569711, p = 0x8055eef}}, x_ary = {x_dimen = {
> > >                     43296, 2564, 1328, 2054}}}, x_tvndx = 1328}, x_file
> > = {x_fname = " \251\004\n0\005\006\b \251\004\n0\005", x_n = {
> > >                 x_zeroes = 168077600, x_offset = 134612272}}, x_scn =
> > {x_scnlen = 168077600, x_nreloc = 1328, x_nlinno = 2054,
> > >               x_checksum = 168077600, x_associated = 1328, x_comdat = 6
> > '\006'}, x_tv = {x_tvfill = 168077600, x_tvlen = 1328,
> > >               x_tvran = {2054, 43296}}, x_csect = {x_scnlen = {l =
> > 578155306048334112, p = 0xa04a920}, x_parmhash = 168077600,
> > >               x_snhash = 1328, x_smtyp = 6 '\006', x_smclas = 8 '\b',
> > x_stab = 134569711, x_snstab = 1328}, x_sc = {
> > >               x_stindx = 168077600}, x_bal = {x_balntry = 168077600},
> > x_ident = {x_timestamp = 168077600,
> > >               x_idstring = "0\005\006\b
> > \251\004\n0\005\006\b\357^\005\b0\005\006\b"}}, debug_merge = {root =
> > {table = 0xe3ffa88,
> > >               newfunc = 0x80a8470 <_bfd_coff_debug_merge_hash_newfunc>,
> > memory = 0xa1938d0, size = 4051, count = 0, entsize = 16,
> > >               frozen = 0}}, internal_syms = 0xe4049c0, sec_ptrs =
> > 0xe41bee8, sym_indices = 0xe41fd20,
> > >           outsyms = 0xe423b58 "NonIFSHandle", linenos = 0xa82afa8
> > "8\224\354?\270\331Q\n\020", contents = 0x3f6f4008 "r",
> > >           external_relocs = 0xe435348 "iderOrder", internal_relocs =
> > 0xe45fef8}
> > >         debug_merge_allocated = 1
> > >         long_section_names = <optimized out>
> > >         o = 0xa04be28
> > >         p = 0xe30ae18
> > >         max_sym_count = <optimized out>
> > >         max_lineno_count = <optimized out>
> > >         max_reloc_count = <optimized out>
> > >         max_output_reloc_count = <optimized out>
> > >         max_contents_size = <optimized out>
> > >         rel_filepos = 95520
> > >         relsz = 10
> > >         line_filepos = <optimized out>
> > >         linesz = 175020
> > >         sub = <optimized out>
> > >         external_relocs = 0x0
> > >         strbuf = "\324\232\231\r"
> > >         amt = <optimized out>
> > > #2  0x08060d02 in ldwrite () at
> > ../../../../build/binutils/src/ld/ldwrite.c:582
> > > No locals.
> > > #3  0x0804acbb in main (argc=58, argv=0xbfc9a024) at
> > ../../../../build/binutils/src/ld/ldmain.c:420
> > >         emulation = 0xbfc9b00f "i386pep"
> > >         start_time = 0
> > >         start_sbrk = 0xa03e000 ""
> > > (gdb) info registers
> > > eax            0x6564724f  1701081679
> > > ecx            0x650000 6619136
> > > edx            0xb77be28   192396840
> > > ebx            0xe45fef8   239468280
> > > esp            0xbfc99b70  0xbfc99b70
> > > ebp            0xb77b060   0xb77b060
> > > esi            0x3   3
> > > edi            0xe45fef8   239468280
> > > eip            0x80aa746   0x80aa746 <_bfd_coff_link_input_bfd+8262>
> > > eflags         0x10202  [ IF RF ]
> > > cs             0x73  115
> > > ss             0x7b  123
> > > ds             0x7b  123
> > > es             0x7b  123
> > > fs             0x0   0
> > > gs             0x33  51
> > > (gdb)
> > >
> > > The libws2_32.a file does not even contain drfkh.o as evidenced by
> > >
> > > /apps/mingw/mingw-w64-bin_i686-linux_20130523/bin/x86_64-w64-mingw32-ar
> > x
> > /apps/mingw/mingw-w64-bin_i686-linux_20130523/x86_64-w64-mingw32/lib/libws2_32.a
> > drfkh.o
> > > no entry drfkh.o in archive
> > >
> > > Same can be confirmed by ar t and rebuilding the index with ar s makes
> > no difference.
> > >
> > > Essentially it appears that something passed by gcc makes the ld look for
> > > something that does not exist - or perhaps there is some bug here.
> > >
> > > My next actions will be to compile mingw-w64 3.0.0 environment from
> > scratch
> > > rather than rely on autobuild that is not even based on officially
> > released
> > > version (the autobuild seems to be at alpha level).
> > >
> > > ubuntu mingw-w64 package seems to be at 1.0 level rather than 3.0 so I
> > will pass
> > > on that for time being, though may yet resort to it if I can't get the
> > present
> > > bug fixed.
> > >
> > > Cheers,
> > > --Sampo
> > >
> > > And since someone asked (although I do not think this is relevant after
> > uname -a):
> > >
> > > cat /proc/cpuinfo
> > > processor       : 0
> > > vendor_id       : GenuineIntel
> > > cpu family      : 6
> > > model           : 42
> > > model name      : Intel(R) Core(TM) i3-2357M CPU @ 1.30GHz
> > > stepping        : 7
> > > cpu MHz         : 800.000
> > > cache size      : 3072 KB
> > > physical id     : 0
> > > siblings        : 4
> > > core id         : 0
> > > cpu cores       : 2
> > > apicid          : 0
> > > initial apicid  : 0
> > > fdiv_bug        : no
> > > hlt_bug         : no
> > > f00f_bug        : no
> > > coma_bug        : no
> > > fpu             : yes
> > > fpu_exception   : yes
> > > cpuid level     : 13
> > > wp              : yes
> > > flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca
> > cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx rdtscp lm
> > constant_tsc arch_perfmon pebs bts xtopology nonstop_tsc aperfmperf pni
> > pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1
> > sse4_2 x2apic popcnt xsave avx lahf_lm arat epb xsaveopt pln pts dts
> > tpr_shadow vnmi flexpriority ept vpid
> > > bogomips        : 2593.94
> > > clflush size    : 64
> > > cache_alignment : 64
> > > address sizes   : 36 bits physical, 48 bits virtual
> > > power management:
> > >
> > > processor       : 1
> > > vendor_id       : GenuineIntel
> > > cpu family      : 6
> > > model           : 42
> > > model name      : Intel(R) Core(TM) i3-2357M CPU @ 1.30GHz
> > > stepping        : 7
> > > cpu MHz         : 800.000
> > > cache size      : 3072 KB
> > > physical id     : 0
> > > siblings        : 4
> > > core id         : 1
> > > cpu cores       : 2
> > > apicid          : 2
> > > initial apicid  : 2
> > > fdiv_bug        : no
> > > hlt_bug         : no
> > > f00f_bug        : no
> > > coma_bug        : no
> > > fpu             : yes
> > > fpu_exception   : yes
> > > cpuid level     : 13
> > > wp              : yes
> > > flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca
> > cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx rdtscp lm
> > constant_tsc arch_perfmon pebs bts xtopology nonstop_tsc aperfmperf pni
> > pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1
> > sse4_2 x2apic popcnt xsave avx lahf_lm arat epb xsaveopt pln pts dts
> > tpr_shadow vnmi flexpriority ept vpid
> > > bogomips        : 2594.12
> > > clflush size    : 64
> > > cache_alignment : 64
> > > address sizes   : 36 bits physical, 48 bits virtual
> > > power management:
> > >
> > > processor       : 2
> > > vendor_id       : GenuineIntel
> > > cpu family      : 6
> > > model           : 42
> > > model name      : Intel(R) Core(TM) i3-2357M CPU @ 1.30GHz
> > > stepping        : 7
> > > cpu MHz         : 800.000
> > > cache size      : 3072 KB
> > > physical id     : 0
> > > siblings        : 4
> > > core id         : 0
> > > cpu cores       : 2
> > > apicid          : 1
> > > initial apicid  : 1
> > > fdiv_bug        : no
> > > hlt_bug         : no
> > > f00f_bug        : no
> > > coma_bug        : no
> > > fpu             : yes
> > > fpu_exception   : yes
> > > cpuid level     : 13
> > > wp              : yes
> > > flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca
> > cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx rdtscp lm
> > constant_tsc arch_perfmon pebs bts xtopology nonstop_tsc aperfmperf pni
> > pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1
> > sse4_2 x2apic popcnt xsave avx lahf_lm arat epb xsaveopt pln pts dts
> > tpr_shadow vnmi flexpriority ept vpid
> > > bogomips        : 2594.26
> > > clflush size    : 64
> > > cache_alignment : 64
> > > address sizes   : 36 bits physical, 48 bits virtual
> > > power management:
> > >
> > > processor       : 3
> > > vendor_id       : GenuineIntel
> > > cpu family      : 6
> > > model           : 42
> > > model name      : Intel(R) Core(TM) i3-2357M CPU @ 1.30GHz
> > > stepping        : 7
> > > cpu MHz         : 800.000
> > > cache size      : 3072 KB
> > > physical id     : 0
> > > siblings        : 4
> > > core id         : 1
> > > cpu cores       : 2
> > > apicid          : 3
> > > initial apicid  : 3
> > > fdiv_bug        : no
> > > hlt_bug         : no
> > > f00f_bug        : no
> > > coma_bug        : no
> > > fpu             : yes
> > > fpu_exception   : yes
> > > cpuid level     : 13
> > > wp              : yes
> > > flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca
> > cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx rdtscp lm
> > constant_tsc arch_perfmon pebs bts xtopology nonstop_tsc aperfmperf pni
> > pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1
> > sse4_2 x2apic popcnt xsave avx lahf_lm arat epb xsaveopt pln pts dts
> > tpr_shadow vnmi flexpriority ept vpid
> > > bogomips        : 2594.14
> > > clflush size    : 64
> > > cache_alignment : 64
> > > address sizes   : 36 bits physical, 48 bits virtual
> > > power management:
> > >
> > >
> >
> >
> > ------------------------------------------------------------------------------
> > November Webinars for C, C++, Fortran Developers
> > Accelerate application performance with scalable programming models.
> > Explore
> > techniques for threading, error checking, porting, and tuning. Get the most
> > from the latest Intel processors and coprocessors. See abstracts and
> > register
> > http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
> > _______________________________________________
> > Mingw-w64-public mailing list
> > Mingw-w64-public@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
> >
> ------------------------------------------------------------------------------
> November Webinars for C, C++, Fortran Developers
> Accelerate application performance with scalable programming models. Explore
> techniques for threading, error checking, porting, and tuning. Get the most 
> from the latest Intel processors and coprocessors. See abstracts and register
> http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk_______________________________________________
> Mingw-w64-public mailing list
> Mingw-w64-public@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
> 

------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to