Parse-sdk-ios-osx: Undefined symbols for architecture x86_64

Created on 13 Jul 2017  Â·  58Comments  Â·  Source: parse-community/Parse-SDK-iOS-OSX

When executing the project "ParseStarterProject" v.1.15.0, in Xcode 8.2.1 I receive the error below:

captura de tela 2017-07-13 as 16 01 07

When I add the Parse.frameworkand Bolts.framework libraries to an existing project, I get the same error.

  1. Do I need to do any additional configuration to be able to compile?
  2. Any possible solution to the case?

Most helpful comment

Guys this error occurs if you pass -fprofile-instr-generate during compilation, but not during linking. The flag is required during linking so Clang knows to link with the appropriate profiling libraries.

All 58 comments

I am seeing this as well. If this is holding you up, using the 1.15.0 starter project while pulling in the Parse.framework from the 1.14.4 release will successfully build. The issue appears to have started with the 1.14.5 release. I have not yet parsed through the diffs between those releases, though I suspect someone with more knowledge of the project may be able to do that more efficiently.

Had the same issue as well trying to run anything from 1.14.5 on, but .3 is working for me

I am using Xcode 8.3.2 and tried the followings.

Parse-iOS-1.15.0 : hit the same "___llvm_profile_runtime" undefined symbol error
Parse-iOS-1.14.5 : hit the same "___llvm_profile_runtime" undefined symbol error
Parse-iOS-1.14.4 : works fine.

As Xcode 8.3.3 was released on 6-Jun-2017 and the two newer Parse iOS releases are at end of June. Is there any chance that the 1.14.5 onwards requires the latest Xcode 8.3.3?

For now, I am using 1.14.4 with Xcode 8.3.2. I will try to download Xcode 8.3.3 to see whether 1.15.0 works along with it.

Update:
I have downloaded Xcode 8.3.3 and it doesn't help. Parse-iOS-1.14.4 works but the more recent 2 releases resulted in the same linking error message.

probably because I built manually those releases with incompatible Xcode versions.

This seems to have returned with the 1.15.3 build? (which includes Bolts 1.8.4)

Undefined symbols for architecture arm64:
  "___llvm_profile_runtime", referenced from:
      ___llvm_profile_runtime_user in Parse(PFWeakValue.o)
      ___llvm_profile_runtime_user in Parse(PFUserState.o)
      ___llvm_profile_runtime_user in Parse(PFCommandURLRequestConstructor.o)
      ___llvm_profile_runtime_user in Parse(PFCoreManager.o)
      ___llvm_profile_runtime_user in Parse(PFURLSessionUploadTaskDelegate.o)
      ___llvm_profile_runtime_user in Parse(PFPin.o)
      ___llvm_profile_runtime_user in Parse(PFMulticastDelegate.o)
      ...
     (maybe you meant: ___llvm_profile_runtime_user)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Happens both when using the downloadable frameworks, and when building them manually with Xcode Version 9.0 (9A235)

I'm also having this issue with 1.15.3 in Xcode 9.0 9A235. I've only tried the prebuilt framework from the Github releases page.

My project builds fine with 1.15.2.

I am also having this issue:

Undefined symbols for architecture arm64: "___llvm_profile_runtime", referenced from: ___llvm_profile_runtime_user in Parse(PFCloud.o) ___llvm_profile_runtime_user in Parse(PFFile.o) ___llvm_profile_runtime_user in Parse(PFGeoPoint.o) ___llvm_profile_runtime_user in Parse(PFInstallation.o) ___llvm_profile_runtime_user in Parse(PFObject.o) ___llvm_profile_runtime_user in Parse(PFQuery.o) ___llvm_profile_runtime_user in Parse(PFUser.o) ... (maybe you meant: ___llvm_profile_runtime_user) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Xcode: Version 9.0 (9A235)
Parse SDK 1.15.3

I’ll have a look m, again.

My project also builds fine with 1.15.2, as @airdrummingfool mentioned above.

I used the exact same command for both, perhaps it has to do with some compile flags added when moving to Xcode 9 recommended settings

Let me know if I can help you troubleshoot in any way.

JuSt checked the diff and besides additional warnings, it doesn’t seem we’ve added more build settings. I used the rake package:frameworks as usual. Can you try the same and see if the produced frameworks are functional?

@flovilmart sorry, I'm not too well versed in these commands. my "help" might be more of an impediment ¯_(ツ)_/¯

Step by step:

1- clone the repo
2- in the folder:

