Radare2: Cross-Compiling for iOS: Static library libr.a is broken

Created on 6 Oct 2017  Â·  6Comments  Â·  Source: radareorg/radare2

When you use sys/ios-sdk.sh or sys/ios-static.sh the resulting libr.a seems to be broken:

lipo -info libr.a

fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: archive with no architecture specification: libr.a (can't determine architecture for it)

nm -a libr.a

[No output]

So here definitely something is not working right, because no symbols are printed.

When I'm extracting the static libraries from libr.a with ar -x libr.a and then linking them with libtool -static -o newlibr.a *.a both commands will return correct output.

But the linking doesn't seem to be working as a lot of symbols are unresolved and Xcode also complains about them, when using the static library.

buildsystem iOS

Most helpful comment

pushed the fix, but its only for 1 arch for now. will improve later

All 6 comments

This index is created by ranlib, it should be executed after ar. Ill have a look

On 6 Oct 2017, at 22:30, Daniel notifications@github.com wrote:

When you use sys/ios-sdk.sh or sys/ios-static.sh the resulting libr.a seems to be broken:

lipo -info libr.a

fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: archive with no architecture specification: libr.a (can't determine architecture for it)

nm -a libr.a

[No output]

So here definitely something is not working right.

When I'm extracting the static libraries from libr.a with ar -x libr.a and then linking them with libtool -static -o newlibr.a *.a both commands will return correct output.

But the linking doesn't seem to be working as a lot of symbols are unresolved and Xcode also complains about them, when using the static library.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

pushed the fix, but its only for 1 arch for now. will improve later

can you update the ios-sdk.sh to do that? or the makefile by sending a PR? im kinda busy with other 9000 things right now

On 6 Oct 2017, at 22:30, Daniel notifications@github.com wrote:

When you use sys/ios-sdk.sh or sys/ios-static.sh the resulting libr.a seems to be broken:

lipo -info libr.a

fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: archive with no architecture specification: libr.a (can't determine architecture for it)

nm -a libr.a

[No output]

So here definitely something is not working right.

When I'm extracting the static libraries from libr.a with ar -x libr.a and then linking them with libtool -static -o newlibr.a *.a both commands will return correct output.

But the linking doesn't seem to be working as a lot of symbols are unresolved and Xcode also complains about them, when using the static library.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub https://github.com/radare/radare2/issues/8654, or mute the thread https://github.com/notifications/unsubscribe-auth/AA3-lnJhJcqLQ0cnQnBoDHY5JFXEK2_5ks5spo3LgaJpZM4Pw_sJ.

Sure, will do it. If I ran into some problems or questions, I will ask here.

Added support for all arm archs and the simulator(i386 and x86_64) with https://github.com/radare/radare2/pull/8775

awesome

On 3 Nov 2017, at 17:53, Daniel notifications@github.com wrote:

Added support for all arm archs and the simulator(i386 and x86_64) with #8775 https://github.com/radare/radare2/pull/8775
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub https://github.com/radare/radare2/issues/8654#issuecomment-341763097, or mute the thread https://github.com/notifications/unsubscribe-auth/AA3-luGiDBs-4eFZihViYgidOSFMPjNzks5sy0UHgaJpZM4Pw_sJ.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ret2libc picture ret2libc  Â·  6Comments

RazviAlex picture RazviAlex  Â·  4Comments

Manouchehri picture Manouchehri  Â·  3Comments

radare picture radare  Â·  8Comments

MariasStory picture MariasStory  Â·  6Comments