<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - ObjC incorrectly using DWARF exception handling with MinGW-w64 and GNU Objective-C runtime"
   href="https://bugs.llvm.org/show_bug.cgi?id=48348">48348</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>ObjC incorrectly using DWARF exception handling with MinGW-w64 and GNU Objective-C runtime
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>11.0
          </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>-New Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>frederik@algoriddim.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Building Objective-C code on Windows using the gnustep-2.0 ObjC runtime in a
MinGW-w64 environment and using SEH exception handling incorrectly generates
code with DWARF exception handling.

```
$ clang -I/c/GNUstep/x64/include/ -L/c/GNUstep/x64/lib/ -lobjc
-fobjc-runtime=gnustep-2.0 -fuse-ld=lld test.m -v
clang version 11.0.0 (<a href="https://github.com/msys2/MINGW-packages">https://github.com/msys2/MINGW-packages</a>
c0083b9edc111315c868f9c53dd60aaa78d1669b)
Target: x86_64-w64-windows-gnu
Thread model: posix
InstalledDir: C:\msys64\mingw64\bin
 "C:\\msys64\\mingw64\\bin\\clang.exe" -cc1 -triple x86_64-w64-windows-gnu
-emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names
-main-file-name test.m -mrelocation-model pic -pic-level 2 -mframe-pointer=none
-fmath-errno -fno-rounding-math -mconstructor-aliases -mms-bitfields
-munwind-tables -target-cpu x86-64 -debugger-tuning=gdb -v -resource-dir
"C:\\msys64\\mingw64\\lib\\clang\\11.0.0" -I C:/GNUstep/x64/include/
-internal-isystem "C:\\msys64\\mingw64\\lib\\clang\\11.0.0\\include"
-internal-isystem
"C:\\msys64\\mingw64\\x86_64-w64-mingw32/sys-root/mingw/include"
-internal-isystem "C:\\msys64\\mingw64\\x86_64-w64-mingw32\\include"
-internal-isystem "C:\\msys64\\mingw64\\include" -fdebug-compilation-dir
"C:\\Dev" -ferror-limit 19 -fmessage-length=164 -fno-use-cxa-atexit
-fgnuc-version=4.2.1 -fobjc-runtime=gnustep-2.0
-fobjc-dispatch-method=non-legacy -fobjc-exceptions -fexceptions
-fseh-exceptions -fcolor-diagnostics -faddrsig -o
"C:\\msys64\\tmp\\test-c8678f.o" -x objective-c test.m
clang -cc1 version 11.0.0 based upon LLVM 11.0.0 default target
x86_64-w64-windows-gnu
 "C:\\msys64\\mingw64\\bin\\ld.lld" -m i386pep -Bdynamic -o a.exe
"C:\\msys64\\mingw64\\x86_64-w64-mingw32\\lib\\crt2.o"
"C:\\msys64\\mingw64\\lib\\gcc\\x86_64-w64-mingw32\\10.2.0\\crtbegin.o"
-LC:/GNUstep/x64/lib/
"-LC:\\msys64\\mingw64\\lib\\gcc\\x86_64-w64-mingw32\\10.2.0"
"-LC:\\msys64\\mingw64\\x86_64-w64-mingw32\\lib" "-LC:\\msys64\\mingw64\\lib"
"-LC:\\msys64\\mingw64\\x86_64-w64-mingw32/sys-root/mingw/lib" -lobjc
"C:\\msys64\\tmp\\test-c8678f.o" -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex
-lmsvcrt -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc
-lgcc_eh -lmoldname -lmingwex -lmsvcrt -lkernel32
"C:\\msys64\\mingw64\\lib\\gcc\\x86_64-w64-mingw32\\10.2.0\\crtend.o"
lld-link: error: undefined symbol: objc_begin_catch
<span class="quote">>>> referenced by C:\msys64\tmp\test-c8678f.o:(test)</span >

lld-link: error: undefined symbol: objc_end_catch
<span class="quote">>>> referenced by C:\msys64\tmp\test-c8678f.o:(test)</span >

lld-link: error: undefined symbol: __gnustep_objc_personality_v0
<span class="quote">>>> referenced by C:\msys64\tmp\test-c8678f.o:(.xdata)</span >
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

Also happens for i686 when manually specifying -fseh-exceptions.</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>