Uploaded image for project: 'Swift'
  1. Swift
  2. SR-1901

Linker error "hidden symbol" on subclassing Thread

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Done
    • Component/s: Foundation, XCTest
    • Labels:
      None
    • Environment:

      Linux

      Description

      This code produces a linker error on Linux:

      import class Foundation.Thread
      
      class Thread: Foundation.Thread {
      }
      
      $ swiftc Thread.swift
      /usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation6Threadg5_mainFT_T_' is not defined locally
      /usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation6Threads5_mainFT_T_' is not defined locally
      /usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation6Threadm5_mainFT_T_' is not defined locally
      /usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation6ThreadgP33_513815EE0AA0753AFF631398622CF9397_threadSu' is not defined locally
      /usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation6ThreadsP33_513815EE0AA0753AFF631398622CF9397_threadSu' is not defined locally
      /usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation6ThreadmP33_513815EE0AA0753AFF631398622CF9397_threadSu' is not defined locally
      /usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation6Threadg5_attrVSC14pthread_attr_t' is not defined locally
      /usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation6Threads5_attrVSC14pthread_attr_t' is not defined locally
      /usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation6Threadm5_attrVSC14pthread_attr_t' is not defined locally
      /usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation6Threadg7_statusOS_15_NSThreadStatus' is not defined locally
      /usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation6Threads7_statusOS_15_NSThreadStatus' is not defined locally
      /usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation6Threadm7_statusOS_15_NSThreadStatus' is not defined locally
      /usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation6Threadg10_cancelledSb' is not defined locally
      /usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation6Threads10_cancelledSb' is not defined locally
      /usr/bin/ld.gold: error: hidden symbol '_TFC10Foundation6Threadm10_cancelledSb' is not defined locally
      clang: error: linker command failed with exit code 1 (use -v to see invocation)
      <unknown>:0: error: link command failed with exit code 1 (use -v to see invocation)
      

      However no error if ran as a script:
      $ swift Thread.swift
      <no error>

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                eeckstein Erik Eckstein
                Reporter:
                aciid Ankit Aggarwal
              • Votes:
                1 Vote for this issue
                Watchers:
                10 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: