tpoechtrager / cctools-port

Apple cctools port for Linux and *BSD
731 stars 168 forks source link

First-class support for compiling on darwin? #1

Closed copumpkin closed 10 years ago

copumpkin commented 10 years ago

I've had to hack it up a fair amount to get it to build. Main motivation over the official apple release is that you've taken care of putting in a configure script, more conventional flags, and all that other good stuff :smile: Have you considered that? It feels a bit ironic that I'm hacking your cctools up to build on darwin!

Great work, by the way. This is hugely useful (after my hacks) for my plans of world domination.

tpoechtrager commented 10 years ago

I've had to hack it up a fair amount to get it to build. Main motivation over the official apple release is that you've taken care of putting in a configure script, more conventional flags, and all that other good stuff :smile: Have you considered that?

Yes, I'll try to fix it for OS X (maybe iOS too) within the next few days.

Great work, by the way.

Thanks!

This is hugely useful (after my hacks) for my plans of world domination.

Good luck! :-)

tpoechtrager commented 10 years ago

Works now on OS X and iOS.


However, ld64 crashes on iOS (7.0 / armv7) with >= -O2 enabled. I suspect that this is a bug in ld64 itself, or in llvm/clang.

[...]
"/var/mobile/cc-ios/bin/ld" -dynamic -arch armv7 -iphoneos_version_min 5.0.0 -syslibroot [...] -o a.out -lcrt1.3.1.o /var/tmp/test-5d41c6.o -lstdc++ -lSystem
clang: error: unable to execute command: Bus error: 10
clang: error: linker command failed due to signal (use -v to see invocation)

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: EXC_ARM_DA_ALIGN at address: 0x0027a07b
0x000c7f72 in ld::passes::compact_unwind::CompactUnwindAtom<arm64>::CompactUnwindAtom ()

That crash goes away if the optimizations are either lowered to -O1, or -flto is added.

Targeting iOS from OS X seems to work flawlessly.


Looks like Coolstar had a similar problem with ld64-236.3:

  1. Update to ld64-224.1 (which was open sourced yesterday. ld64-236 has a weird crashing issue so we're on a slightly older version. No big problem though.

http://planet-iphones.com/cydia/id/org.coolstar.ld64

copumpkin commented 10 years ago

Thanks for your prompt fix! Seems to work great on my Mac OS install :) feel free to close this unless you think there's remaining work.

tpoechtrager commented 10 years ago

You are welcome. Just kept it open because of iOS.