And this should build all frameworks :)

rake aborted! LoadError: cannot load such file -- /Users/XXX/Downloads/Parse-SDK-iOS-OSX-master/Vendor/xctoolchain/Scripts/xctask/build_task /Users/XXX/Downloads/Parse-SDK-iOS-OSX-master/Rakefile:10:inrequire_relative'
/Users/XXX/Downloads/Parse-SDK-iOS-OSX-master/Rakefile:10:in <top (required)>' /Library/Ruby/Gems/2.0.0/gems/rake-11.2.2/exe/rake:27:in /Library/Ruby/Gems/2.0.0/gems/bundler-1.15.4/lib/bundler/cli/exec.rb:74:in load' /Library/Ruby/Gems/2.0.0/gems/bundler-1.15.4/lib/bundler/cli/exec.rb:74:inkernel_load'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.15.4/lib/bundler/cli/exec.rb:27:in run' /Library/Ruby/Gems/2.0.0/gems/bundler-1.15.4/lib/bundler/cli.rb:362:inexec'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.15.4/lib/bundler/vendor/thor/lib/thor/command.rb:27:in run' /Library/Ruby/Gems/2.0.0/gems/bundler-1.15.4/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:ininvoke_command'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.15.4/lib/bundler/vendor/thor/lib/thor.rb:387:in dispatch' /Library/Ruby/Gems/2.0.0/gems/bundler-1.15.4/lib/bundler/cli.rb:22:indispatch'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.15.4/lib/bundler/vendor/thor/lib/thor/base.rb:466:in start' /Library/Ruby/Gems/2.0.0/gems/bundler-1.15.4/lib/bundler/cli.rb:13:instart'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.15.4/exe/bundle:30:in block in <top (required)>' /Library/Ruby/Gems/2.0.0/gems/bundler-1.15.4/lib/bundler/friendly_errors.rb:121:inwith_friendly_errors'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.15.4/exe/bundle:22:in <top (required)>' /usr/local/bin/bundle:23:inload'
/usr/local/bin/bundle:23:in <main>' (See full trace by running task with --trace)

sorry, i don't know if this is helpful at all

Oops, forgot to tell you to fetch the submodules:

  • git submodule update --init --recursive

And then the rake command again :)

On Sep 25, 2017, 18:30 -0400, decoyfox notifications@github.com, wrote:

sorry, i don't know if this is helpful at all
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

fatal: Not a git repository (or any of the parent directories): .git

DId you do that in the cloned folder?

@decoyfox, @airdrummingfool, @ColossalChris, @sdsanches, @nebitrams I just tested with the built frameworks available from github, and there's no issue for me.

I'm using Xcode Version 9.0 (9A235)

My steps to reproduce:

  • create new project (single view all)
  • drag/drop Parse / Bolts in to the project
  • Adds them to the target
  • Add import Parse and import Bolts
  • build / run...

When inspecting the parse binary with file, I realized some archs are probably missing

build/Parse.framework/Parse: Mach-O universal binary with 2 architectures: [arm_v7k: current ar archive] [i386]
build/Parse.framework/Parse (for architecture armv7k):  current ar archive
build/Parse.framework/Parse (for architecture i386):    current ar archive

I've uploaded again builds for the latest release, upon download:

$ file ~/Downloads/Parse-iOS/Parse.framework/Parse
/Users/florent/Downloads/Parse-iOS/Parse.framework/Parse: Mach-O universal binary with 4 architectures: [arm_v7: current ar archive] [i386] [x86_64] [arm64]
/Users/florent/Downloads/Parse-iOS/Parse.framework/Parse (for architecture armv7):    current ar archive
/Users/florent/Downloads/Parse-iOS/Parse.framework/Parse (for architecture i386):     current ar archive
/Users/florent/Downloads/Parse-iOS/Parse.framework/Parse (for architecture x86_64):   current ar archive
/Users/florent/Downloads/Parse-iOS/Parse.framework/Parse (for architecture arm64):    current ar archive

$ file ~/Downloads/Parse-iOS-2/Bolts.framework/Bolts
/Users/florent/Downloads/Parse-iOS-2/Bolts.framework/Bolts: Mach-O universal binary with 4 architectures: [i386: current ar archive] [arm_v7: current ar archive] [x86_64] [arm64]
/Users/florent/Downloads/Parse-iOS-2/Bolts.framework/Bolts (for architecture i386):     current ar archive
/Users/florent/Downloads/Parse-iOS-2/Bolts.framework/Bolts (for architecture armv7):    current ar archive
/Users/florent/Downloads/Parse-iOS-2/Bolts.framework/Bolts (for architecture x86_64):   current ar archive
/Users/florent/Downloads/Parse-iOS-2/Bolts.framework/Bolts (for architecture arm64):    current ar archive

