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

    <tr>
        <th>Summary</th>
        <td>
            Crash report - issue when used in emcc
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          dodds-cc
      </td>
    </tr>
</table>

<pre>
    Hi everyone, 

I was asked in the llvm console logs to submit the following crash backtrace. We're using clang `20.0.0` via emscripten `3.1.65`


```
em++: error: '/Users/tomdodds/Workspace/libs/emsdk/upstream/bin/wasm-ld @/var/folders/rr/3x4g4qwd4ns650k8gs7h5_br0000gn/T/emscripten_8nrh2l2f.rsp.utf-8' failed (received SIGSEGV (-11))

Stack dump:
0.      Program arguments: /Users/tomdodds/Workspace/libs/emsdk/upstream/bin/wasm-ld @/var/folders/rr/3x4g4qwd4ns650k8gs7h5_br0000gn/T/emscripten_8nrh2l2f.rsp.utf-8
1. Running pass "cgscc(function-attrs)" on module "ld-temp.o"
 #0 0x00000001026b9794 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/Users/tomdodds/Workspace/libs/emsdk/upstream/bin/lld+0x100131794)
 #1 0x00000001026b7564 llvm::sys::RunSignalHandlers() (/Users/tomdodds/Workspace/libs/emsdk/upstream/bin/lld+0x10012f564)
 #2 0x00000001026ba3a8 SignalHandler(int) (/Users/tomdodds/Workspace/libs/emsdk/upstream/bin/lld+0x1001323a8)
 #3 0x0000000184d6a584 (/usr/lib/system/libsystem_platform.dylib+0x18047a584)
 #4 0x000000010392e86c checkFunctionMemoryAccess(llvm::Function&, bool, llvm::AAResults&, llvm::SmallSetVector<llvm::Function*, 8u> const&) (.llvm.5251377218064180803) (/Users/tomdodds/Workspace/libs/emsdk/upstream/bin/lld+0x1013a686c)
 #5 0x000000010392f89c llvm::PostOrderFunctionAttrsPass::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) (/Users/tomdodds/Workspace/libs/emsdk/upstream/bin/lld+0x1013a789c)
 #6 0x00000001042aafa8 llvm::ModuleToPostOrderCGSCCPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/Users/tomdodds/Workspace/libs/emsdk/upstream/bin/lld+0x101d22fa8)
 #7 0x0000000104a8e538 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/Users/tomdodds/Workspace/libs/emsdk/upstream/bin/lld+0x102506538)
 #8 0x00000001032641c4 llvm::lto::opt(llvm::lto::Config const&, llvm::TargetMachine*, unsigned int, llvm::Module&, bool, llvm::ModuleSummaryIndex*, llvm::ModuleSummaryIndex const*, std::__2::vector<unsigned char, std::__2::allocator<unsigned char>> const&) (/Users/tomdodds/Workspace/libs/emsdk/upstream/bin/lld+0x100cdc1c4)
 #9 0x0000000103265b88 llvm::lto::backend(llvm::lto::Config const&, std::__2::function<llvm::Expected<std::__2::unique_ptr<llvm::CachedFileStream, std::__2::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>, unsigned int, llvm::Module&, llvm::ModuleSummaryIndex&) (/Users/tomdodds/Workspace/libs/emsdk/upstream/bin/lld+0x100cddb88)
#10 0x0000000103255178 llvm::lto::LTO::runRegularLTO(std::__2::function<llvm::Expected<std::__2::unique_ptr<llvm::CachedFileStream, std::__2::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>) (/Users/tomdodds/Workspace/libs/emsdk/upstream/bin/lld+0x100ccd178)
#11 0x0000000103254810 llvm::lto::LTO::run(std::__2::function<llvm::Expected<std::__2::unique_ptr<llvm::CachedFileStream, std::__2::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>, std::__2::function<llvm::Expected<std::__2::function<llvm::Expected<std::__2::unique_ptr<llvm::CachedFileStream, std::__2::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>> (unsigned int, llvm::StringRef, llvm::Twine const&)>) (/Users/tomdodds/Workspace/libs/emsdk/upstream/bin/lld+0x100ccc810)
#12 0x0000000102a79498 lld::wasm::BitcodeCompiler::compile() (/Users/tomdodds/Workspace/libs/emsdk/upstream/bin/lld+0x1004f1498)
#13 0x0000000102a7b15c lld::wasm::SymbolTable::compileBitcodeFiles() (/Users/tomdodds/Workspace/libs/emsdk/upstream/bin/lld+0x1004f315c)
#14 0x0000000102a66fa4 lld::wasm::(anonymous namespace)::LinkerDriver::linkerMain(llvm::ArrayRef<char const*>) (/Users/tomdodds/Workspace/libs/emsdk/upstream/bin/lld+0x1004defa4)
#15 0x0000000102a62d78 lld::wasm::link(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, bool, bool) (/Users/tomdodds/Workspace/libs/emsdk/upstream/bin/lld+0x1004dad78)
#16 0x00000001026cc344 lld::unsafeLldMain(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, llvm::ArrayRef<lld::DriverDef>, bool) (/Users/tomdodds/Workspace/libs/emsdk/upstream/bin/lld+0x100144344)
#17 0x000000010260fbc4 lld_main(int, char**, llvm::ToolContext const&) (/Users/tomdodds/Workspace/libs/emsdk/upstream/bin/lld+0x100087bc4)
#18 0x000000010261027c main (/Users/tomdodds/Workspace/libs/emsdk/upstream/bin/lld+0x10008827c)
#19 0x00000001849af154 
em++: error: '/Users/tomdodds/Workspace/libs/emsdk/upstream/bin/wasm-ld @/var/folders/rr/3x4g4qwd4ns650k8gs7h5_br0000gn/T/emscript
```

This was not an issue we see with version 19. 

We'll continue to investigate if it's an issue at our end
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzkWV-P4ygS_zTkBXWE8f-HPGQyndmVZrSjSe_uY6sM2OEaQxZw0rlPf8J2d8fp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