cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: macOS10.12/Xcode8 introduces run-time crash when building libcurl for earlier iOS versions

From: Martin Storsjö <martin_at_martin.st>
Date: Wed, 19 Oct 2016 14:28:05 +0300 (EEST)

On Tue, 11 Oct 2016, Daniel Stenberg wrote:

> On Fri, 16 Sep 2016, Martin Storsjö wrote:
>
>> -Werror=partial-availability is probably safe to add by default (if the
>> compiler supports it), since it matches how configure checks are used - if
>> a function is available and can be linked, we're free to use it.
>>
>> But then we also need to make sure the user sets a sensible
>> -mmacosx-version-min or -miphoneos-version-min, which hasn't been quite
>> necessary so far. Or do OSX users generally set those whenever building
>> things?
>
> I would expect that people building curl mostly just use what configure
> generates for them.
>
>> Should configure warn if they aren't set - or set a sensible default low
>> version if it isn't? Given the number of current and legacy systems that
>> one can build it for, picking a sensible default is a bit tricky.
>
> I really can't tell how to do this as I know next to nothing about how
> macOS/iOS versions differ and change between releases.
>
> If nobody else speaks up, make an educated guess that seems to work for you
> and then we move forward and adjust accordingly if people find problems with
> the current set?
>
> I would really appreciate some help on fixing this configure issue. I think
> it would be a pity to keep releasing curl without having this issue sorted
> out. Even if the blame for this is totally not ours.

Well technically, it's probably not ours, but more in the difference
between how autoconf/configure tests in general check for features, vs the
fact that xcode is more like a cross compiler with a target SDK which
might not be the exact same as you're running on (and they only ship the
latest version, expecting you to use flags like these to select the
target).

Anyway, as for a concrete fix, I guess we should look for whether the user
has specified -mmacosx-version-min or -miphoneos-version-min in some way,
and if not, add them with a default version. -Werror=partial-availability
should probably be safe to add in any case.

The second question is what to pick for the default; a common
lowest-possible version, say 10.5 or something such, or should we try to
detect the version of the running system? The latter is a bit hard if
targeting iOS, where you can't inspect the intended target system (but in
those cases, it's probably a much higher probability that the user has set
this flag already).

I don't think setting the minimum to 10.5 would bother anybody; I don't
think that people on 10.12 will be bothered by the fact that it doesn't
use clock_gettime even though it is available on their system, and I'm not
sure if there's any other system function that has been introduced
inbetween that would matter (like poll, which is disabled anyway).

// Martin

-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2016-10-19