Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to compile with latest XCode and iOS #49

Open
ghost opened this issue Sep 18, 2016 · 5 comments
Open

Not able to compile with latest XCode and iOS #49

ghost opened this issue Sep 18, 2016 · 5 comments

Comments

@ghost
Copy link

ghost commented Sep 18, 2016

I just tried to compile the CPAProxy for my project, using the latest XCode 8 and iOS, but I am not able to compile.

This is the exception I get:
But during the checkout using Cocoapods I get an exception: configure: error: in /.../Library/Caches/CocoaPods/Pods/External/CPAProxy/af463e351d693dc64b763c733b4da397/scripts/build/libevent-2.0.22-stable: configure: error: cannot run C compiled programs. If you meant to cross compile, use --host.

@rainwolf
Copy link
Contributor

I'm seeing this too, albeit a bit differently:
checking whether we need extra options to link libevent... configure: error: Found linkable libevent in *******/CPAProxy/scripts/built/i386, but it does not seem to run, even with -R. Maybe specify another using --with-libevent-dir}

Tor's config.log shows the error
dyld: Symbol not found: _clock_gettime Referenced from: *********/CPAProxy/scripts/build/tor-0.2.8.7/./conftest Expected in: /usr/lib/libSystem.B.dylib

I don't know how to solve it, but I suspect it will resolve itself when Sierra is released. Can anyone with XCode 8 and the beta of Sierra confirm?

@ghost
Copy link
Author

ghost commented Sep 19, 2016

Sorry for not mentioning that: I am already using the latest Safari Release (GM?), so my exception is from Safari with XCode 8...

@rainwolf
Copy link
Contributor

rainwolf commented Sep 21, 2016

Safari? I meant macOS Sierra (10.12).

I made some changes that allow it to compile now, but there is a catch, my changes only made it compile on macOS Sierra and work only on iOS10 devices.

In both build-libevent.sh and build-tor.sh I changed
if [ "${ARCH}" == "i386" ] || [ "${ARCH}" == "x86_64" ]; then
EXTRA_CONFIG="--host=${ARCH}-apple-darwin"
else
EXTRA_CONFIG="--host=arm-apple-darwin"
fi

and in build-tor.sh I added the -Wno-implicit parameter to the compiler flags to ignore the warning about the implicit function declaration of getentropy.
I don't feel this is an adequate fix because it won't run on iOS lower than 10 now, this is because of a different version of libSystem.dylib, one of which doesn't have the symbol _clock_gettime. I'll keep looking for a better fix.

If you patch libevent's configure script and remove checks for clock_gettime, this makes it run on a 9.2 simulator, but not yet on a 9.3.1 device. This feels a bit too hacky too.

I've pushed the changes to my own fork, but might roll back the last commit if @chrisballinger wants to merge without it.

@rainwolf
Copy link
Contributor

Currently my fork compiles on XCode 8 and runs on iOS 10 and probably down to 8, I can confirm it works on 9.3.1.

@chrisballinger
Copy link
Collaborator

Oh okay great. Yeah there's no way I can test on iOS 8 either so if it runs
on iOS 9 it's probably ok. :)

On Thu, Sep 22, 2016 at 1:12 PM, rainwolf [email protected] wrote:

Currently my fork compiles on XCode 8 and runs on iOS 10 and probably down
to 8, I can confirm it works on 9.3.1.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#49 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAfqH4Bk7ayG0ZCJYBc5JciSHiFtkjFlks5qsuE6gaJpZM4KAA6U
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants