<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/64083>64083</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [llvm-libunwind] ld.lld "undefined symbol: _Unwind_Resume" Error(s)
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          ThisNekoGuy
      </td>
    </tr>
</table>

<pre>
    Example project: [Cemu](https://github.com/cemu-project/Cemu/)

The above project fails to link due to with an unwinding linker error message:
`ld.lld: error: undefined symbol: _Unwind_Resume`

-----

Flags used:
```bash
CC=clang
CXX=clang++
AR="/usr/bin/llvm-ar"
NM="/usr/bin/llvm-nm"
AS="/usr/bin/llvm-as"
RANLIB="/usr/bin/llvm-ranlib"
OBJCOPY="/usr/bin/llvm-objcopy"
CFLAGS="-g -O3 -pipe -fno-plt -fpic -fpie -Wl,-z,relro,-z,now -w \
 -fexceptions -Wp,-D_FORTIFY_SOURCE=2 \
        -Wformat -Werror=format-security \
        -fstack-clash-protection -fstack-protector-strong -fcf-protection \
        -march=znver2 -mtune=znver2 \
        --rtlib=compiler-rt -stdlib=libc++"
CXXFLAGS="${CFLAGS} -Wp,-D_GLIBCXX_ASSERTIONS"
LDFLAGS="-lc++abi -fuse-ld=lld -unwind=llvm-libunwind -pie -Wl,-O3,--sort-common,--as-needed,-z,relro,-z,now"
```

<details><summary>Terminal Output:</summary>

```make
[100%] Linking CXX executable /build/cemu-git/src/cemu/bin/Cemu_release
ld.lld: error: undefined symbol: _Unwind_Resume
>>> referenced by new:0 (/usr/bin/../include/c++/v1/new:0)
>>> CMakeFiles/CemuBin.dir/main.cpp.o:(logCPUAndMemoryInfo())
>>> referenced by main.cpp:0 (/usr/src/debug/cemu-git/cemu/src/main.cpp:0)
>>> CMakeFiles/CemuBin.dir/main.cpp.o:(infoLog_cemuStartup())
>>> referenced by main.cpp:0 (/usr/src/debug/cemu-git/cemu/src/main.cpp:0)
>>> CMakeFiles/CemuBin.dir/main.cpp.o:(_putenvSafe(char const*))
>>> referenced 6485 more times

. . .

ld.lld: error: too many errors emitted, stopping now (use --error-limit=0 to see all errors)
clang-15: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [src/CMakeFiles/CemuBin.dir/build.make:215: /build/cemu-git/src/cemu/bin/Cemu_release] Error 1
make[1]: *** [CMakeFiles/Makefile2:411: src/CMakeFiles/CemuBin.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
```
</details>
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzUVkFvozwT_jXOxXJETGiTQw4JlFU_dZtV21Wzp8jggXhrbGSbtNlf_8lASLLb7r7a9_QihPB45pmxx_N4mLWiVAALFK1QlIxY43baLJ52wt7Di_7UHEaZ5ofFzRuragm4Nvo75A6FS4yiVQxVg6IE0dnOudqicIloimhaCrdrsnGuK0TTHKqGHO1o2tp4rTkKEhQsu-_TDjDL9H7wgAsmpMVOYynUC-YN-P9X4XaYKdyoV6G4UGU7CwaDMdrgCqxlJfg4OuyrQPKxlNzH26r4n0ZxKIQCju2hyrT0su3XFnH7ALapAF0F58ER_5wLUslKixsL_NxV92bM7jpRHKMwySVTZT_ebAYBXfm3FS8fUJggShFNG2sQTTOhEE2l3FeEGT_Rqt1__lhNVYPa8vE3aHZQe1je392uPlY1TEmRDerr1f_i9ZdvH-vr7Huu68NgEKd3y099KKTEZB1iUosaMCmUJrV0mBS1yNsvYPIsEY3JD0RjA9Lo40DpV0xeMYriDhWTAt5yqJ3QymLyXHvFZJuuH55u02_bx_XXh_gGhQk9M-kf8lxoUzGHyXN_EJJOQCzkjRHu8I5NYR3LX0gumd35I-wg966HiV6kDbHOaFViUuTFueKvkBUz-Q6FyQ-1B0MxqVyj4DT-1YAY5zMRJrmuaiHBEOMwsY53UimyvD9Nw95vNme7j-gUXa_6fFwnp137dH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