I just re-downloaded 1.15.3, confirmed that all 4 architectures are present, and replaced Parse.framework and Bolts.framework in my project. After a clean and build, I am still getting the same Undefined symbols for architecture x86_64: "___llvm_profile_runtime" error.

The problem appears to only be in Parse.framework. I can use the new version of Bolts.framework without issue, as long as I stick with Parse 1.15.2.

Bolts didn't change in between, I'm checking the diff for that release but I don't see anything that would affect compile flags.

Odd thing, is that @nebitrams reports the same issue for 1.15.0, which has been built the same way.

I tried rake package:frameworks, but ended up with a binary that was missing slices (just like you did):

[master] $ file Parse.framework/Parse 
Parse.framework/Parse: Mach-O universal binary with 2 architectures: [arm_v7: current ar archive] [arm64]
Parse.framework/Parse (for architecture armv7): current ar archive
Parse.framework/Parse (for architecture arm64): current ar archive

I also experience the issue with 1.15.0, but not 1.15.1 (all downloaded from Github releases).

Go back to 1.14.4 .. been trying to solve this problem for hours now and just downgrading back to 1.14.4 solved it for me. Builds perfectly!

@iosdec how did you try to solve the issue?

I have the same issue. These compiler errors are shown in my existing project on both Xcode 8.3.3 and 9.0 when I use Parse 1.15.3.

When I revert back to 1.15.1 (just replace the _Bolts.framework_ and _Parse.framework_ from _Parse-iOS.zip_) the Xcode project compiles without problems.

I have compared the pod spec from 1.15.1 with 1.15.3, but the target dependencies didn't change.
Typically these errors occur when a dependency is missing.

@funnel20 are you using cocoa pods? We're talking about a precompiled binary.

@iosdec @airdrummingfool did you manage to use the downloaded frameworks in a clean project like I desribed earlier? That would help debugging.

@flovilmart No, I always use the ZIPs and manually replace the 2 framework files in my project.
First I delete the previous, then add the new to prevent merging conflicts within the framework bundles.

So can you try it on a fresh project? Perhaps we’re missin something obvious. If it doesn’t work just on an existing project but works on a new one, we’ll have more infos.

@flovilmart I tried that with Xcode 8.3.3, but only with 1.15.3. It failed.
So I have to do a back-to-back test with 1.15.1 to proof that my workflow is correct.
I'll post the results later.

I don’t have a copy of Xcode 8.3.3 around, but i’ll Try that as well, as well as rebuilding on this version.

##############
##  TEST 1  ##
##############

Steps to reproduce with 1.15.1:

  1. Create new iOS project with _Single View Application_ in Xcode 8.3.3.
  2. Add the _Bolts.framework_ and _Parse.framework_ from _Parse-iOS.zip_ version 1.15.1 to the Project.
  3. Go to Project Settings, select target, click Build Phases and add the following binaries to _Link Binary With Libraries_:
  4. Bolts.framework
  5. Parse.framework
  6. AudioToolbox.framework
  7. CFNetwork.framework
  8. CoreGraphics.framework
  9. CoreLocation.framework
  10. QuartzCore.framework
  11. Security.framework
  12. SystemConfiguration.framework
  13. libsqlite3.tbd
  14. libz.tbd

  15. Import the Parse header on AppDelegate.m:
    #import <Parse/Parse.h>

  16. Add Parse init code in AppDelegate 'didFinishLaunchingWithOptions:':

[Parse initializeWithConfiguration:[ParseClientConfiguration configurationWithBlock:^(id<ParseMutableClientConfiguration> configuration) {
        configuration.applicationId = @"";
        configuration.server = @"";
    }]];
  1. Build the project. It compiles without errors.
    (Yes, it finally crashes after launch, since applicationId should not be nil, but that's not relevant for this issue).
##############
##  TEST 2  ##
##############

Repeat the same 6 steps with Xcode 8.3.3 and Parse 1.15.3:
Compilation fails with errors:

___llvm_profile_runtime", referenced from:
___llvm_profile_runtime_user in Parse(Parse.o)
___llvm_profile_runtime_user in Parse(ParseClientConfiguration.o)
___llvm_profile_runtime_user in Parse(PFApplication.o)
___llvm_profile_runtime_user in Parse(PFCategoryLoader.o)
___llvm_profile_runtime_user in Parse(PFFileManager.o)
___llvm_profile_runtime_user in Parse(PFInternalUtils.o)
___llvm_profile_runtime_user in Parse(PFLogger.o)
...

##############
##  TEST 3  ##
##############

I loaded the same 2 projects in Xcode 9.0 and the one with 1.15.1 compiled, and 1.15.3 showed the same compiler errors.

##############
##  TEST 4  ##
##############

Repeated steps 1 till 6 in Xcode 9.0 by building a new project with Parse 1.15.3. It failed with the same compiler errors.

##############
##  TEST 5  ##
##############

Manually replaced the _Bolts.framework_ and _Parse.framework_ with that of 1.15.1 in the Xcode 9 projects of Test 4. Now the project compiles without errors.

##################
##  CONCLUSION  ##
##################

Parse 1.15.1 compiles without any issues in:

  • Xcode 8.3.3
  • Xcode 9.0
  • Both in a new or existing Project

Parse 1.15.3 compiles never.

@flovilmart I hope the above 5 tests can help. Bottom line is that there seems no relation with Xcode version or whether the project is existing or freshly created.
1.15.3 never compiles.

What I don’t get is why it’s perfectly functional over here

Did you repeat my tests with manually adding the frameworks and dependencies to your project?
Or did you use cocoa pods?

I can explain: as long as you don't use any Parse code (i.e. 'initializeWithConfiguration:' from my step 5) the compiler won't complain when building. It's even not necessary to add the dependencies (which I don't understand, but OK...).

So can you add some code and try to build again?

Looking at https://clang.llvm.org/docs/SourceBasedCodeCoverage.html , this might have something to do with the code coverage feature:
If I do like that page mentions, and add a .c file to my project containing only

int __llvm_profile_runtime;

I get a clean compile and link (apart from the -Wstrict-prototypes warnings), and my app runs fine.

Thanks @ceramicatheist, that’s very odd indeed that in release build we’d have profiler/coverage info into those settings.

@funnel20 i confirm there's an issue there, I got it too now.

@ceramicatheist Thanks for the tip, that really helped troubleshooting, it seems that setting CLANG_ENABLE_CODE_COVERAGE = NO; I'M rebuilding with xcode9 now, and I'll be putting the prebuilt-libs here

@ceramicatheist I've also updated the releases packages, let me know if this persists.

The Parse-iOS.zip file attached to this issue fixed the problem for me. Thanks @flovilmart @ceramicatheist et. al!

I can confirm too that the updated _Parse-iOS.zip_ resolves the issue.
My project now compiles without issues.

Thank you all.

Good work everyone. Working for me now as well.

This issue was closed but I have had the exact same problem than you guys. After extracting the Zip ParseStarterProject-iOS.zip V1.15.3 found in the release page and compiling I had the

"___llvm_profile_runtime" undefined symbol error 

To solve this I downloaded the Parse-iOS.zip given by @flovilmart few messages before, manually replaced both framework Bolt and Parse and it worked

@Stanou01260 I perhaps forgot to upload to the release then, let me have a look.

Thank you @flovilmart

Guys this error occurs if you pass -fprofile-instr-generate during compilation, but not during linking. The flag is required during linking so Clang knows to link with the appropriate profiling libraries.

@Timmmm do we need to do something on the repo?

Absolutely no idea - sorry! I've never used Objective C or Xcode. Actually I don't know what this project is (I was just Googling the same error and thought I would add what solved it for me).

Anyway, at a guess, you might have some profiling option in Xcode set on that you need to turn off, maybe in a sub-project? If you can, print the command lines that Xcode runs and look for -fprofile-instr-generate or similar. It could also be a code coverage option (that works in a similar way).

Thank you @flovilmart .

It took me a while before finding this thread... Anyway, I know the case is closed, but FMI, simply setting CLANG_ENABLE_CODE_COVERAGE = NO was enough? I've downloaded and used the lastest Parse-SDK-iOS, and the error was still present in the compilation. Was the repo updated with your modification?

Also the archive is pretty big, does it contains all slices for valid architectures? (it seems it does).]

thanks!

I’ll double check that the latest version is Ok. It should contain all slices, you can check with the file command

just checked, they're all in.. thanks!

Was this page helpful?
0 / 5 - 0 ratings