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

Linker error "hidden symbol" on subclassing Thread

    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

            Hide
            modocache Brian Ivan Gesiak added a comment -

            Awesome! Thanks for the quick turnaround! Submitting a fix for the public symbols in XCTest now.

            Show
            modocache Brian Ivan Gesiak added a comment - Awesome! Thanks for the quick turnaround! Submitting a fix for the public symbols in XCTest now.
            Hide
            parkera Tony Parker added a comment -

            Thanks Erik!

            Show
            parkera Tony Parker added a comment - Thanks Erik!
            Hide
            dgrove-oss David Grove added a comment - - edited

            Hi Erik

            Can we get this fix into the Swift3 branch as well? I just tried against swift-3.0.1-PREVIEW-3-ubuntu16.04 and the bug is still there.

            Show
            dgrove-oss David Grove added a comment - - edited Hi Erik Can we get this fix into the Swift3 branch as well? I just tried against swift-3.0.1-PREVIEW-3-ubuntu16.04 and the bug is still there.
            Hide
            eeckstein Erik Eckstein added a comment -

            I cherry picked it into swift 3 a few days ago, so it should be on the way.
            (Sorry for not doing it earlier)

            Show
            eeckstein Erik Eckstein added a comment - I cherry picked it into swift 3 a few days ago, so it should be on the way. (Sorry for not doing it earlier)
            Hide
            dgrove-oss David Grove added a comment -

            Great, thanks! Sorry for not looking more closely at the Swift3 branch; missed that it was done already.

            Show
            dgrove-oss David Grove added a comment - Great, thanks! Sorry for not looking more closely at the Swift3 branch; missed that it was done already.

              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: