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

Project with target iOS 7 cannot be compiled with Mobile SDK framework for device simulator #20

Open
rundueva opened this issue Oct 28, 2013 · 8 comments

Comments

@rundueva
Copy link
Contributor

And it is not tested for real arm64 hardware

@dodikk
Copy link
Contributor

dodikk commented Oct 29, 2013

Reproduced on simulator only.
Deployment Target = iOS7

@dodikk
Copy link
Contributor

dodikk commented Oct 29, 2013

Errors for the empty project :

too many compact unwind infos in function anon for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

screen shot 2013-10-29 at 11 03 33 am

@dodikk
Copy link
Contributor

dodikk commented Oct 29, 2013

Errors for one of auto test projects (SCContactsTest) :

0  0x104bed724  __assert_rtn + 144
1  0x104c4da0a  ld::Atom::finalAddress() const + 58
2  0x104c498cc  ld::tool::OutputFile::applyFixUps(ld::Internal&, unsigned long long, ld::Atom const*, unsigned char*) + 702
3  0x104c4ad5a  ld::tool::OutputFile::writeAtoms(ld::Internal&, unsigned char*) + 262
4  0x104c47f3b  ld::tool::OutputFile::writeOutputFile(ld::Internal&) + 583
5  0x104c4233b  ld::tool::OutputFile::write(ld::Internal&) + 147
6  0x104bedc6e  main + 1012
7  0x7fff8d09a7e1  start + 0
A linker snapshot was created at:
/tmp/SCContactsTest-2013-09-29-111109.ld-snapshot
ld: Assertion failed: (_mode == modeFinalAddress), function finalAddress, file /SourceCache/ld64/ld64-224.1/src/ld/ld.hpp, line 689.
clang: error: linker command failed with exit code 1 (use -v to see invocation)

screen shot 2013-10-29 at 11 11 21 am

@dodikk
Copy link
Contributor

dodikk commented Oct 30, 2013

https://devforums.apple.com/message/886537#886537

I can reproduce the error in a small test case, 
but only if I run "strip -x" on the static library. 

That option to strip removes local symbols (e.g the names of static functions). In xcode, the -x may come from "Additional Strip Flags" or from "Strip Style" being set to "Non-Global Symbols". Strip -x is usually only used when you want to hide/obfuscate functions names.

If your static library does have local symbols stripped, a work around would be to rebuild it and keep local symbols (no strip -x).


After applying this we get the same errors for both projects :

0  0x104bed724  __assert_rtn + 144
1  0x104c4da0a  ld::Atom::finalAddress() const + 58
2  0x104c498cc  ld::tool::OutputFile::applyFixUps(ld::Internal&, unsigned long long, ld::Atom const*, unsigned char*) + 702
3  0x104c4ad5a  ld::tool::OutputFile::writeAtoms(ld::Internal&, unsigned char*) + 262
4  0x104c47f3b  ld::tool::OutputFile::writeOutputFile(ld::Internal&) + 583
5  0x104c4233b  ld::tool::OutputFile::write(ld::Internal&) + 147
6  0x104bedc6e  main + 1012
7  0x7fff8d09a7e1  start + 0
A linker snapshot was created at:
/tmp/SCContactsTest-2013-09-29-111109.ld-snapshot
ld: Assertion failed: (_mode == modeFinalAddress), function finalAddress, file /SourceCache/ld64/ld64-224.1/src/ld/ld.hpp, line 689.
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@dodikk
Copy link
Contributor

dodikk commented Oct 30, 2013

@dodikk
Copy link
Contributor

dodikk commented Oct 31, 2013

The issue is reproduced for x86_64 architecture only. However, Xcode5 uses it by default for simulator builds.

xcodebuild -target SampleApp -configuration Debug -sdk iphonesimulator -arch i386

** BUILD SUCCEEDED **

@dodikk
Copy link
Contributor

dodikk commented Oct 31, 2013

As a workaround you can create a target with "$(ARCHS_STANDARD)" architectures. Your project will build only for i386 architecture and run under the simulator. You should use the original target for running an app on the device.

1
2

@dodikk
Copy link
Contributor

dodikk commented Nov 4, 2013

@sawithington @dodikk88 it's a bug/failed assert in the linker that comes with clang - 
you just need a compiler update

Rob Pilling ( @bobrippling )

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

No branches or pull requests

2 participants