views:

124

answers:

2

I'm trying to get my app to run on a 2.2.1 device despite being built against the 3.1.2 SDK.

The table below lists my results

Deployment   |Base        |Device      |Result
Target       |SDK         |Version     |
-------------+------------+------------+-------
3.1.2         3.1.2        3.1.2        Runs OK
2.2.1         3.1.2        3.1.2        Runs OK
2.2.1         2.2.1        2.2.1        Runs OK
2.2.1         3.1.2        2.2.1        Builds OK, interrupt signal when run

Line #3 proves that none of my code is incompatible between sdk's. I've taken out everything that would need to be weak-linked in an attempt to get at the root of the problem.

The interrupt comes quickly after the program begins, but not immediately. And the point it happens is in code that has never had anything to do with 3.0 features

The line it's stopping on is a simple math operation involving 4 floats (a-b)/(c/d), and there doesn't seem to be anything wrong with any of those. (It's in C++)

What else could cause an interrupt signal under these circumstances?

Update:

It seems that the exact point it's interrupting on is casting a u64 to a float.

A: 

Any information in the console? The crash logs for the device may also be helpful.

Epsilon Prime
Nothing in the console. The line it's stopping on is a simple math operation involving 4 floats (a-b)/(c/d), and there doesn't seem to be anything wrong with any of those. (It's in C++)In the call stack I see "__dyld__ZN4dyld14bindLazySymbolEPK11mach_headerPm" bind lazy symbol seems to mean something, but it's just a math operation, what's to fail to bind?
Kevin Laity
A: 

What ended up happening is that when you run this app this this configuration, suddenly there's a problem casting a u64 to a float or double. I guess the u64 casting code has changed? So it only fails when you're running a version of the os that doesn't match the sdk.

Anyway the workaround is to cast the u64 to an unsigned int and then to a float. Of course, I can only do that because I'm in a situation where the number in question can always fit into a regular int.

Kevin Laity