libSystem.dylib provides clock_gettime and getentropy from iOS 10 onward but not below but the configure script does not detect that. Even with the -Wl,-no_weak_imports
linker flag. The only way I managed to compile for iOS8 and iOS9 on macOS Sierra with XCode8 was to patch out detection of clock_gettime and getentropy from the configure script. This is less-than-ideal but the only fix I know. I attached the patch that I used on configure.
Trac: Username: rainwolf
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items ...
Show closed items
Linked items 0
Link issues together to show that they're related.
Learn more.
They mention here that the new linker flag -Wl,-no_weak_imports should fail to link if the link would be a leak link. (This happens when you use the Apple-supplied headers and they indicate the symbol was added after your current deployment target.)
This should cause the tests for clock_gettime and getentropy to fail correctly if you were to target an OS version that doesn't supply them.
This is broken on Tor 0.2.8.9 too, right? So it's not a regression?
It seems smart to get Tor building on this new esoteric platform with its new bugs, so we will have a Tor stable that builds on it. But also it seems smart to not let this ticket hold up the 0.2.9 stable if it's the only ticket remaining and we haven't solved it by then.
I tried making an example program as small as possible to still use getentropy():
{{{
#include <sys/types.h>
#include <sys/random.h>
#include <stdio.h>
I tried compiling it in lots of different ways, but I couldn't find a way to tell gcc to ignore the presence of getentropy()....
{{{
% gcc -Wall -Wl,-no_weak_imports getentropy_test.c -o get
% gcc -Wall -mmacosx-version-min=10.10 -Wl,-no_weak_imports getentropy_test.c -o get
% ( export MACOSX_DEPLOYMENT_TARGET=10.10 ; gcc -Wall -mmacosx-version-min=10.10 -Wl,-no_weak_imports getentropy_test.c -o get )
}}}
I wonder if Apple messed up somehow and forgot to tag these APIs as 10.12 only? Or maybe I'm doing something wrong with the above.
Yes, Apple messed up and forgot to tag the APIs.
So any tor built on Sierra won't run on older OS X.
So it's a platform bug, not a tor version bug.
Let's fix it if we can, probably by testing MACOSX_DEPLOYMENT_TARGET ourselves (ugh).