Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link error: ___llvm_profile_runtime_user in EnvironmentStorage.o #1

Closed
JetForMe opened this issue Jul 13, 2023 · 5 comments
Closed

Comments

@JetForMe
Copy link

I'm not sure if this is a bug in Xcode 15b4, or something to do with this macro library, but I get this after adding it to my Xcode project (an iOS app targeting iOS 16+), during the link phase:

ld: Undefined symbols:
  ___llvm_profile_runtime, referenced from:
      ___llvm_profile_runtime_user in EnvironmentStorage.o
      ___llvm_profile_runtime_user in SwiftSyntaxMacros.o
      ___llvm_profile_runtime_user in SwiftSyntax.o
      ___llvm_profile_runtime_user in SwiftDiagnostics.o
      ___llvm_profile_runtime_user in SwiftParser.o
      ___llvm_profile_runtime_user in SwiftBasicFormat.o
      ___llvm_profile_runtime_user in SwiftParserDiagnostics.o
@Wouter01
Copy link
Owner

I tried reproducing this but I was not able to. Could you create a test project and see if the issue also occurs there?

@JetForMe
Copy link
Author

This project exhibits the behavior. I created a new iOS project from the App template, added the SwiftUI macros dependency, and built. It seemed to build fine, although I had interrupted the first build when I noticed that the selected target wasn't the simulator. I switched to an iPhone SE 3rd gen 16.0 sim, and built, and it built successfully but suspiciously quickly.

I then set the deployment target to iOS 16.0, rebuilt, and it got the link error. Then I set the deployment target back to iOS 17, and it still gets the error.

TestMacro.zip

@Wouter01
Copy link
Owner

Thank you, I was able to reproduce the error. I had a closer look and it looks like this is an issue with the new linker, as multiple packages are having issues. I made a new macro (with Xcode File > New > Package > Macro) and building with the provided client scheme gives the same error, so I will assume this is a bug in Xcode or the linker that will get fixed

@JetForMe
Copy link
Author

Okay, thanks for confirming. I'll write a radar.

@JetForMe
Copy link
Author

FYI, turning off code coverage in the test plan will allow the build to proceed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants