0

I want to build openssl library for watch OS 2 from this github: https://github.com/nachocove/ios-openssl

It was working in the first release of Xcode 7 beta, but now I got:

ld: in /../testWatchOS WatchKit Extension/ios-openssl/lib/libcrypto.a(bn_lib.o), building for watchOS simulator, but linking in object file built for iOS, for architecture i386

Google for 2 hours and trying different SDK path not help.

BillChan
  • 85
  • 1
  • 3

2 Answers2

1

You can try this one: https://github.com/mkhon/Python-iOS-Support It contains OpenSSL.framework Makefile glue for tvOS and watchOS, including simulators (check README).

Max Khon
  • 11
  • 2
  • Hello Max, thanks for your answer. I got this error when make: $ make make: *** No rule to make target `dist/iOS/Python.framework', needed by `Python-3.4.2-iOS-support.b3.tar.gz'. Stop. – BillChan Oct 15 '15 at 11:47
  • BillChan, You need to run "make OpenSSL.framework-watchOS" if you want to build OpenSSL for watchOS from this repo. Check README file. – Max Khon Oct 15 '15 at 22:36
  • Hello Max, I read the readme also, but I got the error with running "make OpenSSL.framework-watchOS" # Patch apps/speed.c to not use fork() since it's not available on tvOS sed -ie 's/define HAVE_FORK 1/define HAVE_FORK 0/' build/watchOS/openssl-1.0.2d-watchsimulator.i386/apps/speed.c # Patch Configure to build for tvOS or watchOS, not iOS LANG=C sed -ie 's/-D_REENTRANT:iOS/-D_REENTRANT:watchOS/' build/watchOS/openssl-1.0.2d-watchsimulator.i386/Configure sed: RE error: illegal byte sequence make: *** [build/watchOS/openssl-1.0.2d-watchsimulator.i386/Makefile] Error 1 – BillChan Oct 16 '15 at 08:01
  • BillChan, something is wrong with your sed. What does 'which sed' say? – Max Khon Oct 16 '15 at 20:04
  • seem like default path: /usr/bin/sed – BillChan Oct 19 '15 at 07:40
  • I fixed this (check the latest code) by using LC_ALL=C instead of LANG=C. – Max Khon Nov 09 '15 at 07:45
0

Inspired by @Max Khon's work. I also forked the ios-openssl github and make it work for Watch OS and simulator:

https://github.com/billchan/ios-openssl/tree/WatchOS

and the universal library for both iOS and WatchOS

https://github.com/billchan/ios-openssl

BillChan
  • 85
  • 1
  • 3