title: Linker error when building extension "no such file or directory: '_NSExtensionMain'"
body: <p>I've inherited an older project with lots of dependencies that had some problems getting a solid build through CI. After close inspection the <code>master</code> branch simply was broken and I had some fixing to do. I could get it to work pretty quick except for the extension. When removing the extension the projects builds and runs. There was also a <code>dev</code> branch that still worked out of the box but was outdated. I've compared the differences and it seems to boil down to a subtle change in the linker. As soon as I copied the working linker command from the <code>dev</code> branch on the <code>master</code> branch it would pass and vice versa.</p>
  <h1>Differences</h1>
  <p>There were more differences than these two lines, but I tried swapping them all out and there was no difference in result.</p>
  <h2>Working version (dev branch)</h2>
  <pre><code> -Xlinker 2 -fobjc-arc -fobjc-link-runtime -fapplication-extension -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -L/usr/lib/swift
   -Xlinker -add_ast_path
   -Xlinker /Users/[me]/Library/Developer/Xcode/DerivedData/[App]-cjrxbriquvbkmcgdurzwekbylpik/Build/Intermediates.noindex/[App].build/Debug-iphonesimulator/[App]-PrintAction.build/Objects-normal/x86_64/[App]_PrintAction.swiftmodule -e _NSExtensionMain
  </code></pre>
  <h2>Failing version (master branch)</h2>
  <pre><code> -Xlinker 2 -fobjc-arc -fobjc-link-runtime -fapplication-extension -B -e _NSExtensionMain
  </code></pre>
  <h1>Question</h1>
  <p>I don't know why these two lines are different or what the reason is there seems to be a part missing in the <code>master</code> version. I could find no differences in flags but I might have been looking in the wrong place.</p>
  <h1>Full version</h1>
  <p>Pretty formatted:</p>
  <pre><code>    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
       -target x86_64-apple-ios12.1-simulator &lt;-- Beide
       -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk 
       -L/Users/[me]/Library/Developer/Xcode/DerivedData/[App]-cjrxbriquvbkmcgdurzwekbylpik/Build/Products/Debug-iphonesimulator 
       -F/Users/[me]/Library/Developer/Xcode/DerivedData/[App]-cjrxbriquvbkmcgdurzwekbylpik/Build/Products/Debug-iphonesimulator 
       -filelist /Users/[me]/Library/Developer/Xcode/DerivedData/[App]-cjrxbriquvbkmcgdurzwekbylpik/Build/Intermediates.noindex/[App].build/Debug-iphonesimulator/[App]-PrintAction.build/Objects-normal/x86_64/[App]-PrintAction.LinkFileList 
       -Xlinker -rpath 
       -Xlinker @executable_path/Frameworks 
       -Xlinker -rpath 
       -Xlinker @executable_path/../../Frameworks -dead_strip 
       -Xlinker -object_path_lto 
       -Xlinker /Users/[me]/Library/Developer/Xcode/DerivedData/[App]-cjrxbriquvbkmcgdurzwekbylpik/Build/Intermediates.noindex/[App].build/Debug-iphonesimulator/[App]-PrintAction.build/Objects-normal/x86_64/[App]-PrintAction_lto.o 
       -Xlinker -export_dynamic 
       -Xlinker -no_deduplicate 
       -Xlinker -objc_abi_version 
       -Xlinker 2 
       -fobjc-arc 
       -fobjc-link-runtime 
       -fapplication-extension 
       -B 
       -e _NSExtensionMain
       -Xlinker -sectcreate 
       -Xlinker __TEXT 
       -Xlinker __entitlements 
       -Xlinker /Users/[me]/Library/Developer/Xcode/DerivedData/[App]-cjrxbriquvbkmcgdurzwekbylpik/Build/Intermediates.noindex/[App].build/Debug-iphonesimulator/[App]-PrintAction.build/[App]-PrintAction.appex-Simulated.xcent 
       -framework SystemConfiguration 
       -framework MobileCoreServices 
       -framework [App]Core 
       -lPods-[App]-PrintAction 
       -Xlinker -dependency_info 
       -Xlinker /Users/[me]/Library/Developer/Xcode/DerivedData/[App]-cjrxbriquvbkmcgdurzwekbylpik/Build/Intermediates.noindex/[App].build/Debug-iphonesimulator/[App]-PrintAction.build/Objects-normal/x86_64/[App]-PrintAction_dependency_info.dat 
       -o /Users/[me]/Library/Developer/Xcode/DerivedData/[App]-cjrxbriquvbkmcgdurzwekbylpik/Build/Products/Debug-iphonesimulator/[App]-PrintAction.appex/[App]-PrintAction
  </code></pre>