Building for iOS is not working

42 views
Skip to first unread message

Yahel Bouaziz

unread,
Jun 6, 2017, 7:05:17 AM6/6/17
to Crypto++ Users
Hi Guys,

I'm following to the letter the guide at : https://www.cryptopp.com/wiki/IOS_(Command_Line)
But with Xcode 8.2.3

I set the env using : 

. ./setenv-ios.sh 

Configuring for iPhoneOS (armv7)

XCODE_SDK: iPhoneOS10.3.sdk

XCODE_DEVELOPER: /Applications/Xcode.app/Contents/Developer

XCODE_TOOLCHAIN: /Applications/Xcode.app/Contents/Developer/usr/bin

XCODE_DEVELOPER_TOP: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer

IOS_ARCH: armv7

IOS_TOOLCHAIN: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/

IOS_FLAGS: 

IOS_SYSROOT: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk




Then :

 make -f GNUmakefile-cross


which works for a few files but dies on the crc.cpp file. I tried forcing the -DCRYPTOPP_DISABLE_ASM flag, but to no avail, error is exactly the same.

clang++ -DNDEBUG -g2 -O3 -fPIC -pipe -DCRYPTOPP_DISABLE_ASM -miphoneos-version-min=6 -arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk -stdlib=libc++ -c crc.cpp

 

crc
.cpp:21:7: error: invalid instruction

       
asm ("crc32 %1, %0" : "+r"(crc) : "r"(val));

             
^

<inline asm>:1:2: note: instantiated into assembly here

        crc32 r1
, r0

       
^~~~~

crc
.cpp:27:7: error: invalid instruction

       
asm ("crc32 %1, %0" : "+r"(crc) : "r"(val));

             
^

<inline asm>:1:2: note: instantiated into assembly here

        crc32 r1
, r0

       
^~~~~

crc
.cpp:33:7: error: invalid instruction

       
asm ("crc32 %1, %0" : "+r"(crc) : "r"(val));

             
^

<inline asm>:1:2: note: instantiated into assembly here

        crc32 r1
, r0

       
^~~~~

3 errors generated.

make
: *** [crc.o] Error 1


Any idea appreciated.


Thanks.


Yahel

Jeffrey Walton

unread,
Jun 6, 2017, 8:06:20 AM6/6/17
to Crypto++ Users
I'm following to the letter the guide at : https://www.cryptopp.com/wiki/IOS_(Command_Line)
But with Xcode 8.2.3 ...

Thanks Yahel.

I was kind of worried about that break. The problem is Apple dumbs down their version of Clang, while LLVM's Clang is fully featured. I'm guessing a `make -k` will show problems around PMULL, AES and SHA, too (gcm.cpp, rijndael.cpp and sha.cpp).

The other problem is, both my MacBooks are down so its not being well tested. The first machine's hard drive went bad, so its a new machine without tools. The second had the battery go bad, and leak took out the machine.

I might be able to have a fix shortly, but I'm worried about testing.

Can you provide remote SSH access to the machine? I can provide an authorized_keys file.

Jeff

Jeffrey Walton

unread,
Jun 6, 2017, 8:40:52 AM6/6/17
to Crypto++ Users


On Tuesday, June 6, 2017 at 8:06:20 AM UTC-4, Jeffrey Walton wrote:

I'm following to the letter the guide at : https://www.cryptopp.com/wiki/IOS_(Command_Line)
But with Xcode 8.2.3 ...

Thanks Yahel.

I was kind of worried about that break. The problem is Apple dumbs down their version of Clang, while LLVM's Clang is fully featured. I'm guessing a `make -k` will show problems around PMULL, AES and SHA, too (gcm.cpp, rijndael.cpp and sha.cpp).

The other problem is, both my MacBooks are down so its not being well tested. The first machine's hard drive went bad, so its a new machine without tools. The second had the battery go bad, and leak took out the machine.

I might be able to have a fix shortly, but I'm worried about testing.

This change is being tested now: https://github.com/noloader/cryptopp/commit/a279b00bd0fc. The problem is, it only test on Intel hardware. I manually run test on ARM, but they passed prior to your report :(

If it test OK, then I'll push it to Wei's repo.

Jeff

Yahel Bouaziz

unread,
Jun 6, 2017, 8:50:30 AM6/6/17
to Crypto++ Users
Can you provide remote SSH access to the machine? I can provide an authorized_keys file.
 
Thanks for the quick response.
Unfortunately I can not provide outside access to my machine.

Yahel Bouaziz

unread,
Jun 6, 2017, 9:26:36 AM6/6/17
to Crypto++ Users
I pulled from your repo with the new commit you indicated.

It builds correctly. 
I can't run the tests though as I don't have a jailbroken device.

Thanks for your quick actions.

When you have the tests passed, could you please tell me so that I'm reassured everything will work correctly ?

Anything I should know about your fork compared to the original repo ?

Thanks.

Jeffrey Walton

unread,
Jun 6, 2017, 9:44:45 AM6/6/17
to Crypto++ Users

Thanks again Yahel.

It was pushed to Wei's repo at https://github.com/weidai11/cryptopp/commit/1565020bfd7f.

Jeff

Yahel Bouaziz

unread,
Jun 6, 2017, 10:00:08 AM6/6/17
to Crypto++ Users
Thanks to you !!

Have a great day.

Yahel

Jeffrey Walton

unread,
Aug 17, 2017, 5:47:09 PM8/17/17
to Crypto++ Users


On Tuesday, June 6, 2017 at 10:00:08 AM UTC-4, Yahel Bouaziz wrote:
Thanks to you !!

Have a great day.

Yahel, we checked in the design and code changes today: https://github.com/weidai11/cryptopp/pull/461.

If you have some time, then please please checkout Master and give it a go.

This is the one pain point for iOS at the moment: https://groups.google.com/forum/#!topic/cryptopp-users/FluP41of-AU

Jeff
Reply all
Reply to author
Forward
0 new messages