<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Linking shared library fails on Win7 64-bit with mingw64 gcc-4.8.1"
   href="http://llvm.org/bugs/show_bug.cgi?id=16648">16648</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Linking shared library fails on Win7 64-bit with mingw64 gcc-4.8.1
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Build scripts
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Makefiles
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>callum.a.rogers@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=10892" name="attach_10892" title="Patch from LLVM 3.3 release with modified version of Makefile.rules that uses  .a.o  instead of   .def">attachment 10892</a> <a href="attachment.cgi?id=10892&action=edit" title="Patch from LLVM 3.3 release with modified version of Makefile.rules that uses  .a.o  instead of   .def">[details]</a></span>
Patch from LLVM 3.3 release with modified version of Makefile.rules that uses 
.a.o  instead of   .def

I ran

  ./configure --enable-shared --enable-jit --enable-targets=host
  make

on Windows 7 using mingw64 and gcc-4.8.1; it all went fine until it reached
stage for linking the share library:

llvm[1]: Linking Release+Asserts Shared Library LLVM-3.3.dll
...
... tens of thousands of like below
...
Cannot export ZThn8_NK4llvm14PassNameParser15printOptionInfoERKNS_2cl6OptionEy:
symbol not defined
Cannot export ZZN4llvm13BallLarusNodeC1EPNS_10BasicBlockEE7nextUID: symbol not
defined
Cannot export
ZZN4llvm16MipsDAGToDAGISel10SelectCodeEPNS_6SDNodeEE12MatcherTable: symbol not
defined
Cannot export ZZN4llvm7hashing6detail18get_execution_seedEvE4seed: symbol not
defined
Cannot export
ZZNK4llvm16PPCFrameLowering24getCalleeSavedSpillSlotsERjE13darwinOffsets:
symbol not defined
Cannot export
ZZNK4llvm16PPCFrameLowering24getCalleeSavedSpillSlotsERjE15darwin64Offsets:
symbol not defined
Cannot export
ZZNK4llvm16PPCFrameLowering24getCalleeSavedSpillSlotsERjE7Offsets: symbol not
defined
Cannot export
ZZNK4llvm16PPCFrameLowering24getCalleeSavedSpillSlotsERjE9Offsets64: symbol not
defined
Cannot export ZnwyRN4llvm16BumpPtrAllocatorE: symbol not defined
Cannot export _jit_debug_descriptor: symbol not defined
Cannot export _jit_debug_register_code: symbol not defined
collect2.exe: error: ld returned 1 exit status


Now, I found this other <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Linking shared library fails on Win7 64-bit with x64_64-w64-mingw32-gcc-4.6.3"
   href="show_bug.cgi?id=12795">bug #12795</a>: <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Linking shared library fails on Win7 64-bit with x64_64-w64-mingw32-gcc-4.6.3"
   href="show_bug.cgi?id=12795">http://llvm.org/bugs/show_bug.cgi?id=12795</a>
which fixed it by replacing "LLVM-3.0.def" with "LLVM-3.0.a.o" (I have no idea
what this is doing) so I (manually) applied the patch to LLVM-3.3 and tried it
out (patch as attachment), but it still has errors:


llvm[1]: Linking Release+Asserts Shared Library LLVM-3.3.dll
c:/mingw-builds/x64-4.8.1-posix-seh-rev2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../x86_64-w64-mingw32/bin/ld.exe:
c:/Users/Callum/compili
ng/llvm-3.3.src/llvm-3.3.src/tools/llvm-shlib/Release+Asserts/LLVM-3.3.a.o:
warning: COMDAT symbol '.pdata$_ZNK4llvm9MCAsmInfo28getNonexecutableStackSectio
nERNS_9MCContextE' does not match section name '.pdata'
c:/mingw-builds/x64-4.8.1-posix-seh-rev2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../x86_64-w64-mingw32/bin/ld.exe:
c:/Users/Callum/compili
ng/llvm-3.3.src/llvm-3.3.src/tools/llvm-shlib/Release+Asserts/LLVM-3.3.a.o:
warning: COMDAT symbol '.xdata$_ZNK4llvm9MCAsmInfo28getNonexecutableStackSectio
nERNS_9MCContextE' does not match section name '.xdata'
c:/Users/Callum/compiling/llvm-3.3.src/llvm-3.3.src/tools/llvm-shlib/Release+Asserts/LLVM-3.3.a.o:JIT.cpp:(.text+0x51ff37):
undefined reference to `__regis
ter_frame'
c:/Users/Callum/compiling/llvm-3.3.src/llvm-3.3.src/tools/llvm-shlib/Release+Asserts/LLVM-3.3.a.o:JIT.cpp:(.text+0x51ff48):
undefined reference to `__dereg
ister_frame'
c:/Users/Callum/compiling/llvm-3.3.src/llvm-3.3.src/tools/llvm-shlib/Release+Asserts/LLVM-3.3.a.o:SectionMemoryManager.cpp:(.text+0xda3e7b):
undefined refe
rence to `__register_frame'
c:/mingw-builds/x64-4.8.1-posix-seh-rev2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../x86_64-w64-mingw32/bin/ld.exe:
c:/Users/Callum/compili
ng/llvm-3.3.src/llvm-3.3.src/tools/llvm-shlib/Release+Asserts/LLVM-3.3.a.o: bad
reloc address 0x3 in section `.text$_ZN4llvm17SparcELFMCAsmInfoD1Ev[_ZN4llv
m17SparcELFMCAsmInfoD1Ev]'
collect2.exe: error: ld returned 1 exit status
/c/Users/Callum/compiling/llvm-3.3.src/llvm-3.3.src/Makefile.rules:1256: recipe
for target `/c/Users/Callum/compiling/llvm-3.3.src/llvm-3.3.src/Release+Ass
erts/bin/LLVM-3.3.dll' failed
make[1]: ***
[/c/Users/Callum/compiling/llvm-3.3.src/llvm-3.3.src/Release+Asserts/bin/LLVM-3.3.dll]
Error 1
make[1]: Leaving directory
`/c/Users/Callum/compiling/llvm-3.3.src/llvm-3.3.src/tools/llvm-shlib'
/c/Users/Callum/compiling/llvm-3.3.src/llvm-3.3.src/Makefile.rules:876: recipe
for target `all' failed
make: *** [all] Error 1


How do you think we can fix this? I think this is blocking the creation of any
windows binaries (see there are no 3.3 binaries available even on the website).</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>