<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 - [WebAssembly] assertion when an expression has relative offset (?)"
   href="https://bugs.llvm.org/show_bug.cgi?id=36364">36364</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[WebAssembly] assertion when an expression has relative offset (?)
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

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

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

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>Backend: WebAssembly
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>patrickyccheng@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Hopefully, I got the extra description correct. The assertion happens in
recordRelocation.

Here is a dump of some of the variables:
Target.isAbsolute: 0
Fixup.getKind(): 2
Fixup.getValue():
dumpMCExpr: Binary: opCode: Add
LHS
        dumpMCExpr:     Binary: opCode: Sub
        LHS
                dumpMCExpr:             Symbol: .L__unnamed_533
        RHS
                dumpMCExpr:             Symbol: l__swift5_reflection_descriptor

RHS
        dumpMCExpr:     Constant: -12

FixupSection.getSectionName(): swift3_capture
Target.getConstant: 0
Target.getSymB:
  l__swift5_reflection_descriptor : isInSection: true isRegistered: true
SymBOffset: 0
FixupOffset: 12



and looks like this is where 'swift5_reflection_descriptor symbol itself is
generated: 
<a href="https://github.com/apple/swift/blob/master-next/lib/IRGen/GenReflection.cpp#L267">https://github.com/apple/swift/blob/master-next/lib/IRGen/GenReflection.cpp#L267</a>

Assertion failed: (!IsPCRel), function recordRelocation, file
/Users/pcheng/github/swift-source/llvm/lib/MC/WasmObjectWriter.cpp, line 578.
0  swift                    0x0000000111e95fa8
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1  swift                    0x0000000111e94ef6 llvm::sys::RunSignalHandlers() +
86
2  swift                    0x0000000111e9656e SignalHandler(int) + 366
3  libsystem_platform.dylib 0x00007fff6f926f5a _sigtramp + 26
4  libsystem_platform.dylib 000000000000000000 _sigtramp + 2423099584
5  libsystem_c.dylib        0x00007fff6f751312 abort + 127
6  libsystem_c.dylib        0x00007fff6f719368 basename_r + 0
7  swift                    0x0000000111c82142 (anonymous
namespace)::WasmObjectWriter::recordRelocation(llvm::MCAssembler&,
llvm::MCAsmLayout const&, llvm::MCFragment const*, llvm::MCFixup const&,
llvm::MCValue, unsigned long long&) + 4498
8  swift                    0x0000000111c42d12
llvm::MCAssembler::layout(llvm::MCAsmLayout&) + 1298
9  swift                    0x0000000111c43014 llvm::MCAssembler::Finish() + 52
10 swift                    0x0000000111c70a41 llvm::MCStreamer::Finish() + 145
11 swift                    0x00000001102bf5b2
llvm::AsmPrinter::doFinalization(llvm::Module&) + 3906
12 swift                    0x0000000111d789c0
llvm::FPPassManager::doFinalization(llvm::Module&) + 80
13 swift                    0x0000000111d78e2d
llvm::legacy::PassManagerImpl::run(llvm::Module&) + 1053
14 swift                    0x000000010eecf46b
swift::performLLVM(swift::IRGenOptions&, swift::DiagnosticEngine*,
llvm::sys::SmartMutex<false>*, llvm::GlobalVariable*, llvm::Module*,
llvm::TargetMachine*, swift::version::Version const&, llvm::StringRef,
swift::UnifiedStatsReporter*) + 2379
15 swift                    0x000000010ed72dd7
performCompile(swift::CompilerInstance&, swift::CompilerInvocation&,
llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*,
swift::UnifiedStatsReporter*) + 14791
16 swift                    0x000000010ed6e51a
swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*,
swift::FrontendObserver*) + 3274
17 swift                    0x000000010ed2e16b main + 2315
18 libdyld.dylib            0x00007fff6f6a5115 start + 1
19 libdyld.dylib            0x000000000000002a start + 2425728790
Stack dump:
0.      Program arguments:
/Users/pcheng/github/swift-source/build/Ninja-RelWithDebInfoAssert/swift-macosx-x86_64/bin/swift
-frontend -c -filelist
/var/folders/xf/fkvz4dzj7ld993j9bh9pnlz40000gr/T/sources-80368c
-disable-objc-attr-requires-foundation-module -target
wasm32-unknown-unknown-wasm -disable-objc-interop -sdk
/Users/pcheng/github/swift-source/wasm-install/sysroot -I
/Users/pcheng/github/swift-source/build/Ninja-RelWithDebInfoAssert/swift-macosx-x86_64/./lib/swift/webassembly/wasm32
-warn-swift3-objc-inference-complete -g -module-cache-path
/Users/pcheng/github/swift-source/build/Ninja-RelWithDebInfoAssert/swift-macosx-x86_64/./module-cache
-module-link-name swiftCore -nostdimport -parse-stdlib -resource-dir
/Users/pcheng/github/swift-source/build/Ninja-RelWithDebInfoAssert/swift-macosx-x86_64/./lib/swift
-swift-version 3 -O -D INTERNAL_CHECKS_ENABLED -group-info-path
/Users/pcheng/github/swift-source/swift/stdlib/public/core/GroupInfo.json
-enable-sil-ownership -Xllvm -sil-inline-generics -Xllvm
-sil-partial-specialization -Xcc -D__SWIFT_CURRENT_DYLIB=swiftCore
-parse-as-library -module-name Swift -o
/Users/pcheng/github/swift-source/build/Ninja-RelWithDebInfoAssert/swift-macosx-x86_64/stdlib/public/core/webassembly/wasm32/Swift.o
<unknown>:0: error: unable to execute command: Abort trap: 6
<unknown>:0: error: compile command failed due to signal 6 (use -v to see
invocation</